What are all the files/folders that will be in the filesystem after initrd?
from SpiderUnderUrBed@lemmy.zip to linux@lemmy.ml on 29 Jul 05:44
https://lemmy.zip/post/45008719
from SpiderUnderUrBed@lemmy.zip to linux@lemmy.ml on 29 Jul 05:44
https://lemmy.zip/post/45008719
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.
threaded - newest
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.