-
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
GENUINE CISCO QSFP-40/100-SRBD 100G QSFP Transceiver
$129.99
Cisco WAP371 IEEE 802.11ac 1.27 Gbit/s Wireless Access Point
$80.00
Cisco MS120-48FP - 52 Ports Fully Managed Ethernet Switch UNCLAIMED
$449.00
GENUINE CISCO DS-SFP-FC32G-SW SFP NEW SEALED SEE PHOTOS SHIPS FREE
$74.99
Cisco WS-C3850-48P-L 48-Port Gigabit 3850 PoE Switch w/ 715W+ C3850-NM-4-1G Mod
$79.00
Genuine Cisco SFP-10G-SR V03 10GBASE-SR SFP+ Transceiver Module 10-2415-03
$8.00
Cisco Catalyst 3850 Series 48-Port UPoE Gigabit Switch w/ C3850-NM-2-10G (BHN)
$98.96
Cisco Nexus N3K-C3048TP-1GE 48 Port Switch w/ Dual Power - Same Day Shipping
$85.95
Cisco C9300-48U-A 48-Port Gig UPoE Network Advantage Switch -Same Day Shipping
$859.95
Cisco Nexus N3K-C3172PQ-XL 48P 10GbE SFP+ 4P QSFP+ Switch N3K-C3172PQ-XL-F
$229.00