degibson
Golden Member
Here's the setup:
system disk is SSD HD 16 GB
will be Ubuntu 64 server for files
2 GB memory
RAID 5 array on some barracudas
I want this to be an on-demand file server -- it will wake-on-LAN, serve its request(s), wait a bit, then power off.
The trick is, I want it to hibernate instead. And more importantly, I don't want it to write its memory state to the flash drive -- I want it to hibernate without storing its memory state, so when it wakes, it wakes up from an earlier, read-only version of its memory image.
Here's what I know:
1) Linux hibernation uses swap to store the memory contents. I'll need a 2GB+ swap partition.
2) I'll need to spin down and unmount the RAID before hibernation. Otherwise, waking up with the wrong memory could corrupt the file system.
3) /tmp, etc all goes on a ramdisk.
4) /etc is a small writable partition on the SDD that is very seldom written
5) / will be mounted read-only
Here's what I don't know:
1) How do I set a swap partition to read-only? I'd like to basically:
* Hibernate the machine.
* Netboot the machine, set the swap partition as RO.
* Un-hibernate the machine.
The idea is that once the MBR and swap partition are fixed, every time the machine powers on it will un-hibernate from the same previous state.
The meta-goal of course is to minimize boot time and maximize SSD life cycle. It may turn out that simply booting the machine is fast enough... I may know if I ever get my bloody boot server up 🙂
system disk is SSD HD 16 GB
will be Ubuntu 64 server for files
2 GB memory
RAID 5 array on some barracudas
I want this to be an on-demand file server -- it will wake-on-LAN, serve its request(s), wait a bit, then power off.
The trick is, I want it to hibernate instead. And more importantly, I don't want it to write its memory state to the flash drive -- I want it to hibernate without storing its memory state, so when it wakes, it wakes up from an earlier, read-only version of its memory image.
Here's what I know:
1) Linux hibernation uses swap to store the memory contents. I'll need a 2GB+ swap partition.
2) I'll need to spin down and unmount the RAID before hibernation. Otherwise, waking up with the wrong memory could corrupt the file system.
3) /tmp, etc all goes on a ramdisk.
4) /etc is a small writable partition on the SDD that is very seldom written
5) / will be mounted read-only
Here's what I don't know:
1) How do I set a swap partition to read-only? I'd like to basically:
* Hibernate the machine.
* Netboot the machine, set the swap partition as RO.
* Un-hibernate the machine.
The idea is that once the MBR and swap partition are fixed, every time the machine powers on it will un-hibernate from the same previous state.
The meta-goal of course is to minimize boot time and maximize SSD life cycle. It may turn out that simply booting the machine is fast enough... I may know if I ever get my bloody boot server up 🙂