Comment Why NULLFS: (Score 5, Informative) 28
I was curious so I looked up the details about NULLFS.
Apparently, there is an issue with swapping the root filesystem which is done using the syscall pivot_root()... but not with initramfs,
per the man page...
The rootfs (initial ramfs) cannot be pivot_root()ed. The recommended method of changing the root filesystem in this case is to delete everything in rootfs, overmount rootfs with the new root, attach stdin/stdout/stderr to the new
So basically, this fixes a long-standing hack that well... is not safe in some cases, most notably with with containers (CVE-2020-15257). The proper solution was to make a simple null filesystem that could use pivot_root and swap out the rootfs without hacks.
More details here: https://lwn.net/Articles/10621...
And here: https://www.linkedin.com/pulse...