Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

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.

share|improve this answer
    
Also, there is a ~1.5% difference in df space and lvs space due to the ext3 filesystem. –  Garrett Hall Jul 16 '12 at 18:50
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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