Re: About /etc/mtab and /proc/mounts

Kasper Dupont
2003-02-27T08:02:20Z

Dominik Kubla wrote:
>
> I would recommend to replace /etc/mtab with a pseudo-FS like Sun did
> for /etc/mnttab:
>
> # uname -rs
> SunOS 5.8
> # mount -p
> ...
> mnttab - /etc/mnttab mntfs - no dev=39c0000
> ...

How does that thing behave? I have considered a /proc/mtab implementation,
that might be slightly similar. It would have to be like /proc/mounts, but
differ in a few fields. The mountpoint and filesystem fields should be
exactly like /proc/mounts, while the device and options fields should be
strings initialized with the same values as /proc/mounts, but otherwise
writable from userspace.

Every line written to /proc/mtab should be parsed into the fields, and
the mountpoints should be searched for a match, if a match is found, the
device and options fields are updated, otherwise the write is simply
ignored.

How does people like this idea? Should something more be done about the
options field? Should they be checked for obvious inconsistencies, or
should a write attempt to remount the filesystem with the new options?

--
Kasper Dupont -- der bruger for meget tid på usenet.
For sending spam use mailto:aaarep@daimi.au.dk
for(_=52;_;(_%5)||(_/=5),(_%5)&&(_-=2))putchar(_);