I have been dropped to a [rootfs /]# prompt many times when booting my distro failed. Usually I found I couldn't fix the problem with the limited commands available, so I would use any spare Live CD I had laying around.
But what is the rootfs prompt? Why does it have limited commands available? And can I use it to boot my system after the problem has been fixed?
1 Answer
Rootfs is a special instance of ramfs (or tmpfs, if that's enabled), which is
always present in 2.6 systems. You can't unmount rootfs.
At kernel initialization time, there is an absolutely minimal filesystem registered, called rootfs. The code that implements this filesystem can be found in fs/ramfs/inode.c, which also happens to contain the code for the ramfs filesystem. rootfs is basically identical to ramfs, except for the specification of the MS_NOUSER flag. This is interpreted by the routine graft_tree in fs/namespace.c, and I think it prevents userland processes doing their own mounts of rootfs.
The routine init_mount_tree (found in fs/namespace.c) is called at system startup time to mount an instance of rootfs, and make it the root namespace of the current process (remember that, under Linux, different processes can have different filesystem namespaces).
It contains all applications, settings, devices, data and more. Without the root file system, your Linux system can not run.
See:
7