2003-08-10 08:18:53

by Thomas Hood

[permalink] [raw]
Subject: A mount that follows a symlink at /etc/mtab

In the past wishes have been expressed here for a mount program
that would follow a symbolic link at /etc/mtab. Then, if the root
filesystem is read-only, /etc/mtab can be made a symlink into a
filesystem that is writable. (Of course, that would mean that the
mtab could not be written until the latter filesystem was mounted;
but this problem can be overcome with a "mount -n", "mount -f"
sequence.)

I have patched the latest mount release to follow a symlink at
/etc/mtab . Unlike some earlier patches that have been posted
elsewhere, this one follows a symlink chain to the end and makes
mount create lockfiles and temporary files in the directory of
the link target. The patch is available via this page:
http://panopticon.csustan.edu/thood/readonly-root.html

The new version of the mount program (2.12pre) to which it applies
is available here:
ftp://ftp.win.tue.nl/pub/home/aeb/linux-local/utils/util-linux/

If you are interested in seeing the mount program enhanced in this
way then please try it out and let me know whether or not there are
any problems. If people can confirm that I haven't introduced any
bugs (I have tried to be careful) then I'll submit this patch
upstream.
--
Thomas Hood