lvextend on mirrored lv

 
Rob R.
New Member

lvextend on mirrored lv

I screwed up and did an lvextend on the usr lvol without first getting rid of the mirror. There are 3 disks in the vg, and the lv now crosses all of them making mirroring impossible.

How do I get rid of the mirror post lvextend? Will the system have issues coming up with the mirroring in this awkward state? I'm not worried about retaining the mirror as the box will be replaced this summer. I have not run extendfs yet as I haven't been able to get the downtime needed...

Thanks,
Rob
7 REPLIES 7
John Poff
Honored Contributor

Re: lvextend on mirrored lv

Hi,

You should be able to do a 'lvreduce -m 1 lv_path pv_path' and remove the mirror from the specified pv_path.

JP
Pete Randall
Outstanding Contributor

Re: lvextend on mirrored lv

lvreduce?


Pete

Pete
James R. Ferguson
Acclaimed Contributor

Re: lvextend on mirrored lv

Rob:

Simply 'lvreduce' the mirror you don't want:

# lvreduce -m 0 /dev/vgXX/lvolX /dev/dsk/cXtYdZ

By providing the pv_path you control the mirror copy you want to eliminate.

Regards!

...JRF...

Bruno Vidal
Respected Contributor

Re: lvextend on mirrored lv

Hi,
If you didn't yet done the extendfs, you are not yet dead. You can still do the lvreduce. Because lvreduce will remove the PE beginning by the last, if you reduce to exactly the same size than before your lvextend, you will loose nothing, and so you can extend on the specific disk you want by using: lvextend -L new_size lv_name /dev/dsk/cXtYdZ.

Cheers.
Massimo Bianchi
Honored Contributor

Re: lvextend on mirrored lv

Hi,
here is s possible solution, but it's best if you previously do a backup:

- remove the mirror
lvextend -m 0 /dev/vgoo/lvolX /dev/dsk/WRONG_ONES

- pvmove the wrong PE from disk to disk

- re-create the mirror
- lvextend -m 1 .........


The pericolous part is the pvmove, if your server goes down in the middle... good luck.

But with this procedure you need no downtime.


And, at the end, remember also to do the fsadm/extendfs to extend your FS !!


BTW i think that shrinking is never good, althought supported in some cases.


HTH,
Massimo


Sridhar Bhaskarla
Honored Contributor

Re: lvextend on mirrored lv

Hi Rob,

System will not have any issues coming up as long as all the disks are available.

To cleanup your /usr volume, reduce the mirror first, rearrange the logical volume using pvmove onto one disk and then extend the mirror.

lvreduce -m 0 /dev/vg00/lvolx

If this logical volume is distributed across multiple disks after reducing the mirror, use 'pvmove' to put them together on a single disk. Then extend the mirror on selected disk. You can specify a disk while issuing 'lvextend -m 1' command. Look at the man pages of these commands for more information.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Bill McNAMARA_1
Honored Contributor

Re: lvextend on mirrored lv

try a pvmove.

I have just lost my long answer due to forum issues and don't want to write it all out again! so see the man!or just wait for someone else to provide more!
It works for me (tm)