Re: Get rid of /etc/mtab ?
In article <[🔎] email@example.com>,
Goswin Brederlow <firstname.lastname@example.org> wrote:
>Marc Wilson <email@example.com> writes:
>Alternatively a /var/state/mount or something might be the right[tm]
>way to store state information about mounts.
No, not under /var.
>> 2) users to have to run OUR kernel (if WE change it)
>Debian doesn't enforce / RO but it also shouldn't enforce / RW.
>Alowing for a /proc/mounts file that is sufficient to replace
>/etc/mtab is a good thing in my eyes. People who wan't / RO can then
>just use that option to their kernel and add the neccessary link.
You simply need to mount an instance of shmfs somewhere (for
example, under /dev/shm which is needed for POSIX shm *anyway*),
then you do
# mount -t shm shm /dev/shm
# cp -a /etc/mtab /dev/shm/mtab
# mount --bind /dev/shm/mtab /etc/mtab
See? Suddenly /etc/mtab is stored in memory.
It doesn't *quite* work yet:
# umount /mnt
can't rename /etc/mtab.tmp to /etc/mtab: Device or resource busy
.. so that needs to be fixed in "mount" first. Perhaps by using
a symlink instead of a bind mount, then teach mount to use the
dir the symlink points to for temp files too, or something.
To UNSUBSCRIBE, email to firstname.lastname@example.org
with a subject of "unsubscribe". Trouble? Contact email@example.com