LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   /etc/mtab vs /proc/mounts (https://www.linuxquestions.org/questions/linux-newbie-8/etc-mtab-vs-proc-mounts-4175423955/)

Newbie2Fedora 08-25-2012 11:12 AM

/etc/mtab vs /proc/mounts
 
Hi,

I was reading about mounts and came across fstab, mtab and /proc/mounts, tried to read more about it. I wnated to ask that if
/etc/mtab is actually a link to /proc/mounts, then why do we need it at all ?

abrinister 08-25-2012 11:47 AM

My mtab is actually linked to /proc/self/mounts.

From here:

Quote:

When the proc filesystem is mounted (say at /proc), the files /etc/mtab and /proc/mounts have very similar contents. The former has somewhat more information, such as the mount options used, but is not necessarily up-to-date (cf. the -n option below). It is possible to replace /etc/mtab by a symbolic link to /proc/mounts, and especially when you have very large numbers of mounts things will be much faster with that symlink, but some information is lost that way, and in particular using the "user" option will fail.
Alex Brinister

Newbie2Fedora 08-25-2012 01:47 PM

You r correct !! My mistake. It is linked to /proc/self/mounts

/etc/mtab -> /proc/self/mounts

As far as I understand, proc always shows kernel's in-memory state. Why do we have the information at 2 places, rather 3 (if I include /proc/mounts, proc/self/mounts and /etc/mtab) ?


Also, when system shuts down, where does kernel store its in-memory stats for ex: /proc/self/mounts content ?


All times are GMT -5. The time now is 08:47 PM.