I want my servers to come up cleanly on each boot rather than having state which persists across boots. Short of PXE-booting, is there any way to do this? In particular, I’m curious if live-CDs do something similar (writes don’t persist—perhaps they use an in-memory filesystem)?
"I’m curious if live-CDs do something similar"
Yes that's exactly what they do. The live session is loaded into RAM and changes do not persist after a reboot.
You can accomplish what you are asking with a liveCD, but you can also use a USB flash drive with installation media. Just choose the "Try Ubuntu" option.
Here's something I have used in the past: The
overlayroot
package in the Ubuntu repositories.In other words,
The booted system (/) is read-only, like a LiveUSB's "Try Ubuntu" environment. Changes can be made, but those changes are on the overlayfs, and do not persist across a reboot.
For editable data, store the data on a different partition. A different partition can be mounted read/write, so those changes do persist across reboots.
When time comes to tweak or update the system, a GRUB command will mount the system read-write. You set up your system exactly way you want it to boot every time, then just turn overlayroot back on and reboot.