For one of my labs, I need to maintain consistent file systems. So, I do not want any changes written to the file system after the system is shutdown. Currently, I am maintaining an operating system image and copying it manually after the lab session is over.
I am trying to figure out if there is any open source implementation of Deep Freeze software for Fedora based systems. I am trying to maintain a consistent file system so that any changes made will be lost when the system reboots.
From this link, I see there are similar software to Deep freeze, however, they are available for Debian based systems. I also came across LVM partitions which I did not understand much.
Suggest me some software that can be used in Fedora based systems or some other better solution.
Best Answer
You could set up aufs on the root partition and have the original image read only and all changes are stored in RAM. That way the students can make any changes they like (even as root), after a reboot a clean well defined system state is restored.
I did exactly this setup using Debian but the same should be possible without too much modification on Fedora as well. Since the clients were running diskless, I used PXE boot. Here are the basic steps, the instructions are mainly taken from Diskless Debian Linux booting via dhcp/pxe/nfs/tftp/aufs and Installing Debian using network booting.
The PXE boot server has the IP address 192.168.1.10 and it also serves as TFTP and NFS server. It uses aufs and the root filesystem is mounted read-only. Due to the aufs the clients have write access. All changes reside in memory and are wiped on reboot.
Install necessary packages
Configure DHCP server to serve a PXE boot image
This configures DHCP to use the TFTP server on address
192.168.1.10
and load the PXE boot imagepxelinux.0
.Configure TFTP server
Configure NFS server.
The root file system is mounted read only via NFS.
Populate NFS directory with a Debian installation
Install kernel and initramfs tools:
Configure its initramfs to generate NFS-booting initrds:
Load the
aufs
module:Configure
aufs
:Make the file executable:
Generate initrd:
Watch out if the kernel of the host and the chroot do not match. Replace
$(uname -r)
with the correct kernel if necessary.Copy generated initrd, kernel image, and PXE bootloader to TFTP root and create folder for PXE config:
The file
pxelinux.0
is the PXELINUX bootstrap program.Configure boot loader:
Change root password
Restart services