-
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
ASUS Q170M-C Motherboard LGA1151 with IO Shield
$39.95
ASRock B450M/AC WIFI AMD AM4 Micro ATX Motherboard
$65.95
GIGABYTE B550 UD AC ATX Motherboard AMD Socket AM4 DDR4 HDMI WIFI USB 3.2 SATA
$74.99
ASUS H110I-PLUS LGA1151 Desktop Motherboard Intel H110 Mini-ITX W/IO
$39.90
ASUS - PRIME B450M-A II (Socket AM4) AMD B450 microATX DDR4 Motherboard - Black
$69.99
Gigabyte GA-B150M-D3H GSM LGA 1151 DDR4 Desktop Motherboard mATX
$39.99
Gigabyte B560 DS3H AC Intel B560 LGA 1200 ATX Desktop Motherboard A
$79.99
Gigabyte M-ATX motherboard with Intel Core i3 8100 CPU and 8GB DDR4 RAM
$79.00
ASUS B85M-E LGA1150 Socket B85 8GB DDR3 Desktop Motherboard w I/O Shield
$41.99
SUPERMICRO X9DRI-LN4F+ Dual Socket XEON LGA2011 EE-ATX Server Motherboard 1.20A
$79.99