OK, so I do have a working read-only system on an SD card that allows the read/write switch to be set to read-only mode. I'm going to answer my own question, since I have a feeling I'll be looking here again for the steps, and hopefully this will help someone else out.
While setting various directories in
/etc/fstab as read-only on a Red Hat Enterprise Linux 6.6 system, I found the file
/etc/sysconfig/readonly-root. This piqued my interest in what this file was used for, as well as any ancillary information regarding it. In short, this file contains a line that states, "
READONLY=no". Changing this line automatically loads most of the root file system as read-only while preserving necessary write operations on various directories (directories and files are loaded as tmpfs). The only changes I had to make were to set
/root, and a few other directories as writable through the
/etc/rwtab.d directory and modify /etc/fstab to load the root file system as read-only (changed "
defaults" to "
ro" for root). Once I set "
READONLY=yes" in the
/etc/sysconfig/readonly-root file, and set my necessary writable directories through
/etc/rwtab.d, as well as the
fstab change, I was able to get the system to load read-only, but have writable directories loaded into RAM.
For more information, these are the resources that I used:
Also, I did a quick verification on Red Hat Enterprise Linux 7.0, and this file is still there and works. My test environment was CentOS 6.6 and 7.0 in a virtual machine as well as RHEL 6.6 and 7.0 on a VME single-board computer.
NOTE: Once the root is read-only, no changes can be made to the root system. For example, you cannot use yum to install packages and have them persist upon reboot. Therefore, to break the read-only root, I added a grub line that removes rhgb and quiet (this is only for debugging boot issues, you can leave them if you want), and added "
init=/bin/bash". This allowed me to enter into a terminal. Once at the terminal, I typed, "
mount - / -oremount,rw" to have the system writable. Once writable, I modified (using
/etc/sysconfig/readonly-root to say "
READONLY=no" and rebooted the system. This allows me to perform maintenance on the system by turning off read-only. If you are using an SD card like I am, then the read/write switch on the SD card needs to be set to writable.