Saturday, October 01, 2022

Build a Turnkey "Deep Freeze"-Style Ubuntu System with Auto-Wiping Flash Storage

In a previous post, we discussed how to manually set up a Linux system that restores itself on every reboot, just like Faronics Deep Freeze.

Today, let's take it one step further: we'll customize an Ubuntu ISO so that:

  • It boots directly into a self-healing system,

  • It automatically sets up writable storage on a flash drive,

  • It wipes that flash drive every time you reboot.

No user intervention needed. Fully turnkey.


Prerequisites

Before we begin, you'll need:

  • ✅ A Linux system to prepare everything (Ubuntu preferred)

  • ✅ The Ubuntu 22.04 LTS ISO

  • ✅ A blank DVD or a bootable USB stick for burning

  • ✅ A second USB flash drive (at least 8GB) for temporary write space

  • ✅ Basic familiarity with the Linux terminal


Step 1: Set Up a Working Folder

First, install a few helper tools:

sudo apt update
sudo apt install squashfs-tools xorriso isolinux syslinux-utils

Now, set up a working folder:

mkdir ~/ubuntu-custom
cd ~/ubuntu-custom

Step 2: Extract the Ubuntu ISO

Download your Ubuntu ISO and extract it:

wget https://releases.ubuntu.com/22.04/ubuntu-22.04.4-desktop-amd64.iso

# Mount and copy contents
mkdir mnt
sudo mount -o loop ubuntu-22.04.4-desktop-amd64.iso mnt
rsync -a mnt/ extract-cd/
sudo umount mnt

You now have a modifiable copy of the ISO contents in extract-cd/.


Step 3: Add Our Auto-Wipe and Overlay Scripts

Inside extract-cd/, we'll embed a tiny custom startup script.

Create the directory if it doesn't exist:

mkdir -p extract-cd/casper/scripts

Now create the script:

nano extract-cd/casper/scripts/wipe-usb-overlay

Paste this:

#!/bin/bash
#
# Set up an OverlayFS using a flash drive, wiping it every boot

DEVICE=$(blkid | grep "TYPE=\"ext4\"" | grep -v "cdrom" | awk '{print $1}' | tr -d ':')  # crude but works
MOUNTPOINT=/media/usb

mkdir -p $MOUNTPOINT
mount $DEVICE $MOUNTPOINT

# Reformat USB flash drive
mkfs.ext4 -F $DEVICE

# Re-mount it fresh
mount $DEVICE $MOUNTPOINT

# Create upper and work directories for overlay
mkdir -p $MOUNTPOINT/upper
mkdir -p $MOUNTPOINT/work

# Mount overlay
mkdir -p /cow
mount -t overlay overlay -o lowerdir=/,upperdir=$MOUNTPOINT/upper,workdir=$MOUNTPOINT/work /cow

# Switch root to overlay
mount --bind /cow /

Save and close.

Make it executable:

chmod +x extract-cd/casper/scripts/wipe-usb-overlay

Step 4: Hook It Into Boot

Now, modify the boot sequence so Ubuntu will run this script automatically.

Edit extract-cd/casper/initrd by decompressing and editing:

cd extract-cd/casper
mkdir initrd
cd initrd
gzip -dc ../initrd | cpio -id

Now edit init (the master boot script):

nano init

Find a good spot after the root filesystem is mounted (you can search for mountroot) and insert:

# Custom wipe USB overlay setup
/scripts/wipe-usb-overlay

Then rebuild initrd:

find . | cpio --create --format='newc' | gzip > ../initrd
cd ..
rm -rf initrd

Step 5: Rebuild the ISO

Back in your main ubuntu-custom/ directory:

cd ~/ubuntu-custom
sudo mkisofs -D -r -V "UBUNTU_FREEZE" -cache-inodes -J -l \
  -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot \
  -boot-load-size 4 -boot-info-table -o ubuntu-deepfreeze.iso extract-cd

This creates ubuntu-deepfreeze.iso — your brand-new Deep Freeze-style Ubuntu image!


Step 6: Burn and Boot

  • Burn ubuntu-deepfreeze.iso to a DVD, or

  • Flash it to a USB stick using Rufus, dd, or balenaEtcher.

When you boot:

✅ Ubuntu will load fresh
✅ It will wipe and set up the USB flash drive automatically
✅ All system changes will disappear on reboot
✅ No user input is needed


Final Notes

