Backup System Using An External USB Hard Drive

Discussion in 'Linux' started by rbil, Oct 4, 2008.

  1. rbil

    rbil

    Joined:
    Aug 14, 2008
    Messages:
    730
    Likes Received:
    0
    Location:
    The Wet Coast, Canada
    This is a take-off of using a usb-stick to backup your current system. Rather than trying to continue to use that topic to give additional instructions on doing this with a USB External Hard Drive, I've condensed all instructions in a blog article. You can read it here ...

    http://customdesignlinuxblog.blogspot.com/

    There are links there to download the needed files. If you have any questions, please ask in this thread.

    Those who are already using what I outlined in: http://aspireoneuser.com/forum/viewtopic.php?f=29&t=317 but have gotten things working on a hard drive as opposed to just a flash key, you can simply download the new Backup Script I've written and place it in the first partition of the ext. hard drive, overwriting the old backup script. This new one now accommodates a second type of backup, using partimage and backing up/restoring just the ext2 partition from the SSD drive.

    The backup script has changed in a number of ways:

    * it now includes the ability to backup/restore just the ext2 partition of the SSD drive in addition to a complete SSD drive backup
    * it automatically mounts the backup drive
    * it automatically creates the 2 needed directories on the backup drive: backup and ssd1

    Cheers.

    Update: October 6: New Features of this System:

    A new backup script that allows in addition to what is outlined above, the ability to backup and restore a SD Card in the LEFT slot of the AAO. All this is outlined in the blog. Also the backup routine for the SSD drive has been changed so that backup files are sliced into files 2GB in size. This will prevent the possibility of the backup files getting larger than 4GB in size and hence not writable to a FAT32 partition, which is where the backups are stored. This will accommodate the newer AAO's that come with 16GB SSD drives.

    Anyone who has set up a system as outlined above and then downloads and installs the new backup script mentioned here, should be aware that it changes the way it backs up the SSD drive. Old backups will not restore with the new script. You should do a full backup of the SSD drive (option 1) if you install this new backup script.

    Cheers.
     
    rbil, Oct 4, 2008
    #1
  2. rbil

    Guest Guest

    Hello rbil-
    I am looking at the various options for recovery/backup. I am also really inexperienced with Linux and the AAO.
    What are the pros and cons to using an external hard drive?
    tia-
    stephen
     
    Guest, Oct 5, 2008
    #2
  3. rbil

    rbil

    Joined:
    Aug 14, 2008
    Messages:
    730
    Likes Received:
    0
    Location:
    The Wet Coast, Canada
    As opposed to what other ways?

    Cheers.
     
    rbil, Oct 5, 2008
    #3
  4. rbil

    Guest Guest

    as compared to a USB flash drive.
     
    Guest, Oct 5, 2008
    #4
  5. rbil

    rbil

    Joined:
    Aug 14, 2008
    Messages:
    730
    Likes Received:
    0
    Location:
    The Wet Coast, Canada
    With the system I'm talking about here, you can do the same thing with an 8GB or larger flash drive. It'll work just the same. Anything smaller than that, and there won't be room to be able to do both a full SSD drive backup AND also backup the ext2 directory from the SSD. So that is essentially the advantage of having a USB hard drive, as space won't typically be an issue.

    As to comparing flash drives and hard drives, besides the obvious of size, the flash drive is more durable in terms of how you can handle it, while the flash drive has more limited writes before it wears out. The latter, is probably not a worry, as you certainly won't be doing backups that frequently.

    That's all that I can think of when comparing the two. Again, with the method and instructions I'm giving here, they remain exactly the same whether you're using an external USB hard drive or an 8GB+ flash drive.

    Cheers.
     
    rbil, Oct 5, 2008
    #5
  6. rbil

    Guest Guest

    What can I read to help me understand the ext2 directory from the SSD, and terms like /dev/sda and /dev/sdb?
     
    Guest, Oct 5, 2008
    #6
  7. rbil

    rbil

    Joined:
    Aug 14, 2008
    Messages:
    730
    Likes Received:
    0
    Location:
    The Wet Coast, Canada
    Oct 5, 2008 Revisions:

    Added new instructions in the blog regarding:

    1) Correction on how to get the backup script on to the hard drive, and

    2) How to add an autorun script so that the backup script is automatically loaded when you boot into Linux on the external hard drive. Now this system is a no-brainer when it comes to doing backups and restores.

    Cheers.
     
    rbil, Oct 5, 2008
    #7
  8. rbil

    donec

    Joined:
    Sep 11, 2008
    Messages:
    952
    Likes Received:
    0
    Have you restored from your backup replacing the current setup? If so how did it go? I know of many different ways of making backups but I have not found one that actually restores everything completely.
     
    donec, Oct 5, 2008
    #8
  9. rbil

    rbil

    Joined:
    Aug 14, 2008
    Messages:
    730
    Likes Received:
    0
    Location:
    The Wet Coast, Canada
    Yes, I've restored and it restored without problems. If you make a backup of the whole SSD drive (option 1 in the script), you'll get everything back. If you just restore a backup of the ext2 partition, then you'll of course just get the ext2 partition back, which for most cases is all one needs to do, unless the SSD has real problems where the MBR or the swap partition have somehow been corrupted. That's why I suggest doing a complete backup and then using the ext2 backup just for quicker backups.

    Cheers.
     
    rbil, Oct 5, 2008
    #9
  10. rbil

    donec

    Joined:
    Sep 11, 2008
    Messages:
    952
    Likes Received:
    0
    Have you tried it with OneLinux the customized Ubuntu?
     
    donec, Oct 5, 2008
    #10
  11. rbil

    donec

    Joined:
    Sep 11, 2008
    Messages:
    952
    Likes Received:
    0
    I was trying to use your backup process, but ran into a problem that I can't find an answer to and it is when reaching step 5: Placing the Backup Script on your external hard drive: from your blog I can not copy the Backup Script to the external drive because the file size is now 197.2Mb and there is only 104.40Mb available on the first partition. I tried to increase the size of the first partition with Gparted and got several errors.
     
    donec, Oct 5, 2008
    #11
  12. rbil

    rbil

    Joined:
    Aug 14, 2008
    Messages:
    730
    Likes Received:
    0
    Location:
    The Wet Coast, Canada
    The backup script is something like 4K. You must be trying to copy some other file. Certainly not the backup script.

    Cheers.
     
    rbil, Oct 6, 2008
    #12
  13. rbil

    donec

    Joined:
    Sep 11, 2008
    Messages:
    952
    Likes Received:
    0
    If you need an intelligent person don't call me I was trying to copy the image not the script. :oops:
    Thanks
     
    donec, Oct 6, 2008
    #13
  14. rbil

    donec

    Joined:
    Sep 11, 2008
    Messages:
    952
    Likes Received:
    0
    OK! I got it to run, but I'm not sure what all it backed up. My system is setup with Onelinux (customized Ubuntu) using the SSD as my root and swap and a 16Gb SDHC as my home partition. Both are formated as ext2. I suspect only the root and maybe the swap were backed up but not the home partition. Am I correct? If so is there a way to make an image of the home partition? So I could restore the backup from your script and then restore the home from the other image?

    BTW thanks for your effort and work.
     
    donec, Oct 6, 2008
    #14
  15. rbil

    rbil

    Joined:
    Aug 14, 2008
    Messages:
    730
    Likes Received:
    0
    Location:
    The Wet Coast, Canada
    donec,

    If you selected 1 in the backup script then ALL of your SSD drive was backed up. If you selected 3 in the script then only the first partition (ext2 partition) of your SSD drive was backed up. Since I don't know which backup you did, I can't tell you what you backed up. :) All of this is explained at the bottom of that page on the blog. If you look at the backup partition on your external drive and see a file in the directory ssd1 called part1.gz.000, you've selected the 3 option. If you see in the directory Backup a file called hdimage.gz then you did the 1 option.

    This backup system is designed to accommodate easy backing up an AspireOne using Linpus where the SSD drive contains only 2 partitions - ext2 and swap partition and is 8GB in size. In your case, you've got something quite different. You have Ubuntu installed and have chosen to keep its /home directory on another drive.

    It would be trivial to rewrite the script to accommodate also backing up your SDHC drive to another image file on the backup hard drive. But since I don't have such a setup, I can't give you specifics. I don't know how the backup system will recognize the device assignment for your SDHC drive. If you got to a command prompt and ran: fdisk -l it would tell you what it sees, making adding changes to the backup script file easy. Take a look at the backup script with a text editor and you should be able to figure out what it is doing.

    If it was me, and I had that information, I'd do it something like this ... I'd have the 1) Backup create an image of the SSD drive AND then an image of the SDHC drive. Then I'd have the 2) Restore process restore each of the backup images to the respective drives. That way, you'd be assured of having a complete backup of both drives, easily restorable. BUT, if you can't figure that out, I'd suggest that you don't try it, as you can really wreck your system. :)

    Another problem I forsee with what you have there, is that your SDHC drive is 16GB. The system, compresses the total backup using the gzip and dd commands. With a 8GB SSD drive, it's expected that the compressed file will not exceed 4GB, although even here there is that possibility. With a 16GB drive, that file could exceed 4GB and then a problem would develop, because files on FAT32 drives can't exceed 4GB. To accommodate this eventuality, you'd probably want the 2nd partition on your external hard drive to be ext2 or ext3 rather than FAT32, which is what you have now, if it was created by the image file I provide.

    All of this stuff is doable in terms of getting a backup system that would work with what you have there. Just want to point out some of the things you'd need to consider.

    Cheers.
     
    rbil, Oct 6, 2008
    #15
  16. rbil

    donec

    Joined:
    Sep 11, 2008
    Messages:
    952
    Likes Received:
    0
    Thanks Rbil, for your responce and the great script. I am not sure if I am willing to try and edit the script since I could mess things up too easily but I may if I find a way to be sure I have a good backup. I had suspected that my SDHC was not backed up and I think there is a way to save my home partition but just not sure which would be best. Do you know if I restore the backup of my SSD will it effect the SDHC disk? Could I do a restore with the SDHC disk removed? As it stands now I can remove the SDHC disk and I loose my settings but if I power down and insert my SDHC disk before booting then everything comes back and works.
     
    donec, Oct 6, 2008
    #16
  17. rbil

    rbil

    Joined:
    Aug 14, 2008
    Messages:
    730
    Likes Received:
    0
    Location:
    The Wet Coast, Canada
    Is this SDHC disk in the LEFT sd port on your Aspire?

    If it is, then sysrescuecd will see that as: /dev/mmcblk0p1

    I'm now rewriting the backup script to add more functionality. This is a long process, because I test everything here and have to sit through backing up and restoring to make sure it all works as it should. When I'm confident it'll work, I'm going to post the new script. If you like, I can write one just for your situation that will deal with your SDHC drive as well. BUT, it must be in the LEFT side SD slot - because I'm going to write YOUR script to accommodate that.

    I'll let you know when it's available.

    I won't test it ... I'll leave that up to you. But I'll do my best to get it right for you.

    Cheers.
     
    rbil, Oct 6, 2008
    #17
  18. rbil

    rbil

    Joined:
    Aug 14, 2008
    Messages:
    730
    Likes Received:
    0
    Location:
    The Wet Coast, Canada
    Announcement ...

    A new backup script is now available at ...

    http://customdesignlinuxblog.blogspot.com/

    (@donec - this will allow you to backup your Ubuntu /home directory, provided it is on a SD card in the LEFT slot of your AAO. Let me know how it goes. Works here. :))

    for everyone else, it'll allow you to backup the SD card that Linpus uses to expand your SSD storage.

    Cheers.
     
    rbil, Oct 6, 2008
    #18
  19. rbil

    donec

    Joined:
    Sep 11, 2008
    Messages:
    952
    Likes Received:
    0
    Rbil, you are unbelievable and extremely fantastic. You say it will take time to do what you did but it seems you did it all in about 2 hours. All I did in that time is go to the store and answer a couple forum post. I haven't tried it yet but I am fixing to and whether it works or not you effort is much appreciated. BTW my SDHC card is on the left side where the power cord connects.
     
    donec, Oct 6, 2008
    #19
  20. rbil

    rbil

    Joined:
    Aug 14, 2008
    Messages:
    730
    Likes Received:
    0
    Location:
    The Wet Coast, Canada
    Then it should work fine for you. Let me know how it goes.

    Truth be known, it took me about 4 hours to get this latest script tweaked and working as I wanted. Takes time to backup/restore/tweak and repeat. :) Wanted to again test each function, so I know that here the full bakup, the SSD ext2 backup and finally the SD backup worked in terms of both backing up and restoring. The new script now splits the dd image (that's the complete SSD backup) into files no larger than 2GB. This way we're assured that if someone does use a FAT32 drive for backing up, the backup files will never exceed the FAT32 limitation of 4GB for a file size.

    Cheers.
     
    rbil, Oct 6, 2008
    #20
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.