-
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

HPE ProLiant MicroServer Gen10 Plus v2 Ultra Micro Tower Server P54644001
$649.00

HPE ProLiant MicroServer Gen10 Plus v2 (P54644-001)- New
$999.99

HP ProLiant MicroServer Gen8 Celeron G1610T 2.3GHZ 8GB RAM 4 x 1TB HDD
$279.00

HP ProLiant HSTNS-5151 Micro server AMD Athlon II Neo N36L 6GB RAM 1.5TB HDD KEY
$179.10

HP HPE Microserver Gen 7 8 9 iLO 2/3/4/5Advanced License Lifetime Key| FAST SHIP
$10.00

DATTO-1000 Mini PC Micro Server 8GB RAM
$91.47

HP ProLiant Gen8 G2020T SATA 1TB WS12 Ess Svr / S-Buy Micro Server 742326-S01
$199.95

HP ProLiant Microserver Gen8 E3-1260L 16GB P222 RAID iLo Adv DVD TPM
$399.00

HP 775590-S01 Proliant Microserver Gen8 1*Xeon E3-1220L V2 2.3Ghz 16GB SEE NOTES
$275.00

Super Micro 512-3 Intel Xeon E3-1271 3.60 Ghz Quad Core Server 16Gb Ddr3 WORKING
$392.95