Area Notes
Flash Drive Wear Consider using durable, higher-end flash drives
Security Add a UUID check if you want to verify the correct flash drive
Performance Booting from USB stick (read-only) is much faster than DVD

Conclusion

Now you have a true turnkey Deep Freeze system for Ubuntu —
no more worries about malware, user errors, broken settings, or clogged hard drives.

This setup is perfect for schools, labs, libraries, pop-up installations, and experiments.

All built with 100% free and open-source tools.
Linux is magic.

Monday, May 30, 2022

 Friends,


Yesterday, May 29th, 2022, the Libertarian Party changed.  I knew it was coming. I have always accepted that people of good conscience can differ in their understanding of the world. And while I do ascribe much more sinister motives to the forces behind the change, I see the honest and sincere belief in many of the foot soldiers of the new party that they are doing a good thing. 


The last hour of the convention however was one of the most revelatory moments in my life. To lay the background for people who weren't there, there were 20 plus proposals to change the Libertarian Party platform, and they were left for the last hour of the convention.

For those new to the machinations of Libertarians, let me lay some background:

We revere the platform.  Every word, comma and punctuation mark has been vigorously debated. The group crafting of the platform is one of the most unifying experiences for libertarians because we are forced to work together because of the 2/3rd majority of the entire body required to change the platform.  Prior today, optimistically, most experienced convention attendees would argue that any significant change would take about an hour.

The end result had been one of the most perfect political documents I had ever had the pleasure to read.


A new political party has arisen within our political party and as always happens, an organized political party in a democratic process will defeat individuals, because that's how we count votes. The new party calls itself a caucus, for those who aren’t into the intimate elements of the party.


Electing the chair and party officers, the caucus had specific candidates, as you would expect a party to do. They elected their chair candidate on the first ballot with ~70% of the vote. The same was true for all the other officer candidates save Vice-Chair, where the caucus had 2 candidates.

And I think that’s ok, even though none of the candidates I supported got elected. If you’re organized enough that you can get a 2/3rds majority in the electoral process, you should get what you want – with one small exception:

Jefferson wrote:”Rightful liberty is unobstructed action according to our will, within the limits drawn around us by the equal rights of others. I do not add ‘within the limits of the law’; because law is often but the tyrant’s will.”


If you have ever wondered how bad democracy can get, you’ve understood the problem of a tyranny of the majority. And to be fair to the caucus, they weren’t voting to suppress anyone’s rights.  But they were voting as a bloc to get what they wanted.

They used their political might to remove our perfectly crafted abortion plank which read: “Recognizing that abortion is a sensitive issue and that people can hold good-faith views on all sides, we believe that government should be kept out of the matter, leaving the question to each person for their conscientious consideration.”

They also removed the sentence: “We condemn bigotry as irrational and repugnant.” and replaced it with a (imho) mealymouthed affirmation that people should not be judged by their identity.

I was unhappy to see those changes happen, and we fought to delay procedures as much as we could – but in the end a 2/3rd parliamentary majority can do what they want in an organizational meeting. And I was at peace with that part of the process.

But then we got to the end of the day.  There were ~20 changes to the platform, but only an hour left.  To make sure they got everything leadership wanted done, they proposed that each platform change be read aloud and then passed or blocked with an up or down vote.

No debate allowed. No time allowed for the body to actually consider the changes.  Just a vote after the leader read the new change.  And we had no AV so there was no way to see the changes that were proposed. I will contend that it was impossible to truly consider the changes

And I got to witness the foot soldiers blindly stand up and vote for each platform after it was read out.  There were signs and group leaders in the body instructing the soldiers of the caucus, and they all obeyed.

Stand up.
Sit down.
Stand up.
Sit down.

I couldn’t take it any more.  I left the floor before the end.

And that was the thing that made me realize the change I need to implement is more than political – it has to be cultural too. If a group of Libertarians could blindly follow orders when voting, then my vision of a world where people are dedicated to respecting each other’s liberty. And that only happens through education. To that end I am proud of the work I am doing with Home For Liberty, where I am the Executive Director. We're a 501(c)3 dedicated to the idea that people who are well educated about Liberty won't blindly stand up and sit down when authority bids them. We're in our soft launch week right now. -- If you want to sign up for a Premium membership, use the discount code IAMHOME for a free 6 months. The site is light on content right now, and on members, so come on in and make sure that your voice is part of the solution.