3

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?

Leo
  • 983
  • 7
  • 21
  • 39
  • 3
    try with lvextend -l +100%FREE /dev/datalake/volume , i know this not your problem, but why you did a partition on lun? – c4f4t0r Feb 19 '15 at 22:31
  • I tend to partition before adding to LVM simply to avoid the question _What does unknown partition table mean and how do you fix it?_. –  Feb 19 '15 at 22:42
  • @c4f4t0r Thanks, that lvextend syntax worked! I'll accept if you submit it as an answer. (I'm partitioning on a LUN because that's what Consistent Performance iSCSI looks like when attached as a multipath device in the Softlayer cloud environment. I'm happy to be corrected/informed.) – Leo Feb 20 '15 at 03:07

1 Answers1

9

When you use lvextend or lvresize, you need to use the + or specify more space or extend that was allocated for your lvm volume

example:

lvextend -l +100%FREE /dev/datalake/volume

or without +

lvextend -l <total number of extends to catch up> /dev/datalake/volume

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.

c4f4t0r
  • 5,301
  • 3
  • 31
  • 42