[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: coreutils-7.6: "df" does not show filesystem mounted via mount(2)
From: |
Stuart Kemp |
Subject: |
RE: coreutils-7.6: "df" does not show filesystem mounted via mount(2) |
Date: |
Wed, 28 Oct 2009 14:37:44 +0000 |
It is mount(8) and umount(8) that maintain /etc/mtab. I don't think this is
intended to be a definitive list (on Linux) of all mounted areas. As it states
in the mount(8) man-page 'It is possible that /etc/mtab and /proc/mounts don't
match. The first file is based only on the mount command options..."
Yes, the app I was playing with does not call addmntent() or anything else to
explicitly manipulate /etc/mtab. But it should not have to, since all of this
mount-data is already available from the kernel (via /proc/mounts); as such it
seems redundant to even have /etc/mtab. The problem could also arise using the
"-n" option of mount(8). It would seem logical to use a definitive set of
information, given that it is readily available i.e. get the mounted
filesystems from /proc/mounts, rather than the arbitrary data that may (or may
not) be in /etc/mtab. And this addresses a limitation in the current
implementation.
And of course, using mount(8) with no arguments also has a "problem" in that it
lists the contents of /etc/mtab, rather than what is actually mounted!
-Stuart Kemp
> From: address@hidden
> To: address@hidden
> CC: address@hidden
> Subject: Re: coreutils-7.6: "df" does not show filesystem mounted via mount(2)
> Date: Wed, 28 Oct 2009 12:37:50 +0100
>
> Stuart Kemp wrote:
> > Using FC 11; problem occurs with "df" from installed coreutils-7.2 and also
> > coreutils-7.6
> >
> > Problem:
> > Application uses mount(2) to mount a filesystem. This works just fine,
> > and the filesystem can be accessed. However, "df -a" does not show this
> > filesystem. Problem is that "df" uses setmntent() with /etc/mtab (see
> > lib/mountlist.c), but the /etc/mtab file is not updated when mount(2) is
> > called (application is run by root). File /proc/mounts does indeed contain
> > the newly mounted filesystem info. /proc/mounts is a sym-link; both root
> > (who ran the applicaiton) and a non-root user have the same contents in
> > /proc/mounts.
> >
> > I tried this with both a local filesystem of type "ext3" and mounting from
> > a Windows machine ("cifs").
>
> Thanks for the report.
> However, if /etc/mtab is not being updated,
> then I suspect that is your problem.
_________________________________________________________________
Windows 7: It works the way you want. Learn more.
http://www.microsoft.com/Windows/windows-7/default.aspx?ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen2:102009