-
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

Inspur LSI YZCA-00424-101 Raid Card 12Gbps HBA HDD Controller
$16.99

9207-8i PCIE3.0 6Gbps HBA LSI FW:P20 IT Mode ZFS FreeNAS unRAID 2* SFF-8087 US
$36.88

9211-8i 6Gbps HBA LSI FW:P20 IT Mode ZFS FreeNAS unRAID+2* SFF-8087 SATA From US
$32.99

Dell Perc H330 12GB SAS Raid Controller Card
$39.99

Adaptec ASR-71605 16 Ports 2274400-R Raid Card AFM-700 1GB Cache with Battery
$19.99

Dell P2R3R PERC HBA330 Mini Mono 12Gb/s Non-RAID Pass-Thru HBA
$15.00

ORICO Multi Bay RAID Hard Drive Enclosure USB 3.0/ Type-C For 2.5/3.5'' HDD SSD
$84.69

Intel RES2SV240 24port 6G 6Gbps SATA SAS Expander Server Adapter RAID CARD
$28.88

Dell 44GNF PERC H730 PCIe 3.0 x8 1GB Cache RAID Controller w/ Batt 27-3
$34.99

ACASIS 3.5 Dual Bay SATA To USB 3.0 HDD Enclosure Array Desktop Mobile RAID NEW
$58.99