Operating System - HP-UX
1833389 Members
3035 Online
110052 Solutions
New Discussion

How to extend a mirror LV

 
Elder Silva_1
Occasional Contributor

How to extend a mirror LV

Hi,

I want to extend a mirror LV from 3.008G to 5G.

but how?

Current:

LV Name /dev/vg00/lvsybdr
VG Name /dev/vg00
LV Permission read/write
LV Status available/syncd
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 3008
Current LE 94
Allocated PE 188
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation strict
IO Timeout (Seconds) default


Thanks,
7 REPLIES 7
nanan
Trusted Contributor

Re: How to extend a mirror LV

Hi Elder
you can extend lvol with lvextend command

lvextend -L 5000 /dev/vg00/lcsybdr
and you have to reflect the changed suze to Filesystem mounted

there are two ways
It depends on whether your system is installed OnlineJFS or not.

If be OnlineJFS
you can extend filesystem size on line
with fsadm_vxfs -F vxfs -b 5000M

If not OnlineJFS
you have to umount the lvol
and extendfs -F vxfs /dev/vg00/lvsydbr
mount again

that's it

Regards
nanan
Elder Silva_1
Occasional Contributor

Re: How to extend a mirror LV

I got an error Strict allocation policy. and I still have space to extend.

lvextend -L 5000M /dev/vg00/lvsybdr
Warning: rounding up logical volume size to extent boundary at size "5024" MB.
lvextend: Not enough free physical extents available.
Logical volume "/dev/vg00/lvsybdr" could not be extended.
Failure possibly caused by strict allocation policy


--- Volume groups ---
VG Name /dev/vg00
VG Write Access read/write
VG Status available
Max LV 255
Cur LV 29
Open LV 29
Max PV 16
Cur PV 2
Act PV 2
Max PE per PV 4384
VGDA 4
PE Size (Mbytes) 32
Total PE 8748
Alloc PE 8547
Free PE 201
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

Ninad_1
Honored Contributor

Re: How to extend a mirror LV

Hi,

Few things I would like to add are
1 st check in the vg if you have enough space for expansion on the disks on which mirror copies of the existing logical volume exist. If not on the same disks, do you have 2 more disks to accomodate the extra space for the mirror copies for the LV to be expanded.

Also as far as I can remember - for fsadm the -b size should be in kilobytes .

Regards,
Ninad
Ninad_1
Honored Contributor

Re: How to extend a mirror LV

Hi,

The error you are getting indicates that even though you can see Free space in VG - it is combined free space from all disks in VG, but there is not enough space on seperate disks for expanding the LV so as to have the mirror copies on seperate disks.
This is require when the allocation policy is strict - meaning - having mirror copies on seperate disks, which is obviously what you would prefer.

Please can you attach the outputs of
vgdisplay -v /dev/vg00
and
lvdisplay -v /dev/vg00/lvsybdr
| awk '/Distribution of logical volume/,/Logical extents/'

Regards,
Ninad
Elder Silva_1
Occasional Contributor

Re: How to extend a mirror LV

--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/dsk/c0t6d0 94 94
/dev/dsk/c2t6d0 94 94

--- Logical extents ---
Ninad_1
Honored Contributor

Re: How to extend a mirror LV

Hi,

I had requested for output of vgdisplay as well. Anyway. Can you check
pvdisplay /dev/dsk/c0t6d0 and
pvdisplay /dev/dsk/c2t6d0
to check if enough Free PE are available on both the disks = size by which you want to expand your LV (In your case around 2 GB free on each disk - with 32 MB PE size - each PV should have atleast 64 Free PE.)
You can paste the requested outputs here.
Also since you have only 2 disks in the vg00, if enough Free PE are not there on both the disk, you need to add disks to the vg00 to be able to extend your LV.


Regards,
Ninad
Ralph Grothe
Honored Contributor

Re: How to extend a mirror LV

Allocation policy needs to be strict for a mirror, otherwise it wouldn't make much sense.
This means that you require on each of the mirror disks as many free PEs as are needed to extend the volume to the demanded size.
What Ninad wanted you to post are the used and free extends on both of the vg00's disks.
e.g.

# vgdisplay -v vg00|sed -n '/--- Physical/,$p'
--- Physical volumes ---
PV Name /dev/dsk/c0t6d0
PV Status available
Total PE 4374
Free PE 17
Autoswitch On

PV Name /dev/dsk/c3t6d0
PV Status available
Total PE 4374
Free PE 204
Autoswitch On


Maybe you once created unmirrored volumes in vg00 when due to strict allocation policy (the default if not specified other) you presumably introduced an "asymetry" of allocated PEs.
I did it in the above example because I once created a volume to take VxFS filesystem snapshots to do online backups.
For the time of the backup there is no need for a mirrored snapshot volume.

Take the smallest of the two Free PE numbers and multiply it by the extent size.
The result must be enough to host your additional 2 GBs

e.g. in my case the largest extension I can acquire is 544 MB (not much)

# vgdisplay vg00|grep PE\ Size
PE Size (Mbytes) 32

# echo $((17*32))
544

If it's similar with your root disks then you better lvextend specifying the exact LEs with the -l switch.

e.g. if I want to add the measily remaining 17 PEs to my /opt volume I would

# LVOPT=$(mount -p|awk '$2=="/opt"{print$1}')

# LVOPTLE=$(lvdisplay $LVOPT|awk '/Current LE/{print$NF}')

# lvextend -l $(($LVOPTLE + 17)) $LVOPT

If you have OnlineJFS then you could extend the filesystem like

# fsadm -F vxfs -b $(lvdisplay $LVOPT|awk '/LV Size/{print$NF}')m /opt

Otherwise you need to unmount and use extendfs instead.



Madness, thy name is system administration