分类: LINUX
2015-06-24 08:53:05
鸟哥书中关于PE大小影响VG容量问题
书中说“每个VG最多能够支持包含65535个PE而已,如果使用LVM默认的参数,则一个VG最大可达256GB的容量”256G有点太普通了,很快都会超过这个容量,我一直想如果我安装操作系统PE值定义成多少好呢?PE定义大了对系统有影响吗?苦思冥想啊!
因为我是在rhel6.4上做实验,没有发现此问题,一直纳闷,网上度娘没有直接答案,因此将学习心得记录一下。
man了一下我系统的vgcreate,结果如下(因为是通过vgcreate -s 16M vgname /dev/sdc1指定PE大小的啊):
-s, --physicalextentsize PhysicalExtentSize[bBsSkKmMgGtTpPeE]
Sets the physical extent size on physical volumes of this volume
group. A size suffix (k for kilobytes up to t for terabytes) is
optional, megabytes is the default if no suffix is present. The
default is 4 MiB and it must be at least 1 KiB and a power of 2.
Once this value has been set, it is difficult to change it with-
out recreating the volume group which would involve backing up
and restoring data on any logical volumes. However, if no
extents need moving for the new value to apply, it can be
altered using vgchange -s.
If the volume group metadata uses lvm1 format, extents can vary
in size from 8KiB to 16GiB and there is a limit of 65534 extents
in each logical volume. The default of 4 MiB leads to a maximum
logical volume size of around 256GiB.
If the volume group metadata uses lvm2 format those restrictions
do not apply, but having a large number of extents will slow
down the tools but have no impact on I/O performance to the log-
ical volume. The smallest PE is 1KiB
The 2.4 kernel has a limitation of 2TiB per block device.
[root@localhost ~]# man lvm
LVM(8) LVM(8)
NAME
lvm - LVM2 tools(奶奶的我的是lvm2呀,linux的书一般精心写完,再发布到市场都太老了,古董啊,蹩脚的研究了一堆都是无用的东西,市面上的linux的书只能作为产考了,时不时的要多看看man了)