-
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

IBM X3550 M4 1U Server 2x E5-2670 2.6GHz 16-Cores 128gb 2x 300gb M5110 2x 550w
$149.99

IBM X3650 M4 Server 2X Xeon E5-2630, 2.30Ghz, 6 Cores, 32GB DDR3, NO HDD/FREESHP
$147.95

IBM System X3550 7978 2xIntel Xeon 5160 3GHz Server w/20GB/2xPS/DVDROM/2xPS 670W
$71.95

IBM X3650 M5 5462-AC1,2 X E5-2640V3 2.6GHZ 8C, 16 GB, DUAL 750W, 2 X 1TB SERVER
$249.99

IBM 8284-22A POWER8 S822 Server Dual 3.89GHz 6 Core CPU 512GB RAM w/ PowerVM
$699.00

Vintage IBM Netfinity 3000 Server (Pentium II / 128MB / ca. 1998)
$79.99

IBM 8284-22A S822 Dual Power8 Cpu 512Gb (16x 32Gb) RAM
$995.00

IBM Server RS/6000 7043 Model 140 (7043-140) ANO 7043-140 3590 A50
$262.95

TrueNas Server 2x E5-2666 v3 2.9ghz 64gb 71605 2x 900w
$299.99

IBM Server System X3100 M4 | Xeon @ 3.10 Ghz | 8GB | 250GB HDD No OS (IG-PC26)
$189.95