-
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

16GB 2X8GB DDR3 PC3L-12800U Desktop Memory Ram DELL HP LENOVO ACER GATEWAY
$14.99

Team T-FORCE VULCAN Z 16GB (2 x 8GB) 288-Pin PC RAM DDR4 3200 (PC4 25600) Intel
$31.99

Corsair Vengeance 32GB 16GB 8GB DDR3 1866MHz 1600MHz CL10 Desktop Memory RAM LOT
$18.50

Patriot Viper Steel 64GB (2 x 32GB) 288-Pin PC RAM DDR4 3600 (PC4 28800) Desktop
$97.99

HyperX FURY RAM DDR4 16GB 8GB 32GB 3200 2666 2400 2133 Desktop Memory DIMM
$30.95

Apacer 8GB DDR4-2666 SOD Memory RAM
$8.00

A-Tech 8GB DDR3 1600 PC3-12800 Laptop SODIMM 204-Pin Memory RAM PC3L DDR3L 1x 8G
$11.99

Crucial DDR3 16GB 1600 2x 8GB PC3-12800 Laptop SODIMM Memory RAM PC3L 16G DDR3L
$19.35

A-Tech 8GB 2 x 4GB PC3-10600 Desktop DDR3 1333 MHz 240-Pin DIMM Memory RAM 8G 4G
$16.98

64GB (4X 16GB) DDR3-1333 PC3-10600 Memory RAM for APPLE MAC PRO 5,1 Westmere
$45.99