[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[SLUG] Look mum, no hands (writing).
Well I have been trying to make a read-only system that in theory can't
get a file system corruption.
I have a box that runs one application only. It is headless so if someone
turns it off and on (likely, its in a factory mounted on a pilon) I want
to be as sure as possible that it will restart without human intervention.
Here is what I did.
Built my machine in the normal way, I used RedHat 6.1. My application
starts from a line at the end of /etc/rc.d/rc.local
Once it is all working fine its time to make it never swap the file system
into read write (rw) mode during the boot process.
On the RedHat system in /etc/inittab it invokes /etc/rc.d/rc.sysinit to
perform the boot process. So I commented out the following line in this
file
# action "Remounting root filesystem in read-write mode"
mount -n -o remount,rw /
This stopped it remouting the file system rw. I then needed to have a /tmp
& /var directory that was rw so I used some ram disks. I used one ram disk
for each and created some directories in /var
/sbin/mke2fs /dev/ram0
/sbin/mke2fs /dev/ram1
mount /dev/ram0 /tmp
mount /dev/ram1 /var
mkdir /var/run
mkdir /var/log
mkdir /var/lock
mkdir /var/lock/subsys
mkdir /var/lock/console
With those changes it basically worked, however mingetty was having
troubles spawing the virtual consoles. I think it has something to do with
/var/run/utmp. I just removed all the virtual consoles from inittab and
just started getty on tty1. It spawns okay.
It now boots quite cleanly, after a about a minute the hard disk powers
down due to APM. You can turn it off and on without any real worry about
it getting a corrupted file system or having to do a fschk on boot,
To make changes to the machine I just connect in over the network (X
sessions) and do a "mount -n -w -o remount /" and I have a writable file
system, after changes are made just change it back to read only.
If anyone has any tips on how to do it better etc please post em.
Rodos
--
rodos@nospam.haywood.org | I find this a nice feature but it is not according to
Camion Technology | the documentation. Or is it a BUG? Let's call it an
+61 2 9873 5105 | accidental feature. :-) [Larry Wall]
--
SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
To unsubscribe send email to slug-request@nospam.slug.org.au with
unsubscribe in the text