2001-03-19 23:07:29

by Torrey Hoffman

[permalink] [raw]
Subject: on /etc/mtab vs. /proc/mounts (Was RE: Linux should better cope w ith power failure)

(Recipients trimmed, as this is a major change of topic...)
[big cut]

> Actually, I think /etc/mtab is not needed at all.

This is already mostly correct, AFAIK.

My embedded system uses "busybox" for mount and umount, /etc/mtab
does not exist, and the root file system is readonly.

But if I do "umount -a" it works. So the busybox umount is already
reading /proc/mounts.

The only oddity I see with using /proc/mounts is that it shows:
/dev/root / ext2 rw 0 0
instead of
/dev/hda1 / ext2 rw 0 0

but this doesn't seem to cause any problems... even though /dev/root
does not exist (!)

In fact, the "mount" man page on my Mandrake 7.2 system says:

"It is possible to replace /etc/mtab by a symbolic link to
/proc/mounts..." and then goes on to describe some of the issues and
problems with doing so - loopback, and paths with spaces seem to
be the significant ones.

Hopefully those problems can and will be solved soon, and then
we can get rid of /etc/mtab completely, and keep the root partition
read only almost all the time.

Torrey Hoffman


2001-03-19 23:44:20

by Guest section DW

[permalink] [raw]
Subject: Re: on /etc/mtab vs. /proc/mounts

On Mon, Mar 19, 2001 at 03:05:55PM -0800, Torrey Hoffman wrote:

> In fact, the "mount" man page on my Mandrake 7.2 system says:
>
> "It is possible to replace /etc/mtab by a symbolic link to
> /proc/mounts..." and then goes on to describe some of the issues and
> problems with doing so - loopback, and paths with spaces seem to
> be the significant ones.

The spaces part was fixed in patch-2.4.0-test7.

Today there is a different flaw again:
After "mount --bind somedir mountpoint" there is no
indication of somedir in /proc/mounts.

Andries