Find the answer to your Linux question:
Results 1 to 9 of 9
I'm running Ubuntu 9.10. I'd really like to make an image of my entire system in the event of a mishap. I've found from experience that anything can happen with ...
  1. #1
    Just Joined!
    Join Date
    May 2005
    Posts
    20

    How do you make a copy of your system?

    I'm running Ubuntu 9.10. I'd really like to make an image of my entire system in the event of a mishap. I've found from experience that anything can happen with Linux and then you're into another reinstall. Anyone know of a good program or process? Thanks.

  2. #2
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,099
    I personally use a linux version of acronis true image on a live disk, but you can use clonezilla, partimage, or the dd command if you want free options. Other backup/recovery apps can be found here.
    oz

    new members/users: read this first | new member faq
    no private messages requesting computer support - post them on the forums!
    please use the "report post" button to alert our forum admins to problematic posts rather than responding to them yourself.

  3. #3
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,975
    I've been doing this for years, and it has saved my bacon on many occasions.
    1. Boot live cd/dvd/usb drive
    2. Don't mount system drive.
    3. Attach external drive (esata or usb) with adequate space to store a compressed copy of the system drive.
    4. Format external drive with ext2 file system (don't use ext3 - you don't need the journalling).
    5. Create a mount point for the external drive.
    6. Mount the external drive file system.
    7. Either use cat or the dd command to copy the system drive, piping the output to gzip to compress it, and direct the output from that to a file on the external drive.
    Here are a couple of examples of how to do #7 above. These examples assume that the system drive is /dev/sda and the mount point for your external backup drive is /mnt/usbdrive. Note that once you have formatted your external drive, you won't need to do that in the future, skipping step #4 above.

    Using the cat command:
    Code:
    # cat /dev/sda | gzip -c >/mnt/usbdrive/system-image.gz
    Using the dd command:
    Code:
    # dd if=/dev/sda | gzip -c >/mnt/usbdrive/system-image.gz
    Some of the dd command options, such as ibs=<read-size>, might speed up the process, but you can experiment with that.

    To restore the system drive you basically do the opposize:
    1. Boot live cd/dvd/usb drive.
    2. Create mount point.
    3. Mount external drive.
    4. Uncompress and copy backup image to disc.
    Here's how - note that the X in /dev/sdX1 below is the drive letter for the backup drive and /dev/sda is the system hard drive you are trying to restore:
    Code:
    # mkdir /mnt /mnt/usbdrive
    # mount /dev/sdX1 /mnt/usbdrive
    # gunzip -c /mnt/usbdrive/system-image.gz | cat >/dev/sda
    This will restore everything, including the boot record, partition table, and all partitions on the drive. I've used this technique when my system drive was starting to fail, when viruses totally munged my system, and when I did a major OOPSIE, such as being root at the file system root / and executing the command "rm -rf *" - doh! I try to keep a weekly backup image with this technique, just in case. The complete backup of my 320GB system drive takes about an hour, so I usually start it on a weekend around dinner time. By the time the dishes are put away, it is finished.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  4. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,975
    BTW, the technique I described will also work with Windows system discs.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  5. #5
    Just Joined!
    Join Date
    May 2005
    Posts
    20
    Rubberman, are you using Partimage for this backup procedure?

  6. #6
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,975
    Quote Originally Posted by jacatone View Post
    Rubberman, are you using Partimage for this backup procedure?
    No. This is a very low-level raw backup/restore procedure. As I said, it is a true bit-image backup of the disc. All parts are backed up, including boot loader, partition table, and raw partition data. This is also necessary for forensic analysis of a disc. It is the only way to guarantee that you have every bit from the original drive without modification.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  7. #7
    Just Joined!
    Join Date
    May 2005
    Posts
    20
    When I insert my flashdrive, it auto-mounts and appears in /media/"flashdrive". Would I still need to mkdir flashdrive? Thanks so much for your help.

  8. #8
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,975
    Quote Originally Posted by jacatone View Post
    When I insert my flashdrive, it auto-mounts and appears in /media/"flashdrive". Would I still need to mkdir flashdrive? Thanks so much for your help.
    No. If automount works, then you can use /media/flashdrive, or whatever temporary directory automount created for the device.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  9. #9
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,975
    Note that one of the reasons to use an ext2 file system, instead of the FAT file system used by smaller flash drives, or the FAT-32 file system used by bigger ones, is the file size limitations you might run into.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...