


The following command adds another physical volume to the volume group, which then has 135 gigabytes of additional space. # vgs VG #PV #LV #SN Attr VSize VFree vg 2 1 0 wz-n- 271.31G 0 Note that the volume group now has no more free space. # lvcreate -n stripe1 -L 271.31G -i 2 vg Using default stripesize 64.00 KB Rounding up size to full physical extent 271.31 GB Logical volume "stripe1" created# lvs -a -o +devices LV VG Attr LSize Origin Snap% Move Log Copy% Devices stripe1 vg -wi-a- 271.31G /dev/sda1(0),/dev/sdb1(0) You can create a stripe using the entire amount of space in the volume group. # vgs VG #PV #LV #SN Attr VSize VFree vg 2 0 0 wz-n- 271.31G 271.31G Instead, you must add at least two physical volumes to the volume group.įor example, consider a volume group vg that consists of two underlying physical volumes, as displayed with the following vgs command.
For example, if you have a two-way stripe that that uses up an entire volume group, adding a single physical volume to the volume group will not enable you to extend the stripe. In order to increase the size of a striped logical volume, there must be enough free space on the underlying physical volumes that make up the volume group to support the stripe. If you are not using the r option with the lvextend command to extend the LV and resize the file system with a single command, then resize the file system on the logical volume by using the following command: xfs_growfs /mnt/mnt1/meta-data= /dev/mapper/myvg-mylv isize=512 agcount=4, agsize=65536 blks = sectsz=512 attr=2, projid32bit=1 = crc=1 finobt=1, sparse=1, rmapbt=0 = reflink=1data = bsize=4096 blocks=262144, imaxpct=25 = sunit=0 swidth=0 blksnaming =version 2 bsize=4096 ascii-ci=0, ftype=1log =internal log bsize=4096 blocks=2560, version=2 = sectsz=512 sunit=0 blks, lazy-count=1realtime =none extsz=4096 blocks=0, rtextents=0data blocks changed from 262144 to 524288 You can also use this argument to specify a percentage of the volume group, or a percentage of the remaining free space in the volume group. Logical volume myvg/mylv successfully resized.Īs with the lvcreate command, you can use the -l argument of the lvextend command to specify the number of extents by which to increase the size of the logical volume. To extend the mylv logical volume to fill all of the unallocated space in the myvg volume group, use the following command: # lvextend -l +100%FREE /dev/myvg/mylv Size of logical volume myvg/mylv changed from 10.00 GiB (2560 extents) to 6.35 TiB (1665465 extents).
