Page 2 of 5 FirstFirst 1234 ... LastLast
Results 11 to 20 of 50

Thread: HOWTO: Create, Recover and Automate System Images

  1. #11
    Join Date
    Jun 2005
    Location
    Albuquerque, New Mexico
    Beans
    272
    Distro
    Ubuntu Development Release

    Re: HOWTO: Create, Recover and Automate System Images

    There should be no problem running the backup dd and gzip on a mounted filesystem.

    -GC
    "Nice jail. Looks strong."
    - H. Houdini

  2. #12
    Join Date
    Jun 2005
    Location
    Albuquerque, New Mexico
    Beans
    272
    Distro
    Ubuntu Development Release

    Re: HOWTO: Create, Recover and Automate System Images

    Updated post with image clean up information.

    -GC
    "Nice jail. Looks strong."
    - H. Houdini

  3. #13
    Join Date
    Jul 2008
    Location
    Morehead City, NC
    Beans
    61
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: HOWTO: Create, Recover and Automate System Images

    So, if you are using this method to backup a 100 GB sda drive and later want to restore to a 200 GB drive, you would:

    sfdisk /dev/sda < partition_structure_sda.dump

    restore image

    Then resize the partition up to 200 GB using gparted?

  4. #14
    Join Date
    Jun 2005
    Location
    Albuquerque, New Mexico
    Beans
    272
    Distro
    Ubuntu Development Release

    Re: HOWTO: Create, Recover and Automate System Images

    Hi mdsharp24,

    If you image your 100gb drive using the /dev/sda and you want to restore the image to a larger drive you do *not* need to restore the partition table with...


    Code:
    sfdisk /dev/sda < partition_structure_sda.dump
    Creating an image using anyone of the methods I've listed will capture bit for bit backup of everything on the original drive including the drives partition table and structure. So all you would need to do is restore your backup to the larger drive, using one of the methods I've described, and use gparted to resize your partitions.


    That said, if you can... I would install your new drive as a secondary drive in your PC and run a direct dd from your 100gb drive to the 200gb drive.

    Assuming that your old 100gb is /dev/sda and your new 200gb is /dev/sdb you could clone your 100gb to the 200gb directly using...


    Code:
    sudo dd bs=15M if=/dev/sda of=/dev/sdb
    If you already have the gparted install on your 100gb you can run it and resize the partitions on /dev/sdb. Then power down your system swap the cables and test booting off your new drive.

    Hope this helps,

    -GC
    Last edited by GrammatonCleric; August 1st, 2008 at 12:56 PM.
    "Nice jail. Looks strong."
    - H. Houdini

  5. #15
    Join Date
    Jul 2008
    Location
    Morehead City, NC
    Beans
    61
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: HOWTO: Create, Recover and Automate System Images

    Very cool! So running dd if=/dev/zero of=/tmp/disk_zero_fill.tmp bs=8M; rm -f /tmp/disk_zero_fill.tmp on the live filesystem will actually wipe free space?

  6. #16
    Join Date
    Jun 2005
    Location
    Albuquerque, New Mexico
    Beans
    272
    Distro
    Ubuntu Development Release

    Re: HOWTO: Create, Recover and Automate System Images

    mdsharp24,

    I would not say "wipe" rather over write. Picture a balloon being blown up inside a glass, filling all the empty space until none exists then the balloon pops ( i.e. rm -f /tmp/disk_zero_fill.tmp). So the...

    Code:
    dd if=/dev/zero of=/tmp/disk_zero_fill.tmp bs=8M; rm -f /tmp/disk_zero_fill.tmp
    ...over writes any files that have have been flagged as deleted.

    If you want to securely clear empty space on your drive take a look at "scrub."

    http://ubuntuforums.org/showthread.php?t=333309

    - GC
    "Nice jail. Looks strong."
    - H. Houdini

  7. #17
    Join Date
    Apr 2008
    Beans
    57

    Re: HOWTO: Create, Recover and Automate System Images

    Thanks for this fabulous howto. I just used dd for the first time right before I found this thread. (It's actually still going as I type this), and I do wish I had noted the ability to compress the image on the fly as you show in your examples.

    If you don't mind explaining a bit just for my curiosity, regarding your USB example (just because it's the one most applicable to what I'm doing)

    Code:
    sudo dd bs=15M if=/dev/sda conv=sync,noerror | gzip -9 > /media/path/to/usbdrive/ubuntu_linux.img.gz
    I assume I can look up conv=sync,noerror but I'm curious why use of gzip (apparently) removes the need for an of= paramerter (even though I can see that of course you have specified the actual output path).

    Just curious...

    Thanks!

  8. #18
    Join Date
    Jun 2005
    Location
    Albuquerque, New Mexico
    Beans
    272
    Distro
    Ubuntu Development Release

    Re: HOWTO: Create, Recover and Automate System Images

    Hi converted,

    Sorry for the delay in replying, busy week but then aren't they all? =)

    In the simplest terms there is no need to use the "of=" option because in using the "if=" in conjunction with pipe (i.e. "|") and gzip dd is sending data directly to gzip to compress as it receives it.

    Hope this helps.

    -GC
    Last edited by GrammatonCleric; August 30th, 2008 at 02:44 PM.
    "Nice jail. Looks strong."
    - H. Houdini

  9. #19
    Join Date
    Apr 2008
    Beans
    57

    Re: HOWTO: Create, Recover and Automate System Images

    Heh -- I do know how that is, and didn't get back to check this until today.

    Wow, a more helpful response than you could know. I knew that was a pipe symbol, but had no idea (until further googling based on your response) that this literally instructs one process to "pipe" data over to another, nor that using it in this fashion is what an "unnamed pipe" is.

    Years of tinkering (though only recently with Linux) and you've filled in yet another hole (I'd heard the term, but didn't even have the vaguest notion of what it meant) that none of my classes nor prior experiences had forced me to learn.

    And I also now understand why so many commands I've used from howtos and such have contained that symbol. I had no idea what the significance was.

    Thanks!!

  10. #20
    Join Date
    Jun 2008
    Beans
    3
    Distro
    Ubuntu 7.04 Feisty Fawn

    Re: HOWTO: Create, Recover and Automate System Images

    I would like to make a system image on my external USB HDD.
    So I attempted to follow your USB example instructions.
    I had a problem, when I entered in Terminal:

    Code:
    sudo dd bs=15M if=/dev/sda conv=sync,noerror | gzip -9 > /media/path/to/usbdrive/ubuntu_linux.img.gz

    The output was:
    bash: /media/path/to/usbdrive/ubuntu_linux.img.gz: No such file or directory

    The results of 'df -h' are:
    Filesystem Size Used Avail Use% Mounted on
    /dev/sda1 71G 4.0G 63G 6% /
    varrun 1006M 100K 1006M 1% /var/run
    varlock 1006M 0 1006M 0% /var/lock
    procbususb 1006M 136K 1006M 1% /proc/bus/usb
    udev 1006M 136K 1006M 1% /dev
    devshm 1006M 16K 1006M 1% /dev/shm
    lrm 1006M 33M 973M 4% /lib/modules/2.6.20-17-generic/volatile
    /dev/sdb1 299G 255G 45G 86% /media/Storage
    /dev/sde1 150G 112G 38G 75% /media/NEXT 160

    Am I supposed to alter the line of code,
    so that '/usbdrive/' = '/dev/sde/' ?
    (The System drive is sda1 and the external usb drive is sde1)
    I'm Using 7.04 (Feisty) at the moment. Is that a problem?

Page 2 of 5 FirstFirst 1234 ... LastLast

Bookmarks

Posting Permissions

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