[linux-lvm] fdisk and lvs size differences

Tomasz Chmielewski mangoo at wpkg.org
Wed Jan 9 14:51:02 UTC 2008


Bryn M. Reeves schrieb:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Tomasz Chmielewski wrote:
>> Let's say I have a 500GB logical volume:
>>
>> # lvs | grep san2_data
>>   san2_data                  san1 -wi-a- 500.00G
>>
>>
>> fdisk will report a bigger number:
>>
>> # fdisk -l /dev/san1/san2_data
>>
>> Disk /dev/san1/san2_data: 536.8 GB, 536870912000 bytes
> 
> It's just units; the G in lvm's output signifies powers-of-two units,
> wheras the GB reported by fdisk is in powers-of-ten (SI units).
> 
> See the lvm man pages for a description of the units supported (lower
> case are SI, upper case are powers-of-two).

What lvm manual exactly? I didn't find anything about upper/lower case 
units supported in "man lvcreate" or "man lvm". In fact, it didn't make 
a difference here whether I used "g" or "G".

Of course, I could calculate it manually, but I'd rather have it done 
automatically.


# lvcreate -L500g -n san2_data san1
   Logical volume "san2_data" created

# fdisk -l /dev/san1/san2_data

Disk /dev/san1/san2_data: 536.8 GB, 536870912000 bytes


# lvcreate -L500G -n san2_data san1
   Logical volume "san2_data" created

# fdisk -l /dev/san1/san2_data

Disk /dev/san1/san2_data: 536.8 GB, 536870912000 bytes


# lvm version
   LVM version:     2.02.07 (2006-07-17)
   Library version: 1.02.08 (2006-07-17)
   Driver version:  4.11.0

This is on Debian Etch.



-- 
Tomasz Chmielewski
http://wpkg.org




More information about the linux-lvm mailing list