Results 1 to 9 of 9

Thread: Unofficial cheatcodes to backup and restore persistent data

Threaded View

  1. #1
    Senior Member
    Join Date
    Jan 2011
    Posts
    242

    Unofficial cheatcodes to backup and restore persistent data

    Attached are patches to /init that implement cheatcodes to backup and restore the Knoppix persistent store image inspired by ideas from utu.

    Persistent store on a USB stick or a picture card is great but these are easily lost or the file system damaged so frequent backups are a good idea. Easy, just drag and drop onto your hard drive next time you aren't running Knoppix. If that is just about never, then backup costs two reboots. The drag and drop method also requires a chunk of hard drive space the size of the persistent store, which is not always available. As utu showed, it should be possible to backup and restore persistent store using Knoppix provided you get in early enough in the boot sequence. You could boot with the debug cheatcode and do it all by hand. Instead here are a couple of cheat codes to do the job safely.

    Use:
    Code:
    knoppix backup_data=/aDevice/someDirectory/theFilename
    knoppix restore_data=/aDevice/someDirectory/theFilename
    The most usual uses might be:

    Code:
    knoppix backup_data=/dev/sda1
    knoppix restore_data=/mnt-system
    The first example might be backup to hard drive, the second to the USB stick / picture card. The first is to be preferred. You can choose where to put the backup. If you don't specify the full /aDevice/someDirectory/theFilename, the cheat code will try to fill in the missing parts from the template /mnt-system/$knoppix_dir/knoppix-data.tgz.

    The backup is reasonably straight forward though rather slow. How slow depends on how much data is in your persistent store rather than how big the store is. The result is a compressed tar file that will be a lot smaller than the persistent store itself.

    The restore has a surprise. It will first delete your current persistent store on the grounds that you probably need to restore because your persistent store is corrupt and cannot be used. This means the first you know about it is the 'you don't have a persistent store yet' screen pops up and if this takes you by surprise you won't type in the size quick enough and you'll have to press ctrl-alt-del to reboot and try again.

    Both backup and restore seem to take a unreasonably long time when compared with similar operations done from Knoppix proper. Perhaps the BusyBox version of tar and zip are unable to exploit the multi-core capabilities of modern processors.

    If you use the two cheat codes at the same time, the backup happens first. You can use this to resize your persistent store or to convert your persistent store to/from encrypted, password protected, format.

    The backup file always has the extension .tgz (aka .tar.zip) and can be unpacked with tar -xzf.
    The backup is not encrypted and is not password protected. The extension .zip is forseen for that but the implementation is left as an exercise for the reader.

    There are two attachments to this post. They are text file patches for the /init script in the sense of the (Linux) User Command patch(1). To apply them, you would have to first unpack /mnt-system/boot/syslinux/minirt.gz. See the Wiki page on remastering.

    There are two parts to the patch. The second, backup_data.txt, actually implements the new cheat codes but requires a pair of more general purpose functions implemented in the first patch, mountbypath.txt. These patches, by design, not to overlap with the (original) patch for the knoppix_data cheat code.

    Have fun.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Kingston HyperX FURY DDR3 8GB 16GB 32G 1600 1866 1333 Desktop Memory RAM DIMM picture

Kingston HyperX FURY DDR3 8GB 16GB 32G 1600 1866 1333 Desktop Memory RAM DIMM

$39.95



A-Tech 8GB DDR3 1600 PC3-12800 Laptop SODIMM 204-Pin Memory RAM PC3L DDR3L 1x 8G picture

A-Tech 8GB DDR3 1600 PC3-12800 Laptop SODIMM 204-Pin Memory RAM PC3L DDR3L 1x 8G

$13.99



Team T-FORCE VULCAN Z 16GB (2 x 8GB) 288-Pin PC RAM DDR4 3200 (PC4 25600) Intel picture

Team T-FORCE VULCAN Z 16GB (2 x 8GB) 288-Pin PC RAM DDR4 3200 (PC4 25600) Intel

$33.99



Team T-FORCE VULCAN Z 32GB (2 x 16GB) PC RAM DDR4 3200 (PC4 25600) Memory picture

Team T-FORCE VULCAN Z 32GB (2 x 16GB) PC RAM DDR4 3200 (PC4 25600) Memory

$54.99



Samsung 16GB (4x4GB) 1Rx8 PC3-12800U 1600Mhz DDR3 RAM Memory M378B5273DH0-CK0 picture

Samsung 16GB (4x4GB) 1Rx8 PC3-12800U 1600Mhz DDR3 RAM Memory M378B5273DH0-CK0

$14.00



HyperX FURY RAM DDR4 16GB 8GB 32GB 4GB 3200 2666 2400 2133 Desktop Memory DIMM picture

HyperX FURY RAM DDR4 16GB 8GB 32GB 4GB 3200 2666 2400 2133 Desktop Memory DIMM

$9.64



HP 15.6

HP 15.6" FHD Notebook AMD Ryzen 5 5500U 16GB RAM 512GB SSD Natural Silver

$339.99



Crucial DDR3L 16GB 1600 2x 8GB PC3-12800 Laptop SODIMM Memory RAM PC3 16G DDR3 picture

Crucial DDR3L 16GB 1600 2x 8GB PC3-12800 Laptop SODIMM Memory RAM PC3 16G DDR3

$22.45



256GB Kit (8 x 32GB) PC4-17000 LRDIMM DELL POWEREDGE R730xd R730 R630 Memory RAM picture

256GB Kit (8 x 32GB) PC4-17000 LRDIMM DELL POWEREDGE R730xd R730 R630 Memory RAM

$279.92



Lot of 50 DDR3 8GB PC3-12800U Desktop 1600MHz Memory RAM Mixed Major Brands picture

Lot of 50 DDR3 8GB PC3-12800U Desktop 1600MHz Memory RAM Mixed Major Brands

$324.99