Add new disks and expandlv

I have successfully added new physical disks with the objective to expand an exisiting logical volume. How do I add the new disks to the logical volume so I can then expand the size of the lv and ultimately the file system. The disks have been added to the related Volume Group.

Thanks

First, add the disk(s) to the volume group in question. You have already figured that out:

extendvg <VGname> <diskname>

example: extendvg myVG hdisk99

Then issue a "lsvg <VGname>" and you will see the added available PPs. These are available to expand your file systems/logical volumes.

It is possible to directly increase the FS and LVM will automatically extend the LV for you but i want more control over this process so i habitually extend the LV first and only then the FS:

extendlv [-m<mapfile>] <LVname> <NrOfPPs>
or
extendlv <LVname> <NrOfPPs> [<PVname>]

example: extendlv MyLV 5
will increase the size of MyLV by 5 times the PP size. If MyLV is mirrored a multiple of 5 PPs will be added,
depending on the number of mirrors configured.

Then expand the filesystem to make use of the additional space in the LV: first convert your PP size to 512-byte-blocks:

blocks = <nr of PPs> * 2 * <PPsize in kb>

example: PP size is 256G, 2 PPs added:

2 * 2 * 1024 * 1024 * 256 = 1073741824

Then use this number to add that many blocks to your fs:

chfs -a size=+<nr of blocks> <FS>

example: chfs -a size=+1073741824 /my/file/system

You can do all this while the system is under load, there is no need to unmount anything, let alone stop the system.

I hope this helps.

bakunin

Thank you bakunin, I really appreciate your help this is giving me a headache.

lsvg uservg01 = 2184 (559104 megabytes) PP SIZE: 256 megabyte(s)

This is a striped volume with
STRIPE WIDTH: 4
STRIPE SIZE: 32K
BACKUP MIRROR COPY: 3

If I try, for example, extendlv vol01 5. I get the following and its this I don't understand.

0516-1036 extendlv: Striped logical volume size can only be an even
multiple of the striping width.
0516-788 extendlv: Unable to extend logical volume.

I don't actually need to add the addtional hdisk*s to the LV?

Thanks

Stripe width of 4 means that the content of one Logical Partition is spread over 4 Physical Partitions. Hence you can extend the striped LV by n*4 PP only because LV (oposed to filesystems) use complete PPs. So extending by 4, 8, 12, 16 ... is ok, extending by 5,7,9 is not. Furthermore you need free PP on 4 different hdisks.

bear with me, I think I may be close to understanding this now

There are four new disks available in the VG

hdisk14 active 546 546 110..109..109..109..109
hdisk15 active 546 546 110..109..109..109..109
hdisk16 active 546 546 110..109..109..109..109
hdisk17 active 546 546 110..109..109..109..109

So if I try

extendlv vol01 4

I get

0516-404 allocp: This system cannot fulfill the allocation request.
There are not enough free partitions or not enough physical volumes
to keep strictness and satisfy allocation requests. The command
should be retried with different allocation characteristics.

Hello,

While stripping we used to mention the name of the physical volume names.
Did u added the physical names of newly added to vg(hdisk14 hdisk15 hdisk16 hdisk17) in the field of spread LV.

smitty chlv => select your lv name => check the field "PHYSICAL VOLUME names"

HTH

The LV was probably created with the default settings and therefore has its Upper Bound set to 4. If you use four more disks you need to change the LV's properties by increasing Upper Bound to at least 8 (disks) now. Use
# lslv vol01
to see LV's properties.
Change Upper Bound if necessary with
# chlv -u8 vol01

RANGE of physical volumes = maximum
MAXIMUM NUMBER of PHYSICAL VOLUMES = 8

Thanks