Walker News

Maximum Size Of A Logical Volume In LVM

What is the maximum size of a single logical volume (LV) in Linux Logical Volume Manager or LVM? How to resize or change LVM PE size of an existing volume group or VG dynamically?

Most probably you’re here because you’re googling these similar LVM FAQ. Hopefully these are the answers!

The physical extent size (PE size) of a LVM volume group (VG) is fixed upon the creation of VG. In Linux command line, the -s option switch of vgcreate command is to explicitly set the physical extent size (PE size) on physical volumes (PV) of the volume group (VG).

PE size is defaulted to 4MB if it’s not set explicitly. However, once this value has been set, it’s not possible to change a PE size without recreating the volume group which would involve backing up and restoring data on any logical volumes!
As far as LVM2 is concerned – LVM version 2.02.06 (2006-05-12), Library version 1.02.07 (2006-05-11), Driver version 4.5.0 – there is no LVM commands or utilities, not even the vgmodify in HPUX, to resize or change the LVM PE size of an existing VG dynamically or in online mode!

So, it’s recommended to properly plan ahead before creating a LVM volume group. For example, if the logical volume will store database tables where the database size will likely grow up to more than 300G in near future, you should have not created a volume group with the default PE size of 4MB!

A visualized concept diagram of the Linux Logical Volume Manager or LVM.

What’s the maximum size of a logical volume in Linux LVM?
Why there is a limitation on maximum size of logical volume?

In order to limit the Linux kernel memory usage, there is a limit of 65,536 physical extents (PE) per logical volume (LV). Hence, the LVM PE size will directly determine the maximum size of a logical volume (LV)! For example, 4MB PE size (the default PE size) will limit single logical volume (LV) to 256GB, 16MB PE size will limit single LV to grow beyond 1TB, etc.

Beside the PE size, the maximum size of single LV is also limited by CPU architecture and Linux kernel version:
  • Linux kernel version 2.4.x limit the maximum LV size to 2TB.
     
  • Some older Linux kernel prior to 2.4.x, the maximum LV size is limited to 1TB (caused by the integer signedness problems in the block layer).
     
  • The combination of 32-bit CPU and Linux kernel version 2.6.x, the limit of logical volume size is maximized at 16TB.
     
  • For Linux kernel 2.6.x running on 64-bit CPU, the maximum LV size is 8EB (extremely terrible big storage for this time being!)

Custom Search

  1. Walker 11-07-07@10:59

    Update:

    Excerpt taken from man vgcreate of LVM v2:

    If the VG metadata uses LVM v2 format, the 65536 PE per LV restriction is not applicable. Although, having a large number of physical extents will slow down the tools, but there will be no impact on I/O performance to the logical volume.

    To check LVM meta data version used for a volume group, type vgdisplay vg0 where vg0 is the volume group identifier.

  2. Create New Linux EXT3 File System In LVM – Walker News 11-07-07@17:21

    [...] This is another 3-minutes Linux guide for newbie on How to create or add new Linux EXT3 file system in Logical Volume Manager (LVM) with a new disk partition, which involves creating new logical volume (LV)? You might also interest on How to extend disk space of an existing file system in LVM, or How to configure LVM or create new volume group from command line, or Understand the maximum volume group size limitation. [...]

  3. Guevara 18-11-10@16:12

    Those limit do not apply for volume groups using lvm2 metada format.

    http://linux.die.net/man/8/vgcreate

  4. 18TB logical volume 02-12-10@12:16

    [...] error messages lead to better answers. The following might help, but is not authoratative: http://www.walkernews.net/2007/07/02…volume-in-lvm/ [...]

2014  •  Privacy Policy