I'm trying to set up a virtual machine running Red Hat EL (actually Scientific Linux, but same difference) where the root file system is protected and not writable. I'd like to accomplish this with a union mount using aufs. That is, a writable file system (on a different virtual HDD) is overlayed on the root file system.
Is there a HOWTO on this anywhere? I have the aufs module installed, and I've been able to mount a union file system, but the trick is to do this for the root file system.
I've seen initramfs scripts help.ubuntu.com/community/aufsRootFileSystemOnUsbFlash written for Debian/Ubuntu-style distributions that do this sort of thing inside the /init script: Before the real root is mounted, the protected root is mounted somewhere as read-only, the overlayed file system is mounted elsewhere as read-write, the union file system is created and mounted, and then the union mount becomes the real root. Hence, the original protected root file system is never mounted as read-write.
I'd like to know how to do this in the nash /init script of Red Hat distributions.
Even more specific questions: What exactly do the nash commands "setuproot" and "switchroot" do? The man page for nash(8) documents switchroot with a single argument, but my /init script calls it without any arguments.
(Motivation: the virtual machine will be subjected to software fault injection; I want to protect the root file system from the effects of a faulty system so that I can quickly reboot the VM into a non-faulty state.)
Thanks!!
P.S. Yes, I could just download some LiveCD and see how it's done there, but I thought somebody should have written a HOWTO that my Googling skills have not discovered.