[systemd-devel] pivot_root to a tmpfs directory to properly umount root
Harald Hoyer
harald at redhat.com
Thu May 5 03:59:27 PDT 2011
Am 05.05.2011 12:47, schrieb harald at redhat.com:
> With this patch series, it is possible to umount the root device and deconstruct it.
>
> You can copy a bash to /lib/systemd/system-shutdown/ and it will be executed at the end.
> Then you can cat /proc/mounts with:
>
> # while read line; do echo $line; done < /proc/mounts
>
> And your root device should not be showing up.
>
> See:
> http://www.harald-hoyer.de/files/systemd-pivot.png
>
The only problem, I have seen, is if on Fedora 15 the "sandbox" initscript was
executed, which does:
mount --make-rshared /
mount --rbind /tmp /tmp
mount --rbind /var/tmp /var/tmp
mount --make-private /tmp
mount --make-private /var/tmp
for h in /home; do
mount --rbind $h $h
mount --make-private $h
done
Afterwards the root device does not lose it's refcounts and I don't know how to
revert the above actions.
More information about the systemd-devel
mailing list