<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">I am new to systemd. I am currently running Ubuntu 15.04 with ZFS. I would like to switch root filesystem to a tmpfs during system shutdown to reset root ZFS mount point (to dual boot FreeBSD). I have used /lib/systemd/system-shutdown/foo script. I have tried using systemctl switch-root, but the dbus daemon is already killed at this point. Starting dbus manually did not help much (getting "input/output error" on systemctl status and "launch helper exited with unknown return code 1” on systemctl switch-root). I have also tried using pivot_root after moving mounts to the new fs (except where temps is mounted), but this resulted in “device or resource busy” error.</div><div class=""><br class=""></div><div class="">Could you please advise how should I perform the root switch? Should I use systemctl switch-root or pivot_root - and what are prerequisites?</div><div class=""><br class=""></div><div class="">— FILE /lib/systemd/system-shutdown/foo —</div><div class=""><br class=""></div><div class=""><div class="">mount -o remount,rw / > /dev/console 2>&1</div><div class="">/etc/init.d/dbus start > /dev/console 2>&1</div><div class="">mount none /tmp -t tmpfs > /dev/console 2>&1</div><div class="">cd /tmp > /dev/console 2>&1</div><div class="">mkdir dev proc sys run > /dev/console 2>&1</div><div class="">ls -la > /dev/console 2>&1</div><div class="">mount | grep tmp > /dev/console 2>&1</div><div class="">zcat /boot/initrd.img-3.19.0-15-generic | cpio -id > /dev/console 2>&1</div><div class="">cp /root/shutdown /tmp > /dev/console 2>&1</div><div class="">systemctl status > /dev/console 2>&1</div><div class="">systemctl switch-root --force /tmp /shutdown > /dev/console 2>&1</div></div><div class=""><br class=""></div><div class="">— END FILE —</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div class="">Thanks in advance for advice!</div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Best,</div><div class=""><br class=""></div><div class="">Radek</div><div class=""><br class=""><div class="">
<span class="Apple-style-span" style="border-collapse: separate; line-height: normal; border-spacing: 0px;"><div class="">-- <br class="">Radoslaw Kamil Ejsmont, Ph.D.<br class=""><a href="http://radoslaw.ejsmont.net/" class="">http://radoslaw.ejsmont.net</a></div></span>

</div>
<br class=""></div></body></html>