-
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
-
Senior Member
registered user
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
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
-
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
-
Senior Member
registered user
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
-
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?
-
Senior Member
registered user
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.
-
Re: Help to restore a dd image file back to the hard drive
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....
-
Senior Member
registered user
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...
Originally Posted by
JSMATT
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....
-
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?
-
Senior Member
registered user
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...
Similar Threads
-
By PaulKraemer in forum General Support
Replies: 1
Last Post: 05-08-2006, 04:49 PM
-
By slvrldy17 in forum MS Windows & New to Linux
Replies: 2
Last Post: 02-23-2006, 04:06 AM
-
By satimis in forum General Support
Replies: 1
Last Post: 05-29-2005, 12:34 PM
-
By jon1234444 in forum General Support
Replies: 0
Last Post: 01-20-2005, 08:14 AM
-
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
-
Forum Rules
1U Supermicro Server 10 Bay 2x Intel Xeon 3.3Ghz 8C 128GB RAM 480GB SSD 2x 10GBE
$297.00
SuperMicro Server 505-2 Intel Atom 2.4GHz 8GB RAM SYS-5018A-FTN4 1U Rackmount
$202.49
HP ProLiant Xeon E3-1220L V2 MicroServer Gen8 2.30 GHz 16 GB RAM NO DRIVES
$199.99
HPE ProLiant MicroServer Gen8 Intel Xeon E3-1265L 16GB ECC PCIe x16 4x1TB HDD
$249.99
HPE ProLiant MicroServer Gen10 Plus v2 Ultra Micro Tower Server - 1 x Intel Xeon
$846.19
Supermicro 505-2 Mini-1U Server 5018A-FTN4 16GB 2.4ghz Atom + Rack Ears
$199.00
Microsel Server Tower Supermicro X10SAE E3-1275 V3 @3.5GHz 16GB 509849-001
$149.99
Supermicro 5018A-FTN4 Rack Server - Black
$125.00
SUPERMICRO CSE-512 AMD Opteron Processor 6128, 32GB DDR3 RAM NO HDD
$90.00
1U Supermicro Server X10DRU-i+ 2x Xeon Total 36 Cores 64GB 4x 10GBE-T 2PS
$299.00