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
  •  


ORICO Multi Bay RAID Hard Drive Enclosure USB 3.0/ Type-C For 2.5/3.5'' HDD SSDs picture

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

$179.99



Dell PERC H330 PCIe 3.0 x8 RAID Storage Controller 4Y5H1 High Profile picture

Dell PERC H330 PCIe 3.0 x8 RAID Storage Controller 4Y5H1 High Profile

$13.99



Dell 7H4CN PERC H730P Raid Controller Mini Mono12GBPS 2GB NV Cache picture

Dell 7H4CN PERC H730P Raid Controller Mini Mono12GBPS 2GB NV Cache

$44.99



Western Digital My Book Velociraptor Duo Thunderbolt Enclosure (NEW) - No drives picture

Western Digital My Book Velociraptor Duo Thunderbolt Enclosure (NEW) - No drives

$60.00



Inspur LSI 9300-8i Raid Card 12Gbps HBA HDD Controller High Profile IT MODE picture

Inspur LSI 9300-8i Raid Card 12Gbps HBA HDD Controller High Profile IT MODE

$15.98



LSI MegaRAID 9361-8i 12Gbps PCIe 3 x8 SATA SAS 3 8 Port RAID + BBU & CacheVault picture

LSI MegaRAID 9361-8i 12Gbps PCIe 3 x8 SATA SAS 3 8 Port RAID + BBU & CacheVault

$39.00



Inspur LSI YZCA-00424-101 Raid Card 12Gbps HBA Controller Low Profile 9300-8i IT picture

Inspur LSI YZCA-00424-101 Raid Card 12Gbps HBA Controller Low Profile 9300-8i IT

$15.98



ACASIS 2.5/3.5 inch 2 Bay SATA USB 3.0 Hard Drive Disk HDD SSD Enclosure 4 RAID picture

ACASIS 2.5/3.5 inch 2 Bay SATA USB 3.0 Hard Drive Disk HDD SSD Enclosure 4 RAID

$58.99



OWC Guardian Maximus Raid Enclosure SATA Hard Drive FireWire picture

OWC Guardian Maximus Raid Enclosure SATA Hard Drive FireWire

$36.99



G-RAID 4TB (2 x 2TB 7200RPM) External Raid Drive (USB/eSATA/FW800) picture

G-RAID 4TB (2 x 2TB 7200RPM) External Raid Drive (USB/eSATA/FW800)

$85.00