4

I am trying to extend a volume, let's call it /dev/vol1. I see the initial volume size is 500MB when I call:

df --block-size=M /dev/vol1

then to extend it 100MB more I call:

lvextend -L+100M /dev/vol1
resize2fs /dev/vol1

but when I check the size again with

df --block-size=M /dev/vol1

I get back 595, indicating only 95 MB were gained. What accounts for this discrepancy? I think it has to do with a MB being 1024 vs 1000 KB, but I'm not sure how where the problem is.

Garrett Hall
  • 5,121
  • 5
  • 19
  • 12

2 Answers2

4

Try using lvscan or lvdisplay or lvs to see the actual details of a logical volume.

df -h reports with M = 1,048,576 bytes.

df -H reports with M = 1,000,000 bytes.

bsd
  • 10,916
  • 4
  • 30
  • 38
4

When you specify a size for LVM utilities, capital letters denote decimal units (K=1000, M=1000000, etc.) while lowercase letters denote binary units (k=1024, m=1048576, etc.). This is mentioned in the pvs, vgs and lvs man pages but not in the man pages for other commands that take a size argument. You extended the volume by 100,000,000 bytes ≈ 95MiB.

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175