Problems using Puppy to backup Linpus

Discussion in 'Linux' started by infoteksec, Jun 18, 2009.

  1. infoteksec

    infoteksec

    Joined:
    Oct 29, 2008
    Messages:
    9
    Likes Received:
    0
    I've repartitioned my AAO 150 so I could have somewhere to backup my Linpus system. I figured I shouldn't backup the system I was running on so I'd figured I'd boot Puppy from a memory stick and copy form the Linpus partition to the new partition. It transpires Puppy can't mount the Linpus partition because though the Linpus partition is of type ext2, for some reason the puppy disk mounter reports it as ntfs.

    My Puppy is vers 4.1.

    Any clues as to how I can backup the linpus partition using Puppy would be appreciated.

    Regards, Peter
     
    infoteksec, Jun 18, 2009
    #1
  2. infoteksec

    fweigel

    Joined:
    Oct 24, 2008
    Messages:
    118
    Likes Received:
    0
    Peter.

    This is an advanced system backup/restore procedure. I have used it to clone Aspire One configurations, and to backup and restore several netbooks.

    Make sure you have "tar" loaded (sudo yum install tar).

    Pug in an external drive or partition. Make sure its formatted ext2 or ext3; you will need file storage bigger than 2GB for this.

    Unmount the external media after plugging it in, and then issue "sudo /sbin/mkfs -t ext3 /dev/sdb1" or whatever the device is -- if its the only plugged in device, /dev/sdb1 is most likely correct. Use "dmesg" to be sure). To make the backup volume have a sensible name, try "sudo /sbin/e2label /dev/sdb1 Backup". This will change the name that shows up when the device is plugged in to "Backup", rather that "disk"). Click on the volume (or re-plug it) to activate.

    "cd" to the external storage, and then issue the following command:

    sudo tar cvf backup.tar /home /misc /opt /root /selinux /bin /etc /initrd /usr /boot /lib /sbin /var

    This will back up your linpus aao system (but not your external media).

    To use the backup, restore the system by booting and installing from the Acer recovery, put in the external drive, "cd /" and then "sudo tar xvf /media/whatever/backup.tar" (changing "whatever" to what is needed).

    MAKE SURE TO REBOOT IMMEDIATELY AFTER THE RESTORE.
     
    fweigel, Jun 21, 2009
    #2
  3. infoteksec

    RockDoctor

    Joined:
    Aug 21, 2008
    Messages:
    963
    Likes Received:
    0
    Location:
    Minnesota, USA
    I think we need to back up a step or two. You've got an A150. How many partitions does your HDD have, and what operating systems are on it? You should be able to get this info from a terminal window in either Linpus or Puppy. In Linpus the command is
    Code:
    sudo fdisk /dev/sda
    ; in Puppy, it's just
    Code:
    fdisk /dev/sda
     
    RockDoctor, Jun 23, 2009
    #3
  4. infoteksec

    fweigel

    Joined:
    Oct 24, 2008
    Messages:
    118
    Likes Received:
    0
    Rockdoctor

    The problem is backing up AAO Linpus. The procedure I gave (using tar) works, and is independent (as far as the source is concerned) of physical partition, as long as it is done from the booted Linpus. The command line I gave will back up an entire AAO Linpus system (except where custom directories have been created in "strange" places, which would indicate that the user knew what she was doing).

    The target is more important -- the backup file will be larger than 2GB, so the filesystem used must accommodate that.

    I have also tested restore from such a backup. And it works. Note that when the restore is done, ALL files will be replaced. This can be very bad for continued operation of the device, which is why the most important thing is an early shutdown. Of course this problem is eliminated if the restore is done from (say) Puppy Linux instead. But it doesn't matter -- it works straight from Linpus.

    In other words, Puppy Linux (or some other boot system) isn't needed at all. After the restore, I like to reboot, and then force a "fsck" disk check on a second reboot. Holding the power switch for 4 (maybe slightly more) seconds does it, and then powering on. The next reboot will take up to 20 minutes (if using the 160GB hard disk model), but we have forced a complete consistency check. Note that this is only needed on a complete restore.

    Since the backup data is in a simple "tar" file, the tar utility can be used to recover by file if only some files need recovery (say, accidental erasure).

    This scheme ALSO works if you need to restore to a brand new AAO. If restoring to a new model, get "professional" help, but it can be done. Basically, your files will be in /home/user and below, and that would need restoring (note that the OS and applications will need installation, and you will have to figure out how to migrate application settings -- typically from one version to another).

    Again, Puppy Linux is NOT needed to accomplish this. It COULD be used, but is actually more of a pain. For such a backup, I wouldn't even recommend separate backup software, other than "tar". It works; and this scheme works. This methodology has been "proven" by 40 years of Unix use, and has been tested (and works) on the Linpus AAO system as well.
     
    fweigel, Jun 24, 2009
    #4
  5. infoteksec

    DutchDK

    Joined:
    Jun 2, 2009
    Messages:
    338
    Likes Received:
    0
    Location:
    Copenhagen
    The easiest way to backup the AAO, is to make a bootable USBkey with SystemRescueCD, and then use the partimage program on that, to backup the partitions in question, either to another partition on the internal harddisk, or to another USB harddisk. You can even backup to another PC via wireless or wired network, if you boot the other PC up with the USB key first.

    Advantages:
    You get the complete partition(s) backed up, including MBR and bootloader.
    The backup can be compressed with either gzip or bzip, so free space doesn't take up any space in the backup.
    You can restore just the MBR, just the bootloader, or the complete partition.
    You can even be online and posting on the aspireoneuser.com forums, while doing the backups/restores.
    You can do a PXE lan boot on the AAO from another PC if it is booted up on the SystemRescueCD CD or USB key.
    You can even backup or restore over the internet, if you so desire.
    You got a bootable USB key with lots of good utilities, including freedos if you need to update the bios and the ability to reset the XP/NT/Vista password.

    IMHO SystemRescueCD is just like American Express : Don't leave (or stay at) home without it.
    Link : http://www.sysresccd.org/Main_Page
     
    DutchDK, Jun 24, 2009
    #5
  6. infoteksec

    fweigel

    Joined:
    Oct 24, 2008
    Messages:
    118
    Likes Received:
    0
    DutchDK

    Why on earth would you WANT to back up the "MBR" or any of that other crap? And HOW do you restore to a different size disk?

    Look at the "tar" approach. One command line - and yes, it can back to anything able to hold the backup (USB, disk, tape, network). Backs up everything that needs restoring.

    The initial installer takes care of the the "MBR", partitioning, whatnot. All that is pretty much a given, and will be regenerated before a restore anyway!

    The "tar" can restore to a different size drive (as long as it has the capacity). If you just want user files, only tar up /home/user. I usually split the command into two: one tar for /home/user, and the other tar for the rest. The first generates "backup_data.tar", and the second "backup_system.tar". I only do a system backup if I have changed my software (added a package).

    Put these lines in a script, and be done with it! Why would you want to go through the hassles of "yet another program"?
     
    fweigel, Jun 24, 2009
    #6
  7. infoteksec

    DutchDK

    Joined:
    Jun 2, 2009
    Messages:
    338
    Likes Received:
    0
    Location:
    Copenhagen
    Because with your procedure, I'd need to reinstall Linpus from the recoveryCD first, if I want to change back to Linpus from forinstance XP or any other OS. By using partimage, I am able to change between OS's just by restoring the complette partition to the SSD (or to the USB key).

    I.E. I have the AAO 110L. I dump the Linpus partition to my external USB harddisk (or another PC over the net, or a samba share on a server). I install XP on the SSD. I dump the XP partition to my external USB harddisk. I install Ubuntu UNR on the SSD. I dump the UNR partitition to my external USB harddisk. Backup speed from Partimage to the USB disk is around 250 MiB/s to the USB hardisk, about 150-180 Mib/s if I do it to another PC over the network (partimaged running on the other PC), and about 120 Mib/s to a samba share (wired ethernet 100 mbit), when using the default gzip compression. I can even do it over WiFi, with a backupspeed of around 40 MiB/s if I am sitting out in the garden. I do not need to worry if I remembered to include any special directories since everything on the partition will be backed up.


    If I want to switch between the different OS's I do not need to prep the SDD first by reinstalling from the Recovery CD (in case of Linpus). All I need to do is wipe the partition with gparted (included with systemrescuecd), and let gparted reformat it with the actual Filesystem used by the OS image, i.e. ext2 for Linpus, after having had XP on the SSD.
    The partimage restore operation also goes damn fast, and as soon as it is finished, I just reboot, and Linpus/XP/Ubuntu is up and running. Look at partimage as a freeware equivalent to Norton Ghost/Acronis Trueimage, etc.

    It is also far easier for joe average user to use programs such as partimage, than remembering the tar command switches and all the directories necessary to backup, if j.a.u wants to have a complete backup of his system. This way he might even be persuaded to backup regularly (as in daily), since I do hope we agree that a 2 month old backup ain't really worth the space it occupies, if you use the AAO daily for productive tasks.

    The added utilities in the SystemRescueCD distro, are just a bonus and might never be used by non-powerusers. I for one though must admit that my trusty old 512 MB verbatim USB key probably never are going to hold anything else than SystemRescueCD. Watching the customers face when I boot that, then connect through a VPN over 3G to my server and pull down the BackTrack infosec distro image to the AAO, while eating lunch, and then audit their network afterwards with the "little white toy computer" is just priceless ;)
     
    DutchDK, Jun 24, 2009
    #7
  8. infoteksec

    fweigel

    Joined:
    Oct 24, 2008
    Messages:
    118
    Likes Received:
    0
    In that case, I would recommend:

    sudo sh -c "dd if=/dev/sda1 | gzip >backup.dd.gz"

    where backup.dd.gz is either on an external drive or separate partition (or piped to a network socket)

    But, you're right -- just use another program.
     
    fweigel, Jun 25, 2009
    #8
  9. infoteksec

    DutchDK

    Joined:
    Jun 2, 2009
    Messages:
    338
    Likes Received:
    0
    Location:
    Copenhagen
    Good old dd - swiss army knife of file io. Alas, dd has one fault with regards to backing up a complete partition - it has no knowledge of whether a particular location is marked as free in the file system or not. That means that old junk (i.e. data from erased documents and programs ) will be backed up as well.
    So unless you do a "dd if=/dev/zero of=foobar;rm -f foobar" first, the resulting datastream a) won't compress as much with gzip, and b) won't only contain valid data.
    Another reason to use partimage instead, since partimage does know about filesystems, and to check whether a location has been marked as free in the filesystem.

    Using dd you make a bit-for-bit copy of the partition, while with partimage you do a "representation" of the partition, and storing the "valid" data only in the imagefile = Faster backup, lower requirements for storage of the backup, and no junk when restoring, since partimage can zero out unused sectors during the restore.

    Both methods have their uses, the dd method is great when doing harddrive forensics and data recovery from a drive, but I'd still prefer partimage for backup and archival purposes.
     
    DutchDK, Jun 25, 2009
    #9
  10. infoteksec

    RockDoctor

    Joined:
    Aug 21, 2008
    Messages:
    963
    Likes Received:
    0
    Location:
    Minnesota, USA
    One problem with partimage - the partition to which you restore needs to be at last as large as the partition from which you back up, even if the filesystem only occupies half of the space in that partition. .Using gparted to shrink the partition before backing it up works well, but is a bit of an annoyance.
     
    RockDoctor, Jun 26, 2009
    #10
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.