Operating System - HP-UX
1825793 Members
2177 Online
109687 Solutions
New Discussion

how do I swap one of the mirrored root disks?

 
SOLVED
Go to solution
Morten Kristiansen
Frequent Advisor

how do I swap one of the mirrored root disks?

Hi,

I've looked for documentation how I can swap a mirrored root disk. One of our root disks is broken and I want to swap it.

The system is a HP 9000 N-Class running hpux 11.00 and we are using lvm.

I have the understanding that i have to take all lvols out of the mirror with lvreduce, change the broken disk, run mkboot, lvlnboot and then lvextend to set up the mirror again.

But what is the meaning of one-way, two-way and three-way mirroring? How can I determine what is the primary boot disk? How do I control which way the mirroring is done (from A to B or from B to A)?

Can anybody help me please?

regards
Morten K
5 REPLIES 5
melvyn burnard
Honored Contributor

Re: how do I swap one of the mirrored root disks?

well if the disk and all the lvols on it ARE mirrored, you do not need to reduce the lvols. Just make sure you have the right disk, replace it with the new disk, use vgcfgrestore to write the LVM info back to the disc,, and then vgsync the vg

My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Peter Godron
Honored Contributor

Re: how do I swap one of the mirrored root disks?

HI,
you already know which is the working disk as you said one of the disks is broken.
Your understanding is correct:
unmirror
remove disk
rebuild
sync
If you use SAM it will pretty much allow you to do all of those things.
Regards
Robert-Jan Goossens
Honored Contributor

Re: how do I swap one of the mirrored root disks?

Hi Morten,

# setboot
will display your Primary and Alternate bootpath.

You do not have to use lvreduce just swap the broken disk for a new one

# vgcfgrestore -n /dev/vg00 /dev/rdsk/cxtydz
# vgchange -a y /dev/vg00
# vgsync

Regards,
Robert-Jan
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: how do I swap one of the mirrored root disks?

There is no need to remove any LVOLS. I assume this is a hot-plug disk so there is no need to shutdown.

Let's assume the bad disk is c0t6d0.

RAW=/dev/rdsk/c0t6d0
COOKED=/dev/dsk/c0t6d0

1) Remove the failed disk and insert the replacement disk.

2) vgcfgrestore -n /dev/vg00 ${RAW}
vgchange -a y /dev/vg00

3) mkboot ${RAW}
mkboot -a "hpux -lq (;0)/stand/vmunix" ${RAW}

4) lvlnboot -R

5) vgsync /dev/vg00

At this point, you are fully recovered but it's always a good idea to make sure that you are able to boot from this disk.

The "way" of mirroring simply means the number of mirror copies maintained for a given LVOL. You really need to abandon the idea of the direction of mirroring with respect to LVM because it has no meaning. All of the "copies" (including the original) are simply mirrors and all are equally valid.
The exception to this is an lvsplit/lvmerge where you are intentionally splitting off LVOL's for backup purposes and will later merge them back into their normal roles. In this case, the lvmerge definitely has a direction.

If it ain't broke, I can fix that.
Sanjay_6
Honored Contributor

Re: how do I swap one of the mirrored root disks?

Hi Morten,

There is no need to do lvreduce or anything. Just replaced the failed disk/do vgcfgrestore/ do vgchnage -a y /dev/vg00 to activate the disk and do vgsync.

Take a look at this doc from itrc. documented procedure in replacing a lvm disk.

http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000073905420

The itrc doc id is KBAN00000347.

Hope this helps.

Regds