-
Senior Member
registered user
Script for remastering Debian 9.1.0 under Knoppix
For the record, here is the script used to remaster Debian Live 9.1.0. Basically, it performs the aufs union mount, copies the whole thing to a directory with rsync, and then compresses the result. Squashfs-tools are needed. The whole operation takes only a few minutes on a contemporary i7 machine with SSD disk.
Code:
#!/bin/bash
#
[ -d sqfs ] || mkdir sqfs ;
[ -d persfs ] || mkdir persfs
[ -d aufs ] || mkdir aufs
[ -d copyfs ] || mkdir copyfs
#
# Running under Knoppix 7.7.1 w/Debian 9.1 image on same partition as Knoppix, persistent store at /dev/sda9
[ -d /media/sda9/deb91_1p ] || mount /media/sda9
fsck.ext3 -y /media/sda9/deb91_1p/persistence
mount -o ro,loop /mnt-system/deb910/live/filesystem.squashfs sqfs
mount -o loop /media/sda9/deb91_1p/persistence persfs
mount -t aufs -o "br=persfs/rw=rw:sqfs=ro,noplink" none aufs
#
#
# Clean up, in case
rm -rf copyfs/*
# Copy union file system
rsync -axu aufs/* copyfs
# Clean up mounts
umount aufs
umount sqfs
umount persfs
#
# Compress file system to new live file
mksquashfs copyfs filesystem_rem_1.squashfs
Afterwards, the new live file is copied to a new directory, a new persistence file is created in a new directory, and a new grub entry is created with the new locations. This way, it is possible to go back to an earlier version on the fly if somethings goes very wrong. At irregular intervals, depending on how much is changed, the new persistence file is backed up.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules

HP i7-7700 Desktop Computer PC up to 32GB RAM, 4TB SSD, Windows 11 or 10, WiFi
$285.54

Dell i5-6500 Desktop Computer PC up to 16GB RAM, 4TB SSD, Windows 10 Pro, WiFi
$227.65

Dell Dual LCD Desktop Windows 10 PC SFF Intel Core 8GB RAM 500GB HD Dual 20" LCD
$144.36

HP EliteDesk 800 G4 SFF 16GB 256GB SSD Intel Core i7 8th Gen Windows 11 Pro WiFi
$335.00

HP EliteDesk 800 G2 (Intel Core i5-6500 3.2GHz 8GB) Mini PC Desktop WiFi
$74.99

RYZEN 7 8 CORE Gaming Desktop PC RTX 2060/2070/3060 SSD+HDD 16GB Win10 WiFi
$450.00

Lenovo P310 Desktop - Intel Core i7-6700 @ 3.40GHz 8GB RAM 1TB HDD - Windows 11
$150.00

NEW HP S01 SLIM DESKTOP PC 10TH GEN CORE i3-10105 3.70GHZ 8GB 256GB SSD WIN 11
$219.99

Dell i5 Desktop Computer PC up to 32GB RAM, 4TB SSD, 24" LCD, Windows 11 or 10
$274.94

Dell i5 Desktop Computer PC, up to 32GB RAM, 4TB SSD, Windows 11 or 10, WiFi
$292.50