I configured LVM on a 12TB device with 1 partition. I then tried to extend the LVM across a second 12TB device with 1 partition. vgextend worked, but lvextend doesn't see the space on the second device.
Here's how I partitioned the second device:
# parted /dev/mapper/3600a09803830304d2f2b456f61565846
GNU Parted 2.1
Using /dev/mapper/3600a09803830304d2f2b456f61565846
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel gpt
(parted) mkpart primary xfs 0% 100%
(parted) set 1 lvm on
(parted) print
Model: Linux device-mapper (multipath) (dm)
Disk /dev/mapper/3600a09803830304d2f2b456f61565846: 12.9TB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Number Start End Size File system Name Flags
1 1049kB 12.9TB 12.9TB primary lvm
(parted) quit
Information: You may need to update /etc/fstab.
Extending the volume group worked:
# vgextend datalake /dev/mapper/3600a09803830304d2f2b456f61565846p1
Physical volume "/dev/mapper/3600a09803830304d2f2b456f61565846p1" successfully created
Volume group "datalake" successfully extended
Extending the logical volume did not work:
# lvextend -l100%FREE /dev/datalake/volume
New size (3071999 extents) matches existing size (3071999 extents)
Run `lvextend --help' for more information.
I tried running xfs_growfs after, but the filesystem remained the same size:
# xfs_growfs /datalake
meta-data=/dev/mapper/datalake-volume isize=256 agcount=32, agsize=98303967 blks
= sectsz=512 attr=2, projid32bit=0
data = bsize=4096 blocks=3145726944, imaxpct=5
= sunit=1 swidth=16 blks
naming =version 2 bsize=4096 ascii-ci=0
log =internal bsize=4096 blocks=521728, version=2
= sectsz=512 sunit=1 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
It should see 24T of space, but it only sees 12T:
# df -h /datalake
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/datalake-volume
12T 34M 12T 1% /datalake
Output of pvs for this volume group:
# pvs
PV VG Fmt Attr PSize PFree
/dev/mapper/3600a09803830304d2f2b456f61565846p1 datalake lvm2 a-- 11.72t 11.72t
/dev/mapper/3600a09803830304e2f5d464474527471p1 datalake lvm2 a-- 11.72t 0
Output of vgs for this volume group:
# vgs
VG #PV #LV #SN Attr VSize VFree
datalake 2 1 0 wz--n- 23.44t 11.72t
Output of lvs for this volume group:
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
volume datalake -wi-ao---- 11.72t
How do I extend the logical volume to the full 24TB?
When you use
lvextend
orlvresize
, you need to use the+
or specify more space or extend that was allocated for your lvm volumeexample:
or without
+
I prefer to use first method, because in this way I don't need to know the number of allocated extends and the new extends.