Can I completely back up my AAO and restore when I break it?

Discussion in 'Linux' started by Flux101, Sep 2, 2008.

  1. Flux101

    Flux101

    Joined:
    Aug 11, 2008
    Messages:
    63
    Likes Received:
    0
    I have Linpus all exactly set up how I like it, but I keep playing, then breaking it, so I have to start from scratch reinstalling it again!

    Is there a way to back up its current state to another (external) drive so I can restore it later? I know this wouldn't be possible with Windows without something like True Image, but is it possible in Linux?

    And on another note, I've installed CheckGmail and set it to autostart with a script, but it ends up messing up because it starts before the wifi connects... is there a way to get it to start only when there's an internet connection, rather than on log in?
     
    Flux101, Sep 2, 2008
    #1
  2. Flux101

    lightpost

    Joined:
    Aug 13, 2008
    Messages:
    21
    Likes Received:
    0
    More than possible -- the system is so modular, you can literally run images of the same install from different drives (with only minor alterations to GRUB, /boot/grub/menu.lst, and /etc/fstabs).

    If you have an external drive that's already formatted in Ext3 (and has a folder you made called "backup"), you can open the terminal as Root and then test this out:

    Code:
    mkdir /media/nameofyourdisk/backup/boot
    cp -avx /boot /media/nameofyourdisk/backup/boot
    What it will do is copy all the contents of your system's boot folder (with all their attributes intact, as specified by the 'a' and 'x' options), and paste them in a similarly-named folder in your external drive. Because the drive is Ext3, all the file attributes will be preserved (as opposed to a FAT32 system, which wouldn't differentiate between root-owned and user-owned files). Oh, and the 'v' option is to ensure the copy jobs get displayed on screen, so you'll know how fast and how far along the copy job is going.

    Feel free to review your cloned boot folder now. If you're comfortable with it, delete that folder, and then get ready to do the actual cloning:

    Code:
    cp -avx / /media/nameofyourdisk/backup
    Now your entire root directory "/" is copied into the backup folder. This might take a while of course, but in the end you should have something that's perfectly-preserved enough to run properly. If you ever have to reinstall your system, you can simply clean out the drive from a LiveCD, and then repeat the copy process back again:

    Code:
    cp -avx media/nameofyourdisk/backup /media/nameoftheaspireonessd
    But don't take my word for it. Especially when it comes to your valuable data, your best bet is to research this topic slowly and carefully, so you can do this each time with absolute confidence:

    http://www.halfgaar.net/backing-up-unix
     
    lightpost, Sep 2, 2008
    #2
  3. Flux101

    edgecrush3r

    Joined:
    Aug 12, 2008
    Messages:
    53
    Likes Received:
    0
    i''ve created both partition images and gzip archives for my partitions.
    To create a partition image you can use the dd command.
    e.g. dd bs=1M if=/dev/sda1 of=sda1.img to create the image and: dd if=sda1.img of=/dev/sda1to recover the partition.

    if you want to image the sectors of the whole drive: dd bs=1M if=/dev/sda of=sda.img should do the trick.
    http://www.inference.phy.cam.ac.uk/saw2 ... tions.html

    PS: Its still better to have a gzipped tarball in some cases, since the dd command will backup the entire disk.
    PS2: if space is limited, always gzip your image file as this will decrease the filesize when the orginal disk is largely empty. DD copies all sectors including empy ones.

    Cheers,
    Tony
     
    edgecrush3r, Sep 2, 2008
    #3
  4. Flux101

    Flux101

    Joined:
    Aug 11, 2008
    Messages:
    63
    Likes Received:
    0
    Excellent, thanks for the help, I'll give it a go. :) Seems relatively straight forward, mostly a matter of copying the files while preserving attributes, much more sensible than messing about backing Windows up in a similar way!
     
    Flux101, Sep 3, 2008
    #4
  5. Flux101

    teemupii

    Joined:
    Aug 18, 2008
    Messages:
    9
    Likes Received:
    0
    teemupii, Sep 4, 2008
    #5
  6. Flux101

    IMSancho

    Joined:
    Aug 14, 2008
    Messages:
    95
    Likes Received:
    0
    Location:
    Australia
    Copy pasted from a reply I made to another user in a PM:

    I use SystemRescueCD off a USB stick, and then use partimage to back up to a network share. Check out http://www.sysresccd.org/Howto_install-usb-stick for how to make the boot USB, then boot off that with a network cable already plugged in. Once it's booted, run the network setup wizard on eth0 (the command for it is on the last screen after sysrescue boots) then create a mount point with 'mkdir /mnt/share' and mount your share to it with 'mount //<IP Address>/<share name> /mnt/share'. Next start partimage, tell it you want to backup /dev/sda1 and give it the path /mnt/share/<name of image file>. The rest of the options in partimage are pretty self explanatory, but there are docs on http://www.partimage.org/Main_Page or just drop me a line if you get stuck. To recover from an image just do the same thing but choose restore in the first partimage page and point it to the image file you created before.

    You can also use this method to backup/restore to another USB drive, just skip the networking step and mount your 2nd USB stick to the mount point you created.
     
    IMSancho, Sep 5, 2008
    #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.