Operating System - HP-UX
1836878 Members
2194 Online
110111 Solutions
New Discussion

How to dd a mirrored root disk

 
SOLVED
Go to solution
Wayne Fontaine
Advisor

How to dd a mirrored root disk

There has been threads discussing the advantages of creating a lifeboat but without mentioning the specific commands.

Does the mirror have to be broken apart first before running dd?

If so, doesn't that leave the system exposed during the dd operation?

Thanks,
Jim

9 REPLIES 9
Peter Godron
Honored Contributor

Re: How to dd a mirrored root disk

Jim,
have you not created your mirror disk as an alternate bootable disk ?

The lifeboat is normally a spare disk that physically replaces the original boot disk, in its original slot.

You break the mirror then dd, please see:
https://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1015495

Yes, during the dd you are running on single disk!
John Guster
Trusted Contributor

Re: How to dd a mirrored root disk

what is the point to dd right after break the mirroring? two disks are mirroring each other, that means they are identical...
Patrick Wallek
Honored Contributor

Re: How to dd a mirrored root disk

First, NO you do not have to break your mirrors while creating the dd lifeboat disk. Just make sure you are writing to a different disk. Breaking the mirrors would not really do you any good.

For the procedures to create a lifeboat disk have a look at this thread:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=118108
Alzhy
Honored Contributor

Re: How to dd a mirrored root disk

James,

Different method.. also works. You may be warned by others here of potential issues.. but I've not seen issues in the 5 years I've employed this approach.

1.) Find out which disk is your primary , where you're booted on

lvlnboot, etc.

2.) You can dd copy to a similar sized / geometry destination disk or a bigger disk. It does not matter if the disk is local or remote.

cXtXdX - is your mirror pairs primary disk
cYtYdY - is your target disk

IF cYtYdY is LOCAL :
dd if=/dev/rdsk/cXtXdX of=/dev/cYtZdZ bs=1024k

IF cXtXdX is REMOTE (from the remote):

ssh/remsh srcsrv dd if=/dev/rdsk/cXtXdX | dd if=/dev/rdsk/cYtYdY

3.) The dd-copy disk should now be bootable and it will just be a few easy steps to settle the disk (i.e. booting LVM maint mode, etc... clearing the mirrors, etc...)


Enjoy.
Hakuna Matata.
Wayne Fontaine
Advisor

Re: How to dd a mirrored root disk

After thinking hard over the replies, it makes sense now that I don't need to break the mirrors if I dd at the primary raw disk device level.

Nelson, can you provide more detail by what you mean: "booting LVM maint mode, etc... clearing the mirrors, etc.."? The etc's scare me. Is a fsck after the dd not sufficient?

Thanks,
Jim
A. Clay Stephenson
Acclaimed Contributor

Re: How to dd a mirrored root disk

The dd is sufficicient and the automatic fsck's will take care of themselves (at least, I've never had one fail to boot). Of course, if you have a 2 disk vg00 and you only have one lifeboat disk, you don't have quorum so you have stale extents on the mirror --- because the mirror disk isn't in the box. It's very easy to remirror. It's the same procedure as remirroring after a disk failure.

If you are truly paranoid, you can add another level to the lifeboat creation. After the dd has finished, you can vgimport the lifeboat as a new VG, activate the VG (overriding quorum), and then run fsck each filesystem and have it marked clean. Your current boot disk has the data you need so that you know for example that lvol4 is an vxfs filesystem on both the original disk(s) and the lifeboat. My newer lifeboat creation scripts have added that feature although even without it, I've never had a lifeboat sink.
If it ain't broke, I can fix that.
Alzhy
Honored Contributor
Solution

Re: How to dd a mirrored root disk

YOU MUST ONLY DO THIS WHILE BOOTED OFF OF YOUR CLONED DISK. IF YOU DO IT OFF OF YOUR "USUAL" DISK, YOU'RE SYSTEM WILL BECOME UNBOOTABLE. :-)

I believe that you need to re-import the disk and change the lvlnboot information. The reason for this is that you want the lvmtab on the "cloned" disk to point at /dev/dsk/c0t4d0 but it points at /dev/dsk/c0t6d0.

Here is what you what do:

boot into LVM maintanence mode from your cloned disk:

From hpux prompt type:

hpux -lm

Then vgexport the root volume group:

vgexport /dev/vg00

Then recreate the vg00 group and node for your system:

mkdir /dev/vg00
mknod group c 64 0x000000

Then vgimport your disk:

vgimport /dev/vg00 /dev/dsk/c4t0d0

Next, take care of the lvnboot information:

vgchange -a y /dev/vg00

lvrmboot -r /dev/vg00
lvlnboot -b /dev/vg00/stand
lvlnboot -r /dev/vg00/root
lvlnboot -d /dev/vg00/swap
lvlnboot -s /dev/vg00/swap

lvlnboot -R
sync
sync
reboot

This should take care of it.


For mirrored transported disks:

MAP File edit...
lvreduce -m 0 the LVOLS
vgreduce
root@unknown # vgreduce -f /dev/vg00
PV with key 3 sucessfully deleted from vg /dev/vg00
PV with key 5 sucessfully deleted from vg /dev/vg00
Repair done, please do the following steps.....:
1. save /etc/lvmtab to another file
2. remove /etc/lvmtab
3. use vgscan(1m) -v to re-create /etc/lvmtab
4. NOW use vgcfgbackup(1m) to save the LVM setup
Hakuna Matata.
Wayne Fontaine
Advisor

Re: How to dd a mirrored root disk

Hi Nelson,

If I understand your mop correctly, it would only be required if I decide to leave all drives in their respective present bay locations.

If I was on site, I could simply power down the server, swap the bad primary boot disk with the good lifeboat disk, boot to single user mode, follow Clay's suggestion to rebuild the mirror (because ipso facto the data on the mirror in this scenario would be corrupt) and then finally init to multi-user mode, correct?

Thanks,
Jim
Alzhy
Honored Contributor

Re: How to dd a mirrored root disk

Absolutamente!

And since this method has the "Imprimatur" of the Great A. Clay - it must be generally okay.

Hakuna Matata.