Back up entire HD to USB stick

Discussion in 'Linux' started by eduardop, Jun 5, 2009.

  1. eduardop

    eduardop

    Joined:
    Jun 5, 2009
    Messages:
    9
    Likes Received:
    0
    Hello,

    I'm eagerly waiting for the arrival of my Aspire One next Monday.

    I intend to experiment a lot with it (dual boot XP and Ubuntu, etc), and therefore the first thing I'd like to do is back up the entire hard disk image of the original XP installation to a USB stick.

    I don't have a USB optical drive, and I don't want to use commercial applications, since I'm sure it can be done with free applications. I'm familiar with Linux and I wouldn't mind a Linux solution.

    I've read about Macles backup, and also Macrium Reflect free version.

    My question is: do they backup the entire hard disk (including the MBR and hidden recovery partition)?

    Which method is everyone using to backup their AAO hard disks?

    Thanks!
     
    eduardop, Jun 5, 2009
    #1
  2. eduardop

    lotus49

    Joined:
    Jun 29, 2008
    Messages:
    343
    Likes Received:
    0
    Location:
    Yorkshire
    The best approach rather depends on exactly what you want to achieve.

    If all you want to do is take a copy of your current installation so you can restore it after say installing Ubuntu, then the easiest option is to get a USB stick that is at least as big as the drive you want to backup and simply use dd to back up the entire drive like this:

    # dd if=/dev/sda of=/dev/sdb

    assuming the internal drive is sda and the USB stick sdb. This assumes you can boot into a Linux Live distro from another USB stick or a USB CD drive. This will copy the entire disk, MBR, partition tables and the partitions themselves. To restore simply boot into the live distro again and reverse the order of disks in the command thusly:

    # dd if=/dev/sdb of=/dev/sda

    That's all there is to it, but do be careful not to get the device names mixed up or there may be tears before bedtime.
     
    lotus49, Jun 5, 2009
    #2
  3. eduardop

    eduardop

    Joined:
    Jun 5, 2009
    Messages:
    9
    Likes Received:
    0
    Thanks! That's exactly the direction I want to go, a simple and reliable low-level approach that is unlikely to fail.

    My needs are just to have an image of the hard disk, in case I decide to buy another one in the future and want to resell/give away this one.

    My Aspire will be a 160Gb one, I would like my image to occupy less space. I suppose I can try the following command?

    dd if=/dev/sda | gzip > /dev/sdb/harddisk.image

    Also I read somewhere that this will get messed up if there are bad sectors on the hard disk, so I have to use:

    dd if=/dev/sda conv=noerror,sync | gzip > /dev/sdb/harddisk.image

    The restore command would be:

    gunzip /dev/sdb/harddisk.image | dd of=/dev/sda

    Any experience with that? Does the gzip trick really work?

    Maybe I should just try these things when I get my netbook. But I'm just too excited, I can't wait!
     
    eduardop, Jun 6, 2009
    #3
  4. eduardop

    RockDoctor

    Joined:
    Aug 21, 2008
    Messages:
    963
    Likes Received:
    0
    Location:
    Minnesota, USA
    The gzip trick should work. Note: if the unformatted (or unused but formatted) areas of your 160GB HDD contain garbage, that garbage will become part of your restore image too.
     
    RockDoctor, Jun 6, 2009
    #4
  5. eduardop

    eduardop

    Joined:
    Jun 5, 2009
    Messages:
    9
    Likes Received:
    0
    So I did my backup over the network to another Linux machine, using the program nc.

    The gzipped backup image ended up with 12 Gb, and the backup took about 2 1/2 hours. Both machines were on wired network connections (wireless was taking too long).

    I was able to unzip (gzip -d image.gz >/dev/null) as a test, and gzip reported no errors.

    I haven't needed to restore the backup so far!

    Cheers!
    Eduardo
     
    eduardop, Jun 12, 2009
    #5
  6. eduardop

    DutchDK

    Joined:
    Jun 2, 2009
    Messages:
    338
    Likes Received:
    0
    Location:
    Copenhagen
    A far faster solution would have been to use Partimage and Partimaged.
    The easy way to do this, is to use unetbootin to download and prep a USB stick with the SystemRescueCD linux distrobution.

    I can do a wired backup from my 8GB SSD AAO110 (FAT32 partition with XP, 2½ GB free space) to an old Dell C600 laptop with a transfer rate of around 350 MegaBit/s using wired ethernet. Using WiFi drops the transferrate to around 32 MegaBit/s.

    SystemRescueCD supports the builtin Eth and Wifi out of the box. It also supports NTFS partitions with ntfs-3g, so you can store the backups on a XP/Vista partition on the target PC without any problems. Furthermore SystemRescueCD has a slew of other tools that can come in handy in an emergency, has been around for a long time, and is quite stable. Finally it is free (as in speech, not beer) and only using Open Source software which should appeal to zealots and regular users alike.


    If there is interest in it, I'll write an illustrated how-to guide next week, when I'm doing my next backup.
     
    DutchDK, Jun 12, 2009
    #6
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.