symlink to /proc/mounts

Gerard Beekmans gerard at linuxfromscratch.org
Wed Jan 1 11:02:57 PST 2003


On January 1, 2003 11:41 am, Andries.Brouwer at cwi.nl wrote:

k since you're not subscribed, and our search engine is down you probably 
don't know why we moved from a regular file to a symlink in the first place.

I'm not going to rehash the entire discussion again (if you really want to 
know I can send you the lfs-dev mbox file, the discusson spans a few months 
all together). It all started with shutdown problems where /etc/mtab 
contained stale information upon the next boot and mount didn't want to mount 
something it thought was already mounted.

Yes, we're aware that you can put a few lines in a bootscripts that basically 
does a "mount -o remount,rw / && echo > /etc/mtab" (or cat instead of echo, 
whichever you want).

Then that caused problems for other kinds of people because they want their 
root partition mounted read-only for which there are good reasons. 
Suggestions were made to then move the /etc/mtab file elsewhere, say /var and 
make /etc/mtab a symlink to /var/mtab or whereever it would end up (probably 
/var/misc/mtab or something). That is an idea in itself but, behold, the 
"/var on a seperate partition" camp would get into problems that there's no 
mtab file present until the mountfs bootscript runs.

So in the end it was "the heck with this, we'll ln -sf /proc/mounts /etc/mtab 
and be done with it. If people don't like it, they can make the file a 
regular file again using 10 different ways depending on how they installed 
their LFS system".

At first the symlink sparked other discussions such as loopback devices, but 
'mount -d' works nicely and in recent months we noticed mount without -d does 
the job too now. Then the 'user' option in /etc/fstab was brought up, but 
then people realized they often mean to use 'users' anyways so it wasn't that 
big of a deal. The NFS issue is the only real thing remaining, but again not 
a big deal to most people. And to whom it is a big deal: 
http://hints.linuxfromscratch.org/hints/mtab.txt
Details most of the different situations (normal setup, read-only / partition, 
and so on) so you can pick one and modify to your taste.

The LFS book isn't a bible to setting up the only kind of LinuxFromScratch. 
Just a guide and showing possible ways of doing it. They're not always the 
best way for everybody, hence the whole LFS thing - do it the way you need 
it, not the way somebody (a person or a distribution) decides to do it for 
you.



-- 
Gerard Beekmans
www.linuxfromscratch.org

-*- If Linux doesn't have the solution, you have the wrong problem -*-
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-dev' in the subject header of the message



More information about the lfs-dev mailing list