Operating System - HP-UX
1827286 Members
1624 Online
109717 Solutions
New Discussion

How to clone the boot disk to another spare disk?

 
SOLVED
Go to solution
Gino Castoldi_2
Honored Contributor

How to clone the boot disk to another spare disk?

Hi,

Background: HP-UX 11.0 L2000/rp5450 9.1GB LVD HotPlug disks.

Note: The boot disk is already mirrored to another disk.

Question: How do I "clone" the system boot disk? I have a spare 9.1GB LVD HotPlug drive and we want to use it for this purpose.

Should I use the 'dd' utility in single user mode or is there another way to do this?

We do not have a locally attached tape drive, but we do have an Enterprise backup system that performs the backups.

(10 points to any good answer).
Thank you Gino.


10 REPLIES 10
Pete Randall
Outstanding Contributor
Solution

Re: How to clone the boot disk to another spare disk?

Gino,

As long as the drives are identical, dd would work but I would think you could just replace the mirror disk with your spare, sync the new mirror and then use that.

Good luck,
Pete

Pete
Sanjay_6
Honored Contributor

Re: How to clone the boot disk to another spare disk?

Hi Gino,

The procedure i normally use is remove the primary disk, put the new disk in its place, boot thru the mirror, do a vgcfgrestore on the new disk, then mirror the root mirror to the new disk. This way there is a copy of the primary root disk. This is just like replacing the root disk, the only thing is that instead of replacing a faulty root disk, you are replacing a good boot disk. You can then use a cloned primary disk or use the original disk itself.

Hope this helps.

Regds
Sridhar Bhaskarla
Honored Contributor

Re: How to clone the boot disk to another spare disk?

Gino,

Yes you can.

But make sure you run mkboot after dd, bring the system up, import the disk as some temporary volume group and verify the contents of /stand/bootconf file in it before you try to boot it.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Ravi_8
Honored Contributor

Re: How to clone the boot disk to another spare disk?

Hi,

Noway you can do cloning of root disk to another disk which doesn't have anything.

core OS installation on both disks makes them identical
never give up
Gino Castoldi_2
Honored Contributor

Re: How to clone the boot disk to another spare disk?

Hi Ravi,

>Noway you can do cloning of root disk to another disk which doesn't have anything.

>core OS installation on both disks makes them identical


Is this true? You mean to say that we can not
make a duplicate of the system disk with 'dd'
and/or make a copy of the mirrored boot disk
as the others have said in this thread?

To use the Core OS install CD and then try to load the exact software and configurations is an almost impossible task!?

(10 points to any good answer)
Thank you Gino.

Ravi_8
Honored Contributor

Re: How to clone the boot disk to another spare disk?

Hi, Gino
Thanx for ur question again,
I think using dd to clone the root disk is almost remote, because if you used it
#dd if=/ of=/dev/dsk/xxx may copy only the / contents, what about the rests(/opt, /var,/usr...)If you did so (eg:
dd if=/opt of=/dev/dsk/xxx), there will be inconsistence,

As Sanjay says, cloning can done in that way too. Another way is using ignite by creating the depot of all the s/w you wanted to be on machine and push only those s/w which are in root disk.
never give up
Ravi_8
Honored Contributor

Re: How to clone the boot disk to another spare disk?

Hi, Gino
Thanx for ur question again,
I think using dd to clone the root disk is almost remote, because if you used it
#dd if=/ of=/dev/dsk/xxx may copy only the / contents, what about the rests(/opt, /var,/usr...)If you did so (eg:
dd if=/opt of=/dev/dsk/xxx), there will be inconsistence,

As Sanjay says, cloning can done in that way too. Another way is using ignite by creating the depot of all the s/w you wanted to be on machine and push only those s/w which are in root disk.

Comments are welcome!!!
never give up

Re: How to clone the boot disk to another spare disk?

I was always under the impression that if I used dd from one LVM disk to another, this would also copy the 'relocated' bad blocks, which of course are not valid on another disk....

HTH

Duncan

I am an HPE Employee
Accept or Kudo
Sridhar Bhaskarla
Honored Contributor

Re: How to clone the boot disk to another spare disk?

If your other logical volumes (/usr,/var,/opt etc) are part of this disk, everything will be duplicated. You will need to use the disk device files as input and output files not "/".
Initially you may need to bring it up to "lm" mode to fix lvlnboot strings though.

However, I do agree that the method mentioned by Sanjay is a good one.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
A. Clay Stephenson
Acclaimed Contributor

Re: How to clone the boot disk to another spare disk?

Actually, this is rather simple and, in fact, I do this on all my boxes every weekend via cronjobs. This is my 'lifeboat' technique and the idea is that you do a raw disk (/dev/rdsk/) copy of the boot disk. A 'lifeboat' protexts you from two things that a mirror does not: 1) VERY bad patches 2) Your own stupidity (e.g. rm -r *). This is NOT meant to replace mirroring but rather to supplement it.

The copying should be done when the system is fairly quiescent (mine are at 0300 Sundays) and if you do have to boot from the lifeboat, the system will do a fsck but I have never had a lifeboat to fail. You must use a disk identical to your boot disk to serve as your lifeboat copy. The idea is that if you need to use the lifeboat, you simply shutdown; move the lifeboat disk into the boot slot and boot normally. You are up much faster than with Ignite.

I've attached my copy_boot script; make sure that you set the SRC and DEST devices. The script can handle multiple disks; just list corresponding source and destination disks in order in the respective arrays.

Regards, Clay
If it ain't broke, I can fix that.