Educational question

Jason Stevens jastev at alumni.rice.edu
Sat Feb 25 09:54:03 PST 2006


Dimitry Naldayev wrote:
>>
>> Looking at the HLFS build, it seems reasonable (to me, anyway) that
>> one might construct a small root filesystem with /boot, /dev, /lib,
>> /bin, and /sbin on it, and then mount /usr (if it needed to be
>> separate) and /opt, /home, /svr, etc as separate filesystems onto it.
>> Again, it seems natural to me to mount / as read-only; root can always
>> boot single-user and remount it rw if sysadmin needs to be done on it,
>> otherwise nothing should be written to it.
>>
>> And yet, this does not seem possible.  The rc script that init runs
>> ignores the options field (and /etc/fstab altogether) and simply
>> remounts / read-write.  Why would I necessarily need to mount / rw?
>> Am I missing something obvious?
> 
> You are missing /etc. It mast be part of / (root fs) becouse init need some
> information from there

Hm.  I wonder if I could get by with just /etc/rc.d/rcsysinit.d on / in 
order mount filesystems, one of which would be a "real" /etc in a 
separate partition.

I need most of /etc to be outside of the / filesystem, because it's not 
shareable - but that particular part should be common.

I'm doing basically the same thing with root's home dir, putting a small 
/home/root on / (ro), that gets mounted over by another /home filesystem 
on a different partition (mounted rw).

> and several files in /etc need to be writable ;-/
> Most famous is /etc/mtab and there workaround about this, but there are a
> few other depending on what software you have installed

Archaic posted a file recommending replacing /etc/mtab with a link to 
/proc/mounts.

I imagine that for other software, if they insisted on having writable 
files in /etc, I could do the same thing:  give them space in /var or 
/srv and link to it from /etc.

-jps



More information about the hlfs-dev mailing list