Operating System - HP-UX
1753250 Members
3677 Online
108792 Solutions
New Discussion юеВ

Re: lvsplit then lvmerge on root vol group

 
SOLVED
Go to solution
Michael Ernstoff
Frequent Advisor

lvsplit then lvmerge on root vol group

I have several HP-UX 11i servers that need OS updates (patches, etc.).
I am using what I believe is a fairly standard technique in that I lvsplit each of the lvols in vg00 then apply changes.
After changes have been tested I decide which way the lvmerge should be run.
My query is what to do in the event that I want to back out the changes.
As it is the root volume group I am assuming that it is advisable to work in single-user mode.
Firstly if I lvmerge to overwrite the standard lvol with the backup I end up with just an lvol named as the backup lvol.
e.g. lvmerge /dev/vg00/lvol5 /dev/vg00/lvol5bkp results in one lvol named /dev/vg00/lvol5bkp.
Can I just rename the resulting lvol?
The second issue is how to overwrite the first lvol (i.e. the one that has / as its mount point).
I have tried this in single-user but get the message "lvmerge: Couldn't reallocate the logical volume: Device Busy"

I am sure I cannot be the first to hit this problem, but cannot find it in the forums.
Thanks in advance for any help. Points will be assigned.
6 REPLIES 6
Michael Ernstoff
Frequent Advisor

Re: lvsplit then lvmerge on root vol group

Worked it out for myself.
Rebooted in LVM maintenance mode, instead of single-user.
Obvious once you think about it.
Michael Ernstoff
Frequent Advisor

Re: lvsplit then lvmerge on root vol group

I would still appreciate advice on part one of this query
i.e. When overwriting the standard lvol with the backup, can I just rename the lvol (and rlvol) device files?
or is there a better method?
CAS_2
Valued Contributor
Solution

Re: lvsplit then lvmerge on root vol group

Hi

After doing lvsplit prior to install patches, I used to:

- run fsck on new bkp lvols (lvol1bkp, lvol3bkp, ...).

- mount /dev/vg00/lvol3bkp on /mnt (for instance) and use vi to edit /mnt/etc/fstab. Then I change lvol3 for lvol3bkp, lvol6 for lvol6bkp, ... and so on). Saves changes and unmount file system.

Other job should be to use lvlnboot in order to modify root and boot info ONCE you have rebooted in LVM maintenance mode -- I typed "should be" because I never tried this.

If you want to rename lvol names you should export/import the vg00. This, of course, only can be done in LVM maintenance mode. This is the method I know to rename the logical volumes.
Pete Randall
Outstanding Contributor

Re: lvsplit then lvmerge on root vol group

Michael,

I've never had occasion to try this, but I believe you're right - you would just rename the device files. I recall Bill Hassell, in a discussion on renaming tape device files, saying "There is no significance other than historical to the device names as we know them". So, I believe it would be the same whether we're talking tape device files or disk device files or LVM device files - you can just rename them.


Pete

Pete
Michael Ernstoff
Frequent Advisor

Re: lvsplit then lvmerge on root vol group

Thanks for the info.
Assuming the updates are successful, would you recommend re-mirroring in LVM maintenance mode?
Any other advice?
Mike Duffy_1
Honored Contributor

Re: lvsplit then lvmerge on root vol group

Michael,

I would highly recommend the split. I upgraded OVO and Oracle. I split the volume and fsck the copies. Left them in a safe place and did the upgrade. When complete I copied the saved over the upgraded (this did involve renaming the LVM device files in /dev/volgrp/ but no major issue. I did the upgrade a few times before remorring the correct way and again no probs.

Just bear in ming you have no mirror while playing with split volumes.