在内核文档文件"、rootfs和initramfs“中,它说
Rootfs是ramfs的一个特殊实例(如果启用,则为tmpfs ),它总是存在于2.6系统中。
我还没有在我的桌面安装的Linux上看到rootfs在/proc/mounts中,但我确实在我的安卓手机上看到了它。都运行Linux3,还需要rootfs吗?这也是什么?
发布于 2018-07-13 15:17:12
rootfs没有显示在/proc/mounts中-这是否意味着文档过期了?不是的。请参阅为什么我的系统上没有rootfs文件系统?
到Linux4.17版本时,这个内核文档仍然是最新的。rootfs总是存在的,不能卸载。但是,很多时候,您无法在/proc/mounts中看到它。如果引导到initramfs shell,可以看到rootfs。如果您的initramfs是
dracut,就像在Fedora中一样,您可以通过将选项rd.break添加到内核命令行来做到这一点。(例如,在GRUB引导加载程序中):switch_ root :/# grep rootfs /proc/mounts rootfs / rootfs / rootfs rw 0 0当dracut将系统切换到真正的根文件系统时,您将无法再在/proc/挂载中看到rootfs。dracut可以使用switch_root或systemd来完成此操作。这两种操作都遵循链接内核文档中指定的相同的操作顺序。隐藏rootfs的操作是chroot。开关_根:/# cd /sysroot开关_root:/sysroot#挂载-绑定/proc proc开关_root:/sysroot# grep rootfs proc//proc rootfs / rootfs rw 0 0 switch_root:/sysroot# chroot。sh-4.4# cat proc/mounts /dev/sda3 3/ ext4 ro,相对论性0 0 proc /proc proc rw,nosuid,nodev,noexec,相对论性0 0 ...
https://unix.stackexchange.com/questions/238705
复制相似问题