[linux-lvm] Max logical volume size 1TB or 2TB?

Heinz J. Mauelshagen Mauelshagen at sistina.com
Thu May 10 19:02:53 UTC 2001


Wasn't able do diff out Andrews factor of 2 in his mail.

Anyway: Andreas is right, because the pv_size member is type
        defined unsigned int.

Regards,
Heinz    -- The LVM Guy --


On Thu, May 10, 2001 at 12:33:37AM -0600, Andreas Dilger wrote:
> Andrew Patterson writes:
> > I patched LVM 0.9.1_beta7 lvm.h source a little to get past the system
> > defined limits.
> > 
> > These are the changes I made:
> > 
> > #define LVM_LV_SIZE_MAX(a)      ( ( long long) LVM_PE_T_MAX * (a)->pe_size > ( 
> > long long) 1024*1024/SECTOR_SIZE*1024*1024*2 ? ( long long) 
> > 1024*1024/SECTOR_SIZE*1024*1024*2 : ( long long) LVM_PE_T_MAX * (a)->pe_size)
> >
> > #define LVM_MAX_SIZE            ( 1024LU * 1024 / SECTOR_SIZE * 1024 * 1024*2)
> 
> I presume the originals should not have the *2 on them?
> 
> > goes to:
> > 
> > #define LVM_LV_SIZE_MAX(a)      ( ( long long) LVM_PE_T_MAX * (a)->pe_size > ( 
> > long long) 1024*1024/SECTOR_SIZE*1024*1024*2 ? ( long long) 
> > 1024*1024/SECTOR_SIZE*1024*1024*2 : ( long long) LVM_PE_T_MAX * (a)->pe_size)
> > 
> > #define LVM_MAX_SIZE            ( 1024LU * 1024 / SECTOR_SIZE * 1024 * 1024*2)
> 
> You probably want to go to something like (i.e. slightly less than 2GB):
> 
> #define LVM_LV_SIZE_MAX(a)      ( ( long long) LVM_PE_T_MAX * (a)->pe_size > ( 
> long long) 1024*1024/SECTOR_SIZE*1024*2047 ? ( long long) 
> 1024*1024/SECTOR_SIZE*1024*2047 : ( long long) LVM_PE_T_MAX * (a)->pe_size)
> 
> #define LVM_MAX_SIZE            ( 1024LU * 1024 / SECTOR_SIZE * 1024 * 2047)
> 
> The reason is that since we are talking about 512-byte sectors here, your
> original values are exactly 2^32, so this is probably overflowing a 32-bit
> value somewhere.  Since the Linux block layer limits you to 2TB anyways,
> it is not a real issue for the LVM limit to be slightly less than 2TB.
> How much less depends on how many more disks you have...  Probably any
> value <= 2^32-1 should be OK.
> 
> Cheers, Andreas
> -- 
> Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
>                  \  would they cancel out, leaving him still hungry?"
> http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert
> _______________________________________________
> linux-lvm mailing list
> linux-lvm at sistina.com
> http://lists.sistina.com/mailman/listinfo/linux-lvm

*** Software bugs are stupid.
    Nevertheless it needs not so stupid people to solve them ***

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Heinz Mauelshagen                                 Sistina Software Inc.
Senior Consultant/Developer                       Am Sonnenhang 11
                                                  56242 Marienrachdorf
                                                  Germany
Mauelshagen at Sistina.com                           +49 2626 141200
                                                       FAX 924446
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-



More information about the linux-lvm mailing list