1842633 Members
3218 Online
110194 Solutions
New Discussion

dd for diskcloning

 
SOLVED
Go to solution

dd for diskcloning

From reading other threads i'm able to use the command "dd if=/dev/rdsk/c0t1d0 of=/dev/rdsk/cot2d0 bs=1024k" to make a clone of a 4 GB disk from one drive to another on our machine, but I get the following error when it completes the copy:
I/O Error
4341+0 records in
4340+1 records out
The new disk boots ok after I get the message "Filesystem not properly shutdown, beginning file system repair" and it goes through the filesystem repair. Once it boots it looks like everything works ok from what little I've tried. Does anybody know what is going on and if there is anything to be concerned about?
Thanks,
Greg
qwerty uiop
10 REPLIES 10
John Palmer
Honored Contributor

Re: dd for diskcloning

Hi Greg,

Your two disks are not exactly the same size.

The last block cannot be completely written to c0t2d0 that's why you get the 4340+1 records out. The +1 means 1 short block.

As to whether there's a problem, I suspect not as if the Physical extent size was 4Mb then that last 1Mb on top of the 4340Mb couldn't have been a valid extent anyway.

Hope this helps,
John
Madhu Sudhan_1
Respected Contributor

Re: dd for diskcloning

Gregory:
Couple of thoughts.
Looks like the source or destination hard disk has bad blocks. Use the command
dd if=/dev/rdsk/c0t1d0 of=/dev/null bs=1024k, to check to see if the command gives the same I/O Error.
Once again it depends whether the HDD is used as a physcial volume or it is a raw disk. If it is a physical volume and is part of a volume group, the lvm subsystem will take care about bad block relocation.

......Madhu


Think Positive
Madhu Sudhan_1
Respected Contributor

Re: dd for diskcloning

Gregory:
Couple of thoughts.
Looks like the source or destination hard disk has bad blocks. Use the command
dd if=/dev/rdsk/c0t1d0 of=/dev/null bs=1024k, to check to see if the command gives the same I/O Error.
Once again it depends whether the HDD is used as a physcial volume or it is a raw disk. If it is a physical volume and is part of a volume group, the lvm subsystem will take care about bad block relocation.

......Madhu
Think Positive

Re: dd for diskcloning

Thanks for the help guys. I tried Madhu's suggestion of doing dd to /dev/null and got
4341+1 records in, 4341+1 records out for the original disk and 4340+1 records in, 4340+1 records out for the new disk. So is there a way to see if anything is missing on the new disk?

Greg
qwerty uiop
Madhu Sudhan_1
Respected Contributor

Re: dd for diskcloning

If you have space, you can output dd to a file and later use "cmp" to compare both source and destination are same or there is a difference.
Example : cmp
Also you can use xd or od command to see both the files have the same contents.

Enjoy !

......Madhu
Think Positive
Madhu Sudhan_1
Respected Contributor

Re: dd for diskcloning

If you have space, you can output dd to a file and later use "cmp" to compare both source and destination are same or there is a difference.
Example : cmp
Also you can use xd or od command to see both the files have the same contents.

Enjoy !

......Madhu
Think Positive
Madhu Sudhan_1
Respected Contributor

Re: dd for diskcloning

If you have space, you can output dd to a file and later use "cmp" to compare both source and destination are same or there is a difference.
Example : cmp
Also you can use xd or od command to see both the files have the same contents.

Enjoy !

......Madhu
Think Positive
Andreas Voss
Honored Contributor
Solution

Re: dd for diskcloning

Hi,

when doing a dd from an active disk (think you have done so) then your copied disk needs a fsck because the source was not in an unmounted state. You can do this after dd with: fsck -y /dev/rdsk/c0t2d0

Regards
Madhu Sudhan_1
Respected Contributor

Re: dd for diskcloning

Thanks Andreas !. A good suggestion.

Regards,
......Madhu
Think Positive

Re: dd for diskcloning

I tried to "fsck -y /dev/rdsk/c0t2d0" and got
an error: "bad superblock, magic # wrong", and disk still goes through file repair on bootup. Help!

-Greg
qwerty uiop