|
LVM Configuration - Volume Group Creation |
|
|
|
|
Written by Tom Hirt
|
|
Wednesday, 13 May 2009 10:24 |
|
Page 3 of 6
Volume Group Creation
We are now ready to create a Volume Group (VG). A Volume group acts as a container of resources for Physical Volumes. So in other words, the total space available to a LV is created from VG's which have partitions or physical volumes (PV's) associated to them.
When a volume group is created, equally sized chucks or extents are defined. By default, a physical extent size of 4MB is used however this can be altered with a "-s PhysicalExtentSize [kKmMgGtT]" command line switch (more on that in a minute.)
We can increase or decrease the size of a LV by the addition or removal of physical extents to/from the LV. This is important as there exists some limitations on 2.4 based kernels. 2.4 based kernels have a maximum LV size is 2TB (32-bit CPUs on 2.6 kernels have a maximum LV size of 16TB and 8EB for 64-bit CPUs.) 2.4 based kernels can also only have at most 65534 extents (2.6 kernels do not have this limitation.) So the only way to reach a full 2TB LV size on a 2.4 based kernel would be with an extent size of 32MB (32 x 65534 = 2097088MB / 1024MB = 2,047GB or 2TB.)
We are now going to create a new Volume Group using a 32MB physical extent size.
- Lets begin by taking a look at the Volume Groups the are already present on the system
| [root@Linux01 ~]# vgdisplay |
| --- Volume group --- |
| VG Name |
VolGroup00 |
| System ID |
|
| Format |
lvm2 |
| Metadata Areas |
1 |
| Metadata Sequence No |
6 |
| VG Access |
read/write |
| VG Status |
resizable |
| MAX LV |
0 |
| Cur LV |
5
|
| Open LV |
5 |
| Max PV |
0 |
| Cur PV |
1 |
| Act PV |
1 |
| VG Size |
9.88 GB |
| PE Size |
32.00 MB |
| Total PE |
316 |
| Alloc PE / Size |
316 / 9.88 GB |
| Free PE / Size |
0 / 0 |
| VG UUID |
zz6pnX-TR24-jPcE-zHrv-loz5-TPd2-eERHtq |
|
- Create a new Volume Group with the name TCPDumpVolGRP using /dev/sdb1, /dev/sdc1 and /dev/sdd1 with a physical extent size of 32 MB
[root@Linux01 ~]# vgcreate TCPDumpVolGRP /dev/sdb1 /dev/sdc1 /dev/sdd1 -s 32M Volume group "TCPDumpVolGRP" successfully created [root@Linux01 ~]#
|
- Verfiy the Volume Group was created successfully
| [root@Linu01 ~]# vgdisplay |
| --- Volume group --- |
| VG Name |
TCPDumpVolGRP |
| System ID |
|
| Format |
lvm2 |
| Metadata Areas |
3 |
| Metadata Sequence No |
1 |
| VG Access |
read/write |
| VG Status |
resizable |
| MAX LV |
0 |
| Cur LV |
0
|
| Open LV |
0 |
| Max PV |
0 |
| Cur PV |
3 |
| Act PV |
3 |
| VG Size |
11.91 GB |
| PE Size |
32.00 MB |
| Total PE |
381 |
| Alloc PE / Size |
0 / 0 |
| Free PE / Size |
381 / 11.91 GB |
| VG UUID |
9fWFIS-vDlg-xOW6-Xmb8-Tkrg-GPZw-ZnUZwh |
|
| --- Volume group --- |
| VG Name |
VolGroup00 |
| System ID |
|
| Format |
lvm2 |
| Metadata Areas |
1 |
| Metadata Sequence No |
6 |
| VG Access |
read/write |
| VG Status |
resizable |
| MAX LV |
0 |
| Cur LV |
5
|
| Open LV |
5 |
| Max PV |
0 |
| Cur PV |
1 |
| Act PV |
1 |
| VG Size |
9.88 GB |
| PE Size |
32.00 MB |
| Total PE |
316 |
| Alloc PE / Size |
316 / 9.88 GB |
| Free PE / Size |
0 / 0 |
| VG UUID |
zz6pnX-TR24-jPcE-zHrv-loz5-TPd2-eERHtq |
|
|
|
Last Updated on Tuesday, 02 June 2009 10:15 |