Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Help to restore a dd image file back to the hard drive

  1. #1
    Junior Member
    Join Date
    Oct 2005
    Posts
    2

    Help to restore a dd image file back to the hard drive

    I've read the faqs and can find info on creating images but not of restoring them back to the hard drive.

    I have created a dd image file of the complete hard drive /dev/hda on a removeable hard drive
    using
    dd if=/dev/hda of=/mnt/sdb1/image.dd

    Now I am trying to restore the image back to the hard drive as an upgrade went wrong.
    However
    dd if=/mnt/sdb1/image.dd of=/dev/hda is not working.

    I think I have to make hda writeable but I don't know the exact syntax of the command I need.
    On the left of the desktop I can find icons for hda1, hda3 and hda7 which are currently on my machine but are currently unmounted.
    What exactly do I do here?

    Hope someone can help.

    Regards
    Brian C

  2. #2
    Senior Member registered user
    Join Date
    Nov 2002
    Location
    USA, IL
    Posts
    1,041

    Re: Help to restore a dd image file back to the hard drive

    Are you getting an error message? Describe "not working."

    1. You must be root, and running from the Knoppix CD.

    2. NOTHING on hda should be mounted, including swap.
    ' swapon -s ' == swap status; ' swapoff /dev/hdaX '
    ' umount /dev/hda* '

    3. ' dd if=/mnt/sdb1/image.dd of=/dev/hda bs=2M '

    Note: It may be more useful to image partitions (/dev/hda1) rather than the entire drive.

    --You can also compress/uncompress the drive image on the fly:
    ' dd if=/dev/hda bs=1M |gzip -9 >/mnt/sdb1/image.dd.gz '
    ' gzip -cd image.dd.gz > /dev/hda ' == Restore

    Quote Originally Posted by BrianC
    I've read the faqs and can find info on creating images but not of restoring them back to the hard drive.

    I have created a dd image file of the complete hard drive /dev/hda on a removeable hard drive
    using
    dd if=/dev/hda of=/mnt/sdb1/image.dd

    Now I am trying to restore the image back to the hard drive as an upgrade went wrong.
    However
    dd if=/mnt/sdb1/image.dd of=/dev/hda is not working.

    I think I have to make hda writeable but I don't know the exact syntax of the command I need.
    On the left of the desktop I can find icons for hda1, hda3 and hda7 which are currently on my machine but are currently unmounted.
    What exactly do I do here?

    Hope someone can help.

    Regards
    Brian C

  3. #3
    Junior Member
    Join Date
    Oct 2005
    Posts
    2
    Thanks - it worked perfectly.
    Restored the image to the disk and fired up a perfectly working computer again - one for the "True Stories of Knoppix Rescues"

    My problem was solved by firstly using a root shell and not getting clever fiddling about with mount, read-write, umount and thereby making the 'device busy' etc.
    I particularly like your compression command line - I'll try using it next time.

    Many thanks again.

    Regards
    Brian C

  4. #4
    Senior Member registered user
    Join Date
    Nov 2002
    Location
    Long Island, NY, USA
    Posts
    1,256
    I'd like to use your dd procedure to "ghost" a working dual-boot PC to one where I can't resize the XP partition to make room for a KNOPPIX install. I have 5 PCs in this category. I also have 2 PCs that can't read the KNOPPIX liveCD (bad drive - many read errors on CD boot).

    So, I'd love to make an image of a working PC with all the partitions intact, however, this is going to be a huge file, right? If I don't compress the file, as described above, how big will the image file be for a 40GB hdd? Will it image all 40GB even if many GBs are not as yet used? If I compress, what compression rate would I get, about 50%? I just don't know where I'd store such a huge image file! If the image file only copies stored files and not physical space, and I compress at 50%, then the image could be as small as 4GB, but I still don't know where I'd store it....

    Is there some way to install the image directly as its being made - a straight transfer of data without having to save an intermediary image file at all?

    BTW, here's some stats if it helps:
    These are Dell GX270s with 40GB hdd, 750MB RAM and Pentium IVs running at 2.8GHz.
    Also, the partitions on the working machines are set-up roughly as follows.
    hda1: Windows 95 rescue (<1GB)
    hda2: Windows XP primary boot partition (19GB)
    hda3: KNOPPIX-installered Linnux ext3 partition (19GB)
    hda4: linux-swap (whatever's left < 1GB)

    TIA,
    AJG

  5. #5
    Senior Member
    Join Date
    Nov 2003
    Posts
    1,323
    Perhaps try dd and netcat booting knoppix from the cd with noswap cheat on the master.

    - Check the ip of the slave.
    - Start netcat on the slave: nc -l -p 8000 | dd of=/dev/hda
    - Then start pushing data from the master you wish to copy: dd if=/dev/hda | nc 192.168.x.yyy 8000
    - Go get a laaaaarge cup of coffee.

    I would set aside a router disconnected from internet for this just to make sure nothing gets in the middle.
    You can choose the port, I chose 8000 just to put something there.

    Here's a boot floppy (2) with dd and nc for the boxes that won't boot from cd http://omnibus.uni-freiburg.de/~gian...escue/current/

    Disclaimer: haven't tried this

    PS: Wouldn't it just be easier to pull the hd's and dd locally on one computer?

  6. #6
    Senior Member registered user
    Join Date
    Mar 2004
    Posts
    1,516
    yes the image will be as large as the hdd, compression depoends on content... but 50% is not unheard of.

    hmm, you could perhaps use cp for the linux part (perhaps pipe it through compression as above), and dd only for the bootable win part, sadly I do not know if things work without dd on the bootable WIN partition though (doubt it).
    this is because WIN has some files that must be in certain points on the hdd and such. and as dd would copy everything even bad blocks... it should work great for that.
    in Linux I would only use dd for the mbr (to getlilo...) then I should be able to just copy things across.
    Code:
    cp -avx /mnt/cd-dvd-with_linux_stuff/ /mnt/hdXYlinuxpartition/
    Atleast the linux parts WILL work (IF hardware is similar enough).
    I use this as backup for my linux systems.

  7. #7
    Junior Member
    Join Date
    Dec 2005
    Posts
    2

    Re: Help to restore a dd image file back to the hard drive

    Quote Originally Posted by BrianC
    I've read the faqs and can find info on creating images but not of restoring them back to the hard drive.

    I have created a dd image file of the complete hard drive /dev/hda on a removeable hard drive
    using
    dd if=/dev/hda of=/mnt/sdb1/image.dd

    Now I am trying to restore the image back to the hard drive as an upgrade went wrong.
    However
    dd if=/mnt/sdb1/image.dd of=/dev/hda is not working.

    I think I have to make hda writeable but I don't know the exact syntax of the command I need.
    On the left of the desktop I can find icons for hda1, hda3 and hda7 which are currently on my machine but are currently unmounted.
    What exactly do I do here?

    Hope someone can help.

    Regards
    Brian C
    I am having a similar challenge. I made a HD image using DD, but grabbed the SDA1, not the entire disk image SDA. Every attempt I make to restore the image, including ones involving restoring to a partition larger than the original disk etc., all result in failure. The image I am trying to restore is an XP drive and the MFT does not restore to the correct location, if at all. Is there something simple I am missing to enable a simple recovery of this image? I've restored dd'd images, but am at a loss to restore a partition.

    Any help would be most apprec.; I've spent way too many hours trying various alts. unsuccessfully....

  8. #8
    Senior Member registered user
    Join Date
    Nov 2002
    Location
    USA, IL
    Posts
    1,041

    Re: Help to restore a dd image file back to the hard drive

    Same thing happened to me on a laptop. I was screwed, and had to basically reinstall Windows - so at that point I said hell with it and installed Knoppix.
    One can always run Windows under vmware, after all...

    Quote Originally Posted by JSMATT
    Quote Originally Posted by BrianC
    I've read the faqs and can find info on creating images but not of restoring them back to the hard drive.

    I have created a dd image file of the complete hard drive /dev/hda on a removeable hard drive
    using
    dd if=/dev/hda of=/mnt/sdb1/image.dd

    Now I am trying to restore the image back to the hard drive as an upgrade went wrong.
    However
    dd if=/mnt/sdb1/image.dd of=/dev/hda is not working.

    I think I have to make hda writeable but I don't know the exact syntax of the command I need.
    On the left of the desktop I can find icons for hda1, hda3 and hda7 which are currently on my machine but are currently unmounted.
    What exactly do I do here?

    Hope someone can help.

    Regards
    Brian C
    I am having a similar challenge. I made a HD image using DD, but grabbed the SDA1, not the entire disk image SDA. Every attempt I make to restore the image, including ones involving restoring to a partition larger than the original disk etc., all result in failure. The image I am trying to restore is an XP drive and the MFT does not restore to the correct location, if at all. Is there something simple I am missing to enable a simple recovery of this image? I've restored dd'd images, but am at a loss to restore a partition.

    Any help would be most apprec.; I've spent way too many hours trying various alts. unsuccessfully....

  9. #9
    Junior Member
    Join Date
    Dec 2005
    Posts
    2

    Reconstruction of drive

    In my efforts to restore the partition, I tried to restore a zero'ed drive in two steps. My resto was based on a functioning disk. I restored the first 16,127 sectors then I tried to restore the partition I am trying to recover at 16,128 (this disk structure matches the MBR in sector 0, the Dos LBA at 16,065, and the NTFS partition at 16,12.

    The headache is that dd will not restore to the 16,128 and beyond sectors once I've restored the first 16127 sectors. Here's the command I used:
    dd if=/mnt/sdd1/serverorig.img of=/dev/sdc obs=512 seek=16128

    I even tried changing the sdc to sdc1 thinking the first 16127 sectors is now seen by Linux as a DOS Lba partition. Either way, the .img file doesn't restore.

    Any thoughts?

  10. #10
    Senior Member registered user
    Join Date
    Mar 2004
    Posts
    1,516
    hmm, make the poatrition and then copy the files there from the image, just mount the image "-o loop"
    Code:
     mount -t filesystem -o loop /path/to/file.img /mount/point
    wont work on ntfs but...

Page 1 of 2 12 LastLast

Similar Threads

  1. Copy file from hard drive to usb flash drive
    By PaulKraemer in forum General Support
    Replies: 1
    Last Post: 05-08-2006, 04:49 PM
  2. Questions on setting up a Persistant Hard drive image
    By slvrldy17 in forum MS Windows & New to Linux
    Replies: 2
    Last Post: 02-23-2006, 04:06 AM
  3. Problem in re-saving a .doc file back to Hard Drive
    By satimis in forum General Support
    Replies: 1
    Last Post: 05-29-2005, 12:34 PM
  4. burn hard drive image to multiple dvds
    By jon1234444 in forum General Support
    Replies: 0
    Last Post: 01-20-2005, 08:14 AM
  5. Question about hard drive image
    By punkass in forum General Support
    Replies: 2
    Last Post: 05-08-2004, 05:20 PM

Posting Permissions

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


ASUS H110M-R Motherboard Intel 6th/7th Gen LGA1151 DDR4 Micro-ATX i/o shield picture

ASUS H110M-R Motherboard Intel 6th/7th Gen LGA1151 DDR4 Micro-ATX i/o shield

$42.00



***NEW*** BCM RX67Q Gaming Motherboard | Intel Q67 2nd/3rd Gen. | LGA1155 | DDR3 picture

***NEW*** BCM RX67Q Gaming Motherboard | Intel Q67 2nd/3rd Gen. | LGA1155 | DDR3

$27.77



Asrock Z390 Phantom Gaming 4S/AC Wifi 8th/9th Gen Intel 1151 Motherboard Bulk picture

Asrock Z390 Phantom Gaming 4S/AC Wifi 8th/9th Gen Intel 1151 Motherboard Bulk

$99.00



ASUS Motherboard H81M-C | No CPU picture

ASUS Motherboard H81M-C | No CPU

$30.00



Micro ATX Desktop Motherboard ASUS H110M-C LGA 1151 picture

Micro ATX Desktop Motherboard ASUS H110M-C LGA 1151

$31.95



ASRock B660M PRO RS LGA 1700 Intel SATA 6Gb/s DDR4 Micro ATX Motherboard picture

ASRock B660M PRO RS LGA 1700 Intel SATA 6Gb/s DDR4 Micro ATX Motherboard

$94.99



ASUS Q87M-E/CSM Intel Q87 Chipset DDR3 mATX LGA1150 Motherboard Tested picture

ASUS Q87M-E/CSM Intel Q87 Chipset DDR3 mATX LGA1150 Motherboard Tested

$48.95



ASUS Motherboard H110M-A | No CPU picture

ASUS Motherboard H110M-A | No CPU

$40.00



GIGABYTE MB10-Datto Motherboard Xeon D-1521- SR2DF 2.40 GHz- Open Box picture

GIGABYTE MB10-Datto Motherboard Xeon D-1521- SR2DF 2.40 GHz- Open Box

$115.00



BTC-S37 Mining Motherboard Kit /w SSD & Ram Preinstalled picture

BTC-S37 Mining Motherboard Kit /w SSD & Ram Preinstalled

$59.99