-
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
Samsung Galaxy Tab A8 10.5" SM-X200 64GB Wifi Only Tablet Open Box
$139.99
BRAND NEW Samsung Smart Book Cover Galaxy Tab S9 | S9 5G
$57.99
[ BULK LOT OF 10 ] SSD 500GB Samsung, Micron, Crucial, WD, SK Hynix.
$239.99
New Samsung 2.5" 870 EVO 500GB SATA III SSD MZ-77E500 Solid State Drive
$54.99
Samsung - S Pen Creator Edition - White
$38.00
Samsung Galaxy Tab S9 Ultra 512GB Wi-Fi 14.6" Keyboard Excellent
$700.00
128GB SAMSUNG (4 X 32GB) 2Rx4 PC4-2400T DDR4 ECC REGISTERED SERVER RAM
$129.95
Original Samsung Book Cover for Samsung Galaxy Tab S8 Ultra / S8 Ultra 5G-Black
$49.99
OEM Samsung Galaxy Tab S9 Ultra 14.6" Book Cover Keyboard, Black, EF-DX915UBEGUJ
$199.99
Samsung Galaxy Chromebook 2 13.3" FHD Touch i3-10110U 8GB 128GB ~ RED ~ NIB
$299.99