2005-02-16 08:17:20

by Frank Steiner

[permalink] [raw]
Subject: /etc/mtab as symbolic link

Hi,

we are facing a problem which I've found (in google) to be a common
problem with diskless systems:

On diskless clients, mounting / ro from a server, /etc is not writable.
Like on other diskless systems, we are using links from /etc/ to some
local partition (here: /etc/local) and link the files which the clients
need to write to, into /etc/local.

For /etc/mtab, that doesn't work, because mount/umount create tmp
files in /etc/ and would also destroy the link (if they could write
to /etc). Linking /etc/mtab to /proc/mounts is not possible due to the
known drawbacks.
Currently, I patch util-linux myself to set _PATH_MOUNTED to /etc/local/mtab
in pathnames.h and include that file in fstab.h, but that's a very
specific solution for our system.

So my question: Is there a chance to change util-linux to make it

- leave /etc/mtab as symbolic link, i.e. work on the real file
/etc/mtab is linked to instead of removing the link and recreating
a normal file /etc/mtab?

- create all the tmp files in the directory where /etc/mtab is linked
to, e.g., if /etc/mtab is a link to /etc/local/mtab, the tmp files
should be created in /etc/local/, too?

This would defitinely help for diskless systems. I'm not familiar
with C, otherwise I would try it myself. Maybe it's not that difficult,
because I could change the location by just one definition in pathnames.h
and including this file in fstab.h. Would it be enough to replace the
definition in pathnames.h by some function like "if /etc/mtab is a
link then use the result of `readlink /etc/mtab`, otherwise take the
default location"? But I have no idea how to that in C.

cu,
Frank

--
Dipl.-Inform. Frank Steiner Web: http://www.bio.ifi.lmu.de/~steiner/
Lehrstuhl f. Bioinformatik Mail: http://www.bio.ifi.lmu.de/~steiner/m/
LMU, Amalienstr. 17 Phone: +49 89 2180-4049
80333 Muenchen, Germany Fax: +49 89 2180-99-4049
* Rekursion kann man erst verstehen, wenn man Rekursion verstanden hat. *



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs