-
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

LOT OF 20 Mixed Major Brands 4GB PC3-10600U DDR3 1333MHz Desktop RAM Tested
$56.99

CRUCIAL DDR3 1600MHz 2x 8GB 16GB PC3-12800 Desktop Memory RAM 240pin DIMM 16G 8G
$25.80

【DDR4 RAM】1PK Gigastone Desktop RAM 32GB (2x16GB) DDR4 32GB DDR4-3200MHz
$44.98

Kingston FURY Beast 16GB (2 x 8GB) 288-Pin PC RAM DDR4 3200 (PC4 25600) Desktop
$34.99

HyperX FURY DDR4 4GB 8GB 16GB 32GB 3200 2400 2666 Desktop RAM Memory DIMM 288pin
$23.80

HyperX FURY DDR3 16GB 2x 8GB 1600 MHz PC3-12800 Desktop RAM Memory DIMM 240pins
$26.80

Kingston FURY Beast RGB 32GB (2 x 16GB) 288-Pin PC RAM DDR4 3200 (PC4 25600) Des
$69.99

Crucial 8GB Sodimm Laptop 1600MHz DDR3L PC3-12800 Memory RAM DDR3 1x 8G GB
$13.80

Crucial 32GB DDR4 SDRAM Memory (CT32G4SFD832A)
$50.00

Corsair Vengeance DDR3 8GB 1600 MHz PC3-12800 Desktop RAM Memory DIMM 240pins
$50.00