Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
/etc/mtab and /proc/mounts
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Kobboi
l33t
l33t


Joined: 29 Jul 2005
Posts: 662
Location: Belgium

PostPosted: Wed Nov 26, 2008 11:25 am    Post subject: /etc/mtab and /proc/mounts Reply with quote

Following the installation handbook, I see an /etc/mtab is created with the contents of /proc/mounts. I've never really understood what that does. It seems to be needed by grub-install. On a running system, I notice that both files are not the same. What's the exact purpose of /etc/mtab? What processes read it? (write it?)
Back to top
View user's profile Send private message
notHerbert
Advocate
Advocate


Joined: 11 Mar 2008
Posts: 2228
Location: 45N 73W

PostPosted: Wed Nov 26, 2008 6:12 pm    Post subject: Reply with quote

Google is your friend :P
Back to top
View user's profile Send private message
Kobboi
l33t
l33t


Joined: 29 Jul 2005
Posts: 662
Location: Belgium

PostPosted: Wed Nov 26, 2008 11:31 pm    Post subject: Reply with quote

As if I hadn't googled it. Don't you know situations in which a friend can give you the essence of something? I was looking for that kind of friend.
Back to top
View user's profile Send private message
notHerbert
Advocate
Advocate


Joined: 11 Mar 2008
Posts: 2228
Location: 45N 73W

PostPosted: Wed Nov 26, 2008 11:53 pm    Post subject: Reply with quote

I see that /proc/mounts tacks on an errors=continue mount option for ext2 filesystems. :)
Back to top
View user's profile Send private message
Suicidal
l33t
l33t


Joined: 30 Jul 2003
Posts: 952
Location: /dev/null

PostPosted: Thu Nov 27, 2008 1:38 am    Post subject: Reply with quote

man mount wrote:
It is possible that files /etc/mtab and /proc/mounts don’t match. The
first file is based only on the mount command options, but the content
of the second file also depends on the kernel and others settings (e.g.
remote NFS server. In particular case the mount command may reports
unreliable information about a NFS mount point and the /proc/mounts
file usually contains more reliable information.
Back to top
View user's profile Send private message
Kobboi
l33t
l33t


Joined: 29 Jul 2005
Posts: 662
Location: Belgium

PostPosted: Mon Dec 01, 2008 11:27 am    Post subject: Reply with quote

I have read that too, but you can hardly say it makes everything clear. What's the reason for /etc/mtab's existence if /proc/mounts "is more reliable" ?
Back to top
View user's profile Send private message
djinnZ
Advocate
Advocate


Joined: 02 Nov 2006
Posts: 4831
Location: somewhere in L.O.S.

PostPosted: Mon Dec 01, 2008 12:40 pm    Post subject: Reply with quote

/etc/mtab come as legacy from the old unix system, before the introduction of /proc.
Its primary function, mantain th list of the mounted filesystems, will be easy replaced by a symlink and by adding the -n option at mount in the rc scripts (or better patching mount to not write on /etc/mtab as default).
Is only useful to debug or on emebedded systems without proc support IMHO.

I remember than is mentioned in the posisx standard also.
_________________
scita et risus abundant in ore stultorum sed etiam semper severi insani sunt:wink:
mala tempora currunt...mater stultorum semper pregna est :evil:
Murpy'sLaw:If anything can go wrong, it will - O'Toole's Corollary:Murphy was an optimist :wink:
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1600
Location: PB, Germany

PostPosted: Tue Oct 14, 2014 10:46 am    Post subject: Reply with quote

Old issue, but what is the current state of /etc/mtab? I remember on some update somewhere that today /etc/mtab should symlink to proc, is that right?
_________________
ppc:PowerBook5,8 15"(1440)-G4/1.67,2G|amd64:HP EliteBook 8560w,i7-2620M,16G|amd64-prefix:OpenSuse|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Lila-Theme
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6618

PostPosted: Tue Oct 14, 2014 7:06 pm    Post subject: Reply with quote

It should be a symlink to /proc/self/mounts.
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1600
Location: PB, Germany

PostPosted: Sun Nov 09, 2014 5:40 pm    Post subject: Reply with quote

When mounting some LUKS device with pam_mount at login, I see in the logs:
Code:
(mount.c:72): NOTE: mount.crypt does not support utab (systems with no mtab or read-only mtab) yet. This means that you will temporarily need to call umount.crypt(8) rather than umount(8) to get crypto volumes unmounted._

Does that conflict with the symlink? Is it better to create a copy instead of a symlink for mtab?
_________________
ppc:PowerBook5,8 15"(1440)-G4/1.67,2G|amd64:HP EliteBook 8560w,i7-2620M,16G|amd64-prefix:OpenSuse|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770
Lila-Theme
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum