-
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
FINISAR FTLX1471D3BTL TM SM 10KM SFP 1310NM CPRI 9.8G TRANSCEIVER
$20.90
Cisco C3KX-NM-10G 4-Port SFP 10G Expansion Module 3750-X / 3560-X Switch
$50.00
Nokia 4807528 SFP 3G 300m 850nm Transceiver Module
$17.99
CISCO N9K-X9788TC-FX Nexus 9500 48p 1/10GBaseT and 4p 100G line card-Lifetime WR
$5999.00
Genuine Cisco SFP-10G-SR V03 10GBASE-SR SFP+ Transceiver Module 10-2415-03
$8.00
For Cisco SFP-10G-T, Ubiquiti UF-RJ45-10G Module 10G SFP+ to RJ45 10GBase-T
$48.59
FS SFP-10G-T, 10GBASE-T SFP+ Copper RJ-45 30m Transceiver Module
$50.00
GENUINE Cisco SFP-GE-T EXT 30-1421-01 USA 1000BASE-T RJ45 SFP Transceiver
$9.99
NEW Sealed Cisco SFP-10G-SR-S 10G SR SFP+ Module 850nmMM *US Shipping*
$15.00
LOT OF 20 Genuine Cisco SFP-10G-SR V03 10GBASE-SR SFP+ Transceiver Module
$89.00