How do I perform a Hard Disk Image Restore to a different disk

C M Reinehr cmr
Fri Jun 15 06:53:44 PDT 2007


James,

On Friday 15 June 2007 02:17, James McDonald wrote:
> I have an image of a partition which I took ages ago
>
> I must have done a dd or something (I don't remember) but the md5sum.txt
> I left in the same directory as the image file says it's an exact copy
> of the /dev/hdb1 I took it off.
>
> 20060601-hdb1-beige_tower.img             100%
> c93fdfd25b90ed78ee0917383d0bf964
>
> sudo md5sum /dev/hdb1
> c93fdfd25b90ed78ee0917383d0bf964  /dev/hdb1
>
>
> My question is how do I restore this back to a hard disk with a
> partition that isn't necessarily the same size?
>
> i can't just do dd if=image.img of=/dev/hdb1 because the image will be
> for the wrong size...
>
> any ideas?

Just an idea--I haven't actually tried this--but I believe you could mount the 
image as a loop mount and then use cp or tar to transfer the data. You'll 
have to prepare the new partition in advance. As you said, if you just dd the 
image into a new partition you'll be copying the file system as well. If the 
new partition is larger you just won't be using it all. If smaller then 
you're not going to be able to complete the copy.

HTH

cmr

-- 
Debian 'Etch' - Registered Linux User #241964
--------
"More laws, less justice." -- Marcus Tullius Ciceroca, 42 BC



More information about the Linux-users mailing list