Using dd to make harddrive

From: Philip Washington (phwashington_at_attbi.com)
Date: 04/28/04


Date: 27 Apr 2004 18:21:27 -0700

I was trying to make a copy of a harddrive using dd and I am not
having much success.

The Source disk is smaller than the target.

I first tried
on Computer1
dd if=/dev/hdh | gzip > ComputerDisk.gz
then
on Computer2
gunzip ComputerDisk.gz -c | dd of=/dev/hdh

I wasn't mounted to either disk when I performed these operations.

I wasn't to sure about this method so I tried to use fdisk on the
harddrive in Computer2 and ran

dd if=/dev/hdh1 | gzip > ComputerPart1.gz
dd if=/dev/hdh2 | gzip > ComputerPart2.gz
dd if=/dev/hdh of=MBRofDisk.img bs=512k count=1

I then partitioned the harddisk on Computer2 with exactly the same
size partitions or as close as possible.

gunzip ComputerPart1.gz -c | dd of=/dev/hdh1

I got an error about illegal compression format tried the same with
ComputerPart2.gz and got the same error message.

I have no idea if the MBR image was going to do me any good since
these disk weren't the same size.

Any recommendations on what or how I should do this? I would really
like to learn how to do this using dd. I basically don't really know
what I'm doing, I just tried to read some examples and piece together
an idea of how to go about this.

After running
gunzip ComputerPart1.gz -c | dd of=/dev/hdh1
I also got errors evertime I tried to use a command from /bin /usr/bin
(ls,ssh,dir)
that the share was corrupt. Scared the crap out of me, but I rebooted
and everything was fine.



Relevant Pages

  • bsdlabel question
    ... Then take this disk to ... the target system. ... preparing the target disk to create the required slices and partitions ... where the contents of my spare disk will be copied over. ...
    (comp.unix.bsd.freebsd.misc)
  • Re: Copying a FreeBSD install to a smaller disk
    ... I've got a 3rd FreeBSD install I can boot from and store temporary ... The disk is partitioned using the ... size of the clone target, it should be possible to copy the source files ... the *boot* device, so the hard disk partitions ...
    (freebsd-questions)
  • Re: bsdlabel question
    ... Then take this disk to ... > the target system. ... > preparing the target disk to create the required slices and partitions ... > where the contents of my spare disk will be copied over. ...
    (comp.unix.bsd.freebsd.misc)
  • Using dd to make harddrive image
    ... The Source disk is smaller than the target. ... I wasn't mounted to either disk when I performed these operations. ... harddrive in Computer2 and ran ... size partitions or as close as possible. ...
    (comp.os.linux.misc)
  • Re: IRQL_NOT_LESS_OR_EQUAL and EWF
    ... i ran tap.exe on my target syste, and rebuilt a image, that seems ... not EWF required. ... the OS to write to disk: http://msdn.microsoft.com/library/en-us/xpehelp/html/xeconElToritoCDAsDisk.asp. ... created by TD to the sdi file. ...
    (microsoft.public.windowsxp.embedded)