[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Get rid of /etc/mtab ?

In article <[🔎] 871y9tpl6f.fsf@mrvn.homelinux.org>,
Goswin Brederlow  <goswin.brederlow@student.uni-tuebingen.de> wrote:
>Marc Wilson <msw@cox.net> 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
	# :>/etc/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 debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Reply to: