How to extend mirrored VG?

Hi all,

I need to extend a lv, but unfortunately I do not have enough space on my mirrored Volume group.

I've planned to add 2 more disks to this vg (for mirroring)

But ... what's the next steps to extend my lv using these 2 disks with a valid mirroring ?

  1. extendvg myvg disk1 disk2
  2. mirrorvg -?????

I may need to unmirror the vg here or there is others options ?

Thanks,

Fabien ! :slight_smile:

I used to extend mirrorvg before and i just straight extendvg without unmirrorvg as i don't think any reasons for unmirror-ing before extendvg since i would like to increase that vg size only.

The problem here is I would need to keep a minimum of control of this mirroring on my VG, means new disk1 mirrored to new disk2.

You don't have to use "mirrorlv" if the LV is mirrored already. Once you have added the new PV to the VG ("extendvg"), you have added some available PPs to the VG. If you now extend your LV ("chlv" or "chfs" - i prefer to use "chlv" first and only then "chfs") and there is no space for the mirror left on your old PVs the system will take automatically the necessary PPs from the newly added volume.

The only problem might arise if you have additional options like "superstrict" switched on or something such and the system can't allocate the missing PPs according to these rules. Remove one mirror for this LV then, run "reorgvg" to get as much contigouus space as possible and then remirror (using "mirrorlv") again. This should now work.

You can - for a maximum of control - use "lmigratepv" once you have unmirrored the LV (use with extreme caution, this is as low-level as it gets, shy from a "dd" onto the naked device) or recreate the LV using a map file altogether. Recreating the LV would mean taking it offline for some time, the other way can be done while it is running (really - done that!). Still, usually this sort of control isn't necessary and with the usual LVM controls one gets more or less what one wants.

I hope this helps.

bakunin

1 Like