1

I used lvextend to increase my logical volume from 1 physical drive to 3. This seemed to go fine:

$ sudo pvs
  PV         VG   Fmt  Attr PSize   PFree
  /dev/nbd1  dbvg lvm2 a--  139.70g    0
  /dev/nbd2  dbvg lvm2 a--  139.70g    0
  /dev/nbd3  dbvg lvm2 a--  139.70g    0
$ sudo vgs
  VG   #PV #LV #SN Attr   VSize   VFree
  dbvg   3   1   0 wz--n- 419.09g    0
$ sudo lvs
  LV   VG   Attr       LSize 
  dblv dbvg -wi-ao---- 419.09g

Until I actually mounted the device and tried df -h:

$ sudo mount /dev/dbvg/dblv /mnt/virtual
$ df -h
Filesystem             Size  Used Avail Use% Mounted on
...
/dev/mapper/dbvg-dblv  138G  122G   15G  90% /mnt/virtual

It seems like the mount only uses one of the disks (or something is cached and hasn't been updated yet), but why? What can I do to fix this?

6

Did you pass the -r (or --resizefs) option to lvextend? If not, you need to take an extra step.

By default lvextend will extend the LV, but will leave the file system contained within that LV untouched. The file system is what you mount and what df reports the size of.

You have to manually extend the file system to make it aware the underlying device has grown.

The way to extend it will vary depending on the actual file system; e.g. for ext2/ext3/ext4 the tool to use is resize2fs, for xfs the tool is xfs_growfs, etc.

Some file systems will allow online resizes while others will require you to unmount them beforehand.

  • Yep, I forgot to pass -r, so I just had to do resize2fs, so this was the solution! Thank you very much! – CBenni Jun 3 '17 at 11:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.