Operating System - HP-UX
1834275 Members
3496 Online
110066 Solutions
New Discussion

How to un-mirror and mirror the boot disk?

 
SOLVED
Go to solution
Gino Castoldi_2
Honored Contributor

How to un-mirror and mirror the boot disk?

Server: rp5450/L2000 HP-UX 11.0 MC/SG 11.09 MirrorDisk/UX

We are planning to patch the system/boot disk on our server. The system/boot disk is currently mirrored to one other disk (two-way mirror).

Before we install patches (Support Plus CD) we would like to break the mirror so that we can have a good "before" copy of the system/boot disk.

Once the patches are applied and we have rebooted and everything checks out ok,
we would like to mirror the system/boot disk again.

What steps should we take to do this?
Any issues/best practices that we should be aware of?

FYI: We do not have a local tape drive so we can not use Ignite-UX.

10 points to any good answer.
TIA, Gino

10 REPLIES 10
Pete Randall
Outstanding Contributor
Solution

Re: How to un-mirror and mirror the boot disk?

Gino,

To break the mirror(s), you need to lvsplit each of the lvols, then lvmerge them when you're ready (making sure to specify the lvols in the correct order: lvmerge split_lvol current_lvol).


Pete

Pete
Gino Castoldi_2
Honored Contributor

Re: How to un-mirror and mirror the boot disk?

Pete,

Is there any specific order (1-8 or 8-1?)that I need to split and merge the volumes?
Do I need to run fsck on the split volumes after the volumes are split?

10 points to any good answer.
TIA, Gino
Pete Randall
Outstanding Contributor

Re: How to un-mirror and mirror the boot disk?

Gino,

The order is not significant and you should not need to run fsck.


Pete

Pete
Ravi_8
Honored Contributor

Re: How to un-mirror and mirror the boot disk?

Hi Gino

I never break the mirror while applying the patches.

but i make sure i have copy of existing kernel (vmunix) file.
before applying patch

#cp -p /stand/vmunix /stand/vmunix.org

now apply the patch

If the system doesn't comes up with new kernel

boot with previous kernel

ISL> hpux /stand/vmunix.org

never give up
Fabio Ettore
Honored Contributor

Re: How to un-mirror and mirror the boot disk?

Hi Gino,

# lvreduce -m 0 /dev/vg00/lvolX /dev/dsk/cYtYdY

# lvextend -m 1 /dev/vg00/lvolX /dev/dsk/cYtYdY

X stands for 1,2,3 and so on, Y stands for device file of the mirror disk.

A very important thing is that you MUST begin to mirror logical volumes in the numeric order, that is before lvol1, lvol2, lvol3 and so on again. Otherwise you will have problem to boot from secondary disk (mirror disk).

Also check by

# lvlnboot -v


Best regards,
Ettore
WISH? IMPROVEMENT!
Pete Randall
Outstanding Contributor

Re: How to un-mirror and mirror the boot disk?

Along Ravi's line of thought, I would suggest running an Ignite make_tape_recovery prior to patching. Just copying the kernel will probably get you running again if you run into problems, but you'll still have to straighten out all the filesets which are now out of sync with the running kernel. Swremove can be problematic but an Ignite recovery to a known starting point is fool-proof.


Pete

Pete
Pete Randall
Outstanding Contributor

Re: How to un-mirror and mirror the boot disk?

Ettore,

Wouldn't the lvreduce eliminate the mirror? According to the man page says that the "physical extents that comprise the deleted mirror copy or copies are deallocated". Would Gino still be able to boot off the mirror if his patching is unsuccessful?

I always though that lvsplit/lvmerge were used to break and re-sync mirror copies, so I'm curious.


Pete

Pete
Cheryl Griffin
Honored Contributor

Re: How to un-mirror and mirror the boot disk?

Pete,
That thought struck me as well. I think lvsplit is the way to go because we want the mirror to remain in tact and capable to boot from in case of emergency.

SYS ADM: Booting from mirrored/split environment DocID: X1401978 is the doc I'd advise to use in this particular case.
"Downtime is a Crime."
Wim Rombauts
Honored Contributor

Re: How to un-mirror and mirror the boot disk?

I use this procedure of splitting and merging regularly to protect myself from accidental mistakes on the root disk.

First use lvsplit. The best thing is to preceed it with the sync command :

sync ; lvsplit ...

Split the root partition as the very last one, because your splitted root partition has to be aware of the other splitted of LV's. If you split of root first, your lvmtab file is inconsistent with the actual disk layout.

Then use fsck to fix your filesystems. If you used sync before your lvsplit, there won't be much to fix.

Then mount your split-off root filesystem and modify /etc/fstab to specify the split-off LV's as the source of your filesysem.

Mount your split-off /stand filesystem and edit the bootconf file. Set the devicefile to the physical disk that contains your split-of stand and root filesystem.

Now your disk is ready as a stand-alone boot disk. Your LVM configuration is not however !

If you need to boot from the split-off disk, use lvrmboot to remove the boot configuration, and use lvlnboot (see man page) to specify your split-off filesystems as the stand and root filesystems to boot from.

Restart your system and enjoy your failover configuration.
Pete Randall
Outstanding Contributor

Re: How to un-mirror and mirror the boot disk?

Gino,

Comparing Wim's method and Cheryl's TKB doc, it appears I was all wet about the order and about the fsck. I'd follow Wim's method.


Pete

Pete