is /run shared to the real filesystem after the initrd stage? like what directories are shared to the real filesystem after initrd, or what files. Or is everything just inaccessible in the real filesystem from the initrd phase.
is /run shared to the real filesystem after the initrd stage? like what directories are shared to the real filesystem after initrd, or what files. Or is everything just inaccessible in the real filesystem from the initrd phase.
man switch_root
If you look at the source code, it uses
mount(2)
with the MS_MOVE flag to move the /proc, /dev, /sys, /run to the new root, then deletes all the files on the old root fs recursively, then MS_MOVE-mounts the new root over the old one. As the comment in the source code points out:This is presumably why it deletes the files on the initrd, because it is a ram disk and the files would be eating up memory if left there.