Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 4 down vote accepted
+50

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.

enter image description here

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: https://www.kernel.org/doc/Documentation/filesystems/ramfs-rootfs-initramfs.txt

share|improve this answer
    
That was a good answer explaining the rootfs file system, and explains the limited commands available, but there is nothing about the prompt itself and what you can do with it. –  wolfo9999 Jun 5 '13 at 19:05
    
@wolfo9999: I updated my answer to explain better. –  QMechanic73 Jun 5 '13 at 20:10
    
You sure did :) great answer now that I can visualize it. +50 when I can award it. Says I have to wait 17 hours. Although that's enough time for someone else to make a better answer if they can. –  wolfo9999 Jun 5 '13 at 20:26
    
@TiagoƇ. Really great answer that helped me a lot too! May I ask where this great graphic explanation is from? A source link would be nice ;) –  erch Dec 3 '13 at 22:13
    
@chirp look in kernel.org/doc/Documentation/filesystems/… =] –  QMechanic73 Dec 3 '13 at 22:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.