1832973 Members
2444 Online
110048 Solutions
New Discussion

cloning using dd

 
SOLVED
Go to solution
u856100
Frequent Advisor

cloning using dd

Hi all,

I am attempting to make a disk clone of the root disk on my HP machine. Can anyone give me the correct command (using dd) to replicate the entire disk.

ideally I would like to use :

dd if=/ of=/copy_of_slash

so that the entire disk is cloned.

Am I right in assuming that this is incorrect, and the raw device file for the disk should used :

dd if=/c0t6d0 of=/copy_of_rootdisk

thanks in advance for your help,

John
chicken or egg first?
7 REPLIES 7
melvyn burnard
Honored Contributor
Solution

Re: cloning using dd

The correct syntax is
dd if=/dev/rdsk/c0t6d0 of=/dev/rdsk/new_disk_path

I have to ask why you ar edoing ghis, as dd is a dumb, bit by bit utility, and will copy over any errors or bad bits it finds.
You may want to take a look at either MirrorDisk/UX for miroring your root vg, or for disaster recovery, use Ignite/UX
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
harry d brown jr
Honored Contributor

Re: cloning using dd

John,

You could cause yourself a lot of headaches, because "dd" with copy everything, including badspot info, of course wiping out the receiving disks' badspot table, possibly rendering the disk useless.

You are better off using HPux mirroring. Although it's not free it doesn't cost much compared to the amount of time one would have to spend recovering a machine.

live free or die
harry
Live Free or Die
Olivier LEGRAND
Frequent Advisor

Re: cloning using dd

Hi,

Try this command:

cd /;find . -xdev -print|dd of=/copy_of_slash

Regards
Valery Kuvaev
Occasional Visitor

Re: cloning using dd

I agree that you shouldn't use dd, even in the manner :
dd if=/dev/rdsk/source_disk of=/dev/rdsk/target_disk

it will create probably workable clone, but not garanteed.
Especialy if target disk has a larger capacity, you probably won't have a chance to use its additional capacity.

try Ignite/UX command make_tape_recovery to make a clone

Best Wishes
harry d brown jr
Honored Contributor

Re: cloning using dd

John,

What you can do, is create a make_tape_recovery with the "-A" option, then shut your system down, and recover your OS to the other disk. This will change your "primary boot" path, but you can change that back to the other disk. Once your new disk is created, you can shut the system down and reboot (don't forget to change the primary boot path to your "normal" boot disk). Now you are ready to rock and roll.

live free or die
harry
Live Free or Die
Bill Hassell
Honored Contributor

Re: cloning using dd

Since you mentioned 'disk clone' and not copy just one filesystem (such as /), then Ignite/UX is the appropriate application, specifically make_tape_recovery. Get a free copy at sofware.hp.com

Copying / will never give you a cloned result. The resultant copy will be unable to boot. Like all operating systems, there are non-file areas at the beginning of the disk that must be copied.


Bill Hassell, sysadmin
Ralph Grothe
Honored Contributor

Re: cloning using dd

Hi responders,

there some statements that you shouldn't use dd to copy every bit because it could render your target disk useless.
I'm asking this because I am interested in a cheap (ok, but maybe inefficient) tool that can clone disks without requiring a specific OS.
I'm thinking of a Linux Boot disk with dd on it (no, no, I don't intend to clone a HP-UX server disk that way, just for PC disk cloning).
Say I connected the target disk as slave to second IDE controller and want to clone master disk on first IDE controller.
Wouldn't a (maybe timeconsuming)

dd if=/dev/hda of=/dev/hdd

do the trick.
(assuming the standard 512 B block size).

How could I render the target disk useless?

I thought disk controllers do a bad block relocation?
Madness, thy name is system administration