As an alternative to the IPE-R1, Raspbian can be configured to run in read-only mode for increased stability when running a "rock-solid gateway" (optional but recommended unless running from hdd). Following a discussion on another thread I decided to post this guide I had prepared for the emonhub documentation as it may help other users.
(This avoids any of the updating and driver issues encountered by using the IPE-R1.)
Configuring Raspbian as Read-Only
Submitted by pb66 on Mon, 23/06/2014 - 10:45As an alternative to the IPE-R1, Raspbian can be configured to run in read-only mode for increased stability when running a "rock-solid gateway" (optional but recommended unless running from hdd). Following a discussion on another thread I decided to post this guide I had prepared for the emonhub documentation as it may help other users.
(This avoids any of the updating and driver issues encountered by using the IPE-R1.)
Download the latest Raspbian Image and load to SD-card
Start by updating the downloaded Raspbian image once it's booted
Then run these commands to make changes to filesystem (sorry, not indented, so longer lines won't wrap)
sudo cp /etc/default/rcS /etc/default/rcS.orig
sudo sh -c "echo 'RAMTMP=yes' >> /etc/default/rcS"
sudo mv /etc/fstab /etc/fstab.orig
sudo sh -c "echo 'tmpfs /tmp tmpfs nodev,nosuid,size=30M,mode=1777 0 0' >> /etc/fstab"
sudo sh -c "echo 'tmpfs /var/log tmpfs nodev,nosuid,size=30M,mode=1777 0 0' >> /etc/fstab"
sudo sh -c "echo 'proc /proc proc defaults 0 0' >> /etc/fstab"
sudo sh -c "echo '/dev/mmcblk0p1 /boot vfat defaults 0 2' >> /etc/fstab"
sudo sh -c "echo '/dev/mmcblk0p2 / ext4 defaults,ro,noatime,errors=remount-ro 0 1' >> /etc/fstab"
sudo sh -c "echo ' ' >> /etc/fstab"
sudo mv /etc/mtab /etc/mtab.orig
sudo ln -s /proc/self/mounts /etc/mtab
The Pi will now run in Read-Only mode from the next restart.
Before restarting create two shortcut commands to switch between read-only and write access modes.
Firstly “ rpi-rw “ will be the command to unlock the filesystem for editing, run
and add the following to the blank file that opens
save and exit using ' ctrl-x -> y -> enter ' and then to make this executable run
Next “ rpi-ro “ will be the command to lock the filesytem down again, run
and add the following to the blank file that opens
save and exit using ' ctrl-x -> y -> enter ' and then to make this executable run
Lastly reboot for changes to take effect (note - if serial UART access required make those changes before restarting)
Remember to use “ rpi-rw “ before making any changes and then to use “ rpi-ro “ afterwards to lock the filesystem down again.
Further info on configuring Raspbian as read-only can be found on debian site and rpi forum
Paul