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

Måns Rullgård
2003-02-26T11:04:12Z

Olaf Dietsche <olaf.dietsche@t-online.de> writes:

> >>A simpler solution, that does not require changes to the kernel
> >>would be to just move mtab to a more apropriate location. My
> >>suggestion would be to change it from /etc/mtab to /mtab.d/mtab.
> >>Then you could mount a tmpfs filesystem on /mtab.d. Or by making
> >>/mtab.d a symlink, you can get the mtab file whereever you want,
> >>including /etc.
> >
> > /dev/shm ? Supposed to be there on many systems anyway. Fix
> > 'mount' and 'umount' so that if they see /etc/mtab is a symlink,
> > they follow it and create the temp files etc in the destination
> > directory of the link instead of in /etc. Then
> > ln -sf /dev/shm/mtab /etc/mtab et voila
>
> I thought, this is what /var is for. So, /var/run, /var/lib/misc or
> /var/etc might be more appropriate?

What if /var is mounted separately?

> OTOH, "ln -s /proc/mounts /etc/mtab" works just fine here.

The only problem I have with that is that option 'user' is lost. This
means that any user can mount /cdrom, but only root can unmount it.

--
Måns Rullgård
mru@users.sf.net