5

Running Debian 7; when I execute a

cat /etc/mtab

I can see all sorts of useful information about the filesystems that are mounted, such as the filesystem and options used to mount then; however for the rootfs I see only:

rootfs / rootfs rw 0 0

How can I know more about the rootfs; which physical device/partition was used, filesystem, mount options etc?

On my system /etc/mtab is in fact a symbolic link to /proc/mounts

lrwxrwxrwx 1 root root 12 May  9  2013 /etc/mtab -> /proc/mounts
nwaltham
  • 231
  • 1
  • 2
  • 7

2 Answers2

4

That rootfs entry is the real root filesystem. It has no device; it is a tmpfs that is automatically mounted by the kernel very early during initialization. Later during the boot process, your disk root filesystem is mounted over top of the rootfs, hiding it from view.

psusi
  • 17,303
  • 1
    Actually, rootfs is still a ramfs not a tmpfs, see my answer http://unix.stackexchange.com/a/77489/15241 – jofel Apr 17 '14 at 14:53
  • That is a really interesting point. Can you edit your answer to include a reference to official kernel documentation on this? – AdminBee Nov 12 '21 at 14:58
2

I think you should be looking into /proc/mounts:

$ cat /proc/mounts

That file has exact device, filesystem and other mount options used to mount different filesystems on your OS. The format is same as of /etc/fstab.

ek9
  • 2,905
  • 1
    If you want to find out only about / then just use df. You can check for filesystem in /etc/fstab – ek9 Apr 17 '14 at 08:23
  • 1
    Found it - I have to look a bit further down the list!!! There is a second place where "/" is mentioned. All the details are there. Thanks a lot! – nwaltham Apr 17 '14 at 11:46
  • On debian, /etc/mtab is a symlink to /proc/mounts. Otherwise, you would not see the rootfs at all. – psusi Apr 17 '14 at 13:41