-
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
HPE BL460c G9 ProLiant Blade | 2x Xeon E5-2620V3 | NO RAM | P244BR | 2xHDD Tray
$179.00
HPE BL460c G9 ProLiant Blade | 2x Xeon E5-2630V3 | 32GB | P244BR | 2x300GB 15K
$299.00
DELL PEM640 POWEREDGE M640 BLADE SERVER
$539.95
HP ProLiant BL460c G9 (Gen9) 2x E5-2670V3 12 Core 3.1GHz No Ram or No Drives
$59.98
Dell PowerEdge M620 0F9HJC Blade Server 2*E5-2670 2.60GHz 192GB RAM 2*300GB SAS
$103.99
DELL M630 BLADE SERVER x2 XEON E5-2660V3 @ 2.6GH H730 PERC HDD CADDIES 16GB FC
$50.00
Dell PowerEdge M640 Blade Server
$539.95
HP ProLiant BL460c Server Blade (2 x CPU) 24GB RAM/No Drives
$45.60
Dell M630 PowerEdge Blade Server
$700.00
DELL PowerEdge M630 Blade 2x E5-2683v3 2.0GHz =28 Cores 256GB H330 2x10Gb X520
$450.00