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.

In my understanding, the term 'root file system' is ambiguous, it actually refers to two different things. One is the absolute minimal file system needed to accomplish system setup together with the kernel. It contains some early user space programs which perform hardware detection, module loading, device discovery and so on. This file system is often referred to as 'rootfs'. The other is the 'real' root file system. It may locates on a local disk or on a remote server (for systems that support boot from ethernet).

I've explored several Linux Distros using 'mount' command. Some have 'rootfs on / type rootfs' in the result, while others don't. And all of them have something like '/dev/sdaX on / type extX'.

I'm wondering whether the mechanism has changed or the rootfs is just unmounted for those that don't have 'rootfs on / type rootfs'.

I've tried to seek the answer by wiki and google, but ended up more confused.

Can anybody help me?

share|improve this question

migrated from stackoverflow.com Aug 31 '12 at 11:15

This question came from our site for professional and enthusiast programmers.

1 Answer 1

The mount command takes information about current mounts from /etc/mtab.

In the past, mtab was a normal file re-created after every boot and updated by the mount command – so it wouldn't have a rootfs / entry simply because the rootfs is never explicitly mounted; it just always exists. (Such a mtab sometimes also has duplicate entries, or entries for filesystems that aren't mounted anymore...)

Many current distros now symlink mtab to /proc/self/mounts, which (like everything else in /proc) is directly generated by the kernel. Because of this, it always shows everything that is currently mounted, including both rootfs / and /dev/blah /.

You can use cat /proc/self/mounts on all distros to compare the mounts. (There also is /proc/self/mountinfo, which uses an incompatible syntax but adds more detail.)

share|improve this answer
    
+1 for /proc stuff I didn't know about. –  Joe Sep 3 '12 at 18:42

Your Answer

 
discard

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