Operating System - HP-UX
1834141 Members
2648 Online
110064 Solutions
New Discussion

Extend a Mirrored Logical Volume

 
SOLVED
Go to solution
Rob Smith
Respected Contributor

Extend a Mirrored Logical Volume

Hello All,

This seems to be a really simple task but for some reason I am second guessing myself because I have not worked on a HP box in a while. This a 10.20 box.

I have a Volume Group with 2 Logical Volumes. One is barely used, the other is almost full. The plan is to delete one and then use the reclaimed space to extend the other. Both Logical Volumes are mirrored onto a single disk. There are two disks in the Volume Group, one for the data and the other for the mirrors. Here are my steps.

1) Backup the data on both Logical Volumes.
2) Unmount LV3
3) Lvremove LV3
4) Umount LV2
5) lvextend -L 5120 /dev/vg03/lvol2
6) extendfs -F vxfs /dev/vg03/rlvol2
7) mount and bdf.

Are there any special considerations because of the mirroring? Or because of a strict allocation policy ? I think I remember doing this once and it failed with an error relating to strict allocation although I forget the circumstances and the fix. Any help would be appreciated and I will assign points.

Rob
Learn the rules so you can break them properly.
6 REPLIES 6
A. Clay Stephenson
Acclaimed Contributor

Re: Extend a Mirrored Logical Volume

With strict allocation, the PE's for an LVOL and its mirror(s) must be on separate
PV's. In other words, let's say that you want to extend an existing LVOL by 500MB and that you have 400MB oon disk1 and 4000MB on disk2. The lvextend will fail because there is not enough free space on disk1 eventhough there is more than enough room in the entire VG to extend the LVOL.

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

Re: Extend a Mirrored Logical Volume

Rob,

If your Logical Volume is currently mirrored, you will have to break it before you can actually do your lvextend. Once it is broken, you can extend your LV and FS, mount it, and then re-create your mirror on that LV. The rest of your procedure looks great.
Cooperation is doing with a smile what you have to do anyhow.
Robert-Jan Goossens
Honored Contributor

Re: Extend a Mirrored Logical Volume

Rob Smith
Respected Contributor

Re: Extend a Mirrored Logical Volume

"If your Logical Volume is currently mirrored, you will have to break it before you can actually do your lvextend. Once it is broken, you can extend your LV and FS, mount it, and then re-create your mirror on that LV."

Is this true? I was almost certain that when I did this before I did not have to break the mirror? Could someone please clarify this for me?

Rob
Learn the rules so you can break them properly.
Jeff Schussele
Honored Contributor
Solution

Re: Extend a Mirrored Logical Volume

Hi Rob,

Generally, no, you don't have to break the mirror to extend it.

The only gotcha I see in your plan is IF the second LV that you wish to remove is NOT mirrored. Then you'll have issues. If it WAS mirrored, and had strict allocation, you should be OK.

Remember that mirroring is at the LV level - not the VG or PV level. So you could have LVs in the same VG being mirrored & some not being mirrored. Not a standard setup, but is a scenario that could happen.

One thing I notice is you don't mention whether you have OnLineJFS or not. If you did you would not need to unmount the LV to be extended.
You could use the fsadm command to extend the FS on the fly.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Helen French
Honored Contributor

Re: Extend a Mirrored Logical Volume

There is no need to break the mirror to extend the LV. The one which you need to consider is the data and mirror disk size. As it is strict allocated, you should check and see if the second (mirror) disk has enough space on it. If confused about the plan, better do it through SAM.
Life is a promise, fulfill it!