Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* /etc/mtab (was Re: Rescue disk set?)
@ 1996-12-25 10:29 Eric Smith
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Smith @ 1996-12-25 10:29 UTC (permalink / raw)


Michal Jaegermann <michal@ellpspace.math.ualberta.ca> wrote:
> For that use "mount -n".  You do not **want** to update /etc/mtab
> on read only file system.  "cat /proc/mounts", which you should have,
> is a good source for the same information.

/etc/mtab is a never-ending source of frustration for me.  I don't understand
why it exists at all.  Surely the mount command doesn't really need it, because
the mount system call will reject improper mounts (or at least it should).
And the umount command shouldn't need it either; it should just do what the
heck I tell it.

I suppose it wouldn't bother me nearly so much if the mount and umount
commands simply made a "best effort" to keep /etc/mtab up to date, but didn't
actually depend on it.  This would satisfy people who don't use /proc/mounts
for whatever reason.  Or at least if the commands had options to ignore
/etc/mtab, so I would be able to get out of sticky situations.  I thought
part of the "Unix Philosophy" was that it provided "enough rope".

Cheers,
Eric

--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: /etc/mtab (was Re: Rescue disk set?)
       [not found] <19961225102941.6325.qmail@brouhaha.com>
@ 1996-12-25 16:48 ` Michal Jaegermann
  0 siblings, 0 replies; 2+ messages in thread
From: Michal Jaegermann @ 1996-12-25 16:48 UTC (permalink / raw)


> 
> > For that use "mount -n".  You do not **want** to update /etc/mtab
> > on read only file system.

Eric "Red Hat" Smith complained:
> 
> /etc/mtab is a never-ending source of frustration for me.  I don't understand
> why it exists at all.

There are two issues here.  One is /etc/mtab~ file, which is a lock
file.  It is not likely that you would want to see a race condition
from two processes trying to mount the same file system and results
of such action. :-)  This could easily happen, especially with
automounter in an operation.  Mounting is a rather prolonged operation.
I guess that assumption is that you are using '-n' flag mostly in
special situations (boot, single)  and then you know what you are doing. :-)

The other one is that /proc pseudo-filesystem is a relatively new
invention, only few kinds of Unix systems around have it, and there
is really no "standard" or "custom" which would tell you what you will
find there.  Even on Linux it is, so far, mostly undocumented (quick,
how do you bump up a number of available file descriptors in current
kernels?).  Therefore portable programs cannot rely on reading
/proc/mounts but have to rely on /etc/mtab (no idea what POSIX has
to say here, if anything at all).  Also lots of various sources
likely predate an existence of /proc, so we have a "legacy" issue here.

As an aside, on my Linux-Intel box I have seen a few times an incident
when /proc "jumped i-node" and all of sudden a contents of /proc
was replaced with a contents of /etc, for example.  Without /etc/mtab
I would not be even able to reboot more or less cleanly.

> I thought
> part of the "Unix Philosophy" was that it provided "enough rope".

To an extent.  You have '-n' options to mount and umount after all. :-)

  Cheers,
  Michal

--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1996-12-25 16:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <19961225102941.6325.qmail@brouhaha.com>
1996-12-25 16:48 ` /etc/mtab (was Re: Rescue disk set?) Michal Jaegermann
1996-12-25 10:29 Eric Smith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox