Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Restoring dd Image

    I've backed up a LVM share via dd:
    dd if=/dev/mapper/VolGroup-lv_root | bzip2 >VolGroup-lv_root.dd.bz2
    Can I restore the image to a different directory, eg:
    bunzip2 VolGroup-lv_root.dd.bz2 | dd of=backup/
    so I can extract and restore certain files?

    Can I restore it into the root directory of the live running system that it was backed up from,eg:
    bunzip2 VolGroup-lv_root.dd.bz2 | dd of=/dev/mapper/VolGroup-lv_root


  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    1. To pipe input/output to/from bzip2/bunzip2, you need to use the -c option.
    2. Since you have copied the entire LVM device, you probably cannot just restore it somewhere else, other than perhaps a raw partition that has adequate space.
    3. If you uncompress the image, you may be able to mount it as a loop device and access individual files that way.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined! ford's Avatar
    Join Date
    Jan 2011
    GA, USA
    I made a decently comprehensive intro to dd here. It may help you with your backup stuff.

    What rubberman was talking about is a command like this:
    #dd if=/dev/sdX bs=64k conv=noerror,sync | gzip -c -9 > sdX.img.gz

    Restoring that would be something like:
    #gunzip -c sdX.img.gz | dd of=/dev/sdX conv=sync,noerror bs=64K

    You can specify any path, file, or storage device instead of sdX. If you specify a file you can then do something like:
    # mkdir loopedMount
    # mount -o loop sdX.backup loopedMount/
    This would allow you to peruse those files as if they were on a physical disc mounted to that directory.

  4. $spacer_open

Posting Permissions

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