[CentOS] Problem with RW_MOUNT in a diskless system

Tue Mar 18 00:38:06 UTC 2014
Allan Wu <allwu at cs.ucla.edu>

Hello everyone,

I have a problem with setting up a diskless system on CentOS. Currently I
have successfully set up a small cluster of diskless clients following the
following available HowTos:

The client system is CentOS 5.10 and the system is read-only. It has been
working fine for a while (although I discard some initiation errors, but as
of functionality it is working). But recently when I tried to setup autofs
to mount some of the directories from NIS server, I've been having problems
because /etc/mtab is not writable. I have enabled temporary state in the
OS, please find below my /etc/sysconfig/readonly-root:
# Set to 'yes' to mount the system filesystems read-only.
# Set to 'yes' to mount various temporary state as either tmpfs
# or on the block device labelled RW_LABEL. Implied by READONLY
# Place to put a tmpfs for temporary scratch writable space
# Label on local filesystem which can be used for temporary scratch space
# Options to use for temporary mount
# Label for partition with persistent data
# Where to mount to the persistent data
# Options to use for peristent mount

Now my solution is making a symbolic link for /etc/mtab to its snapshot in
/var/lib/stateless/writable. However, since by default it is mounted on
tmpfs instead of NFS, every time the machine reboot, mtab is lost and there
are all kinds of problem. So I created another mtab.bak and copy that to
the RW_MOUNT when system start. That solves my problem, although I feel the
approach is really ugly.

So my questions are below:
1. How to mount my RW_MOUNT on my NFS snapshot directory by default? The
instructions are not clear on this part.
2. If I can use NFS as snapshot, how do I tell the system which file I want
to use the writable version in RW_MOUNT, is there a more elegant way to do
3. Could someone points me some direction or background on the snapshot
idea? I've looked into /etc/rc.sysinit and saw the part to mount the
stateless directory, but more information could be helpful.

Thank you in advance!

Di Wu (Allan)
Center of Domain-Specific Computing <http://www.cdsc.ucla.edu/>,
Department of Computer Science, UC Los Angeles
Email: allwu at cs.ucla.edu
Phone: 310-982-5215