-
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

Dell PowerEdge R730XD Server 2x E5-2620 V4=16 Cores | H330 | 32GB RAM | 2x trays
$258.99

Dell PowerEdge R630 Server 2x E5-2697v3 2.60Ghz 28-Core 128GB H730P Rails
$295.00

Dell Poweredge R620 2x E5-2670 2.6ghz 16-Cores | 32gb | H710 | 2x Trays | 750w
$129.99

Dell PowerEdge R620 (2x) E5-2650 2.0Ghz 32GB RAM 256GB HDD- NO OS
$52.00

Dell Poweredge R630 2x Xeon E5-2680 v3 2.5ghz 24-Cores 32gb 240GB SSD 495w
$164.99

Dell PowerEdge R730xd Server 2x E5-2620v4 2.10Ghz 16-Core 64GB H730
$380.30

Dell PowerEdge R730 Server 2x E5-2640v3 2.60Ghz 16-Core 16GB H730
$286.00

Dell PowerEdge R730XD Server 2x E5-2660 V4 = 28 Cores H730 128GB RAM 4x trays
$368.99

Dell R640 8x 2.5" SFF Server iDRAC - Wholesale Custom Build Your Server
$260.99

Dell R640 8x 2.5" SFF iDRAC 2x 25GbE SFP28- Wholesale Custom Build Your Server
$259.99