Skip to content

            Lost ?  |  Need an account:
 
Home >> Knowledge Base >> Operating Systems >> Linux >> LVM Configuration - Volume Group Creation
LVM Configuration - Volume Group Creation PDF Print E-mail
(11 votes, average 4.27 out of 5)
Written by Tom Hirt   
Wednesday, 13 May 2009 10:24
Article Index
LVM Configuration
Physical Volume Creation
Volume Group Creation
Logical Volume Creation
Formatting a File System
Mounting a File System
All Pages

 

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.

  1. 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

  2. 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 ~]#

  3. 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




Comments
Add New Search
Kartik Suryanarayanan  - Nice LVM artcile. |11/07/2009 04:56:00
HI,

It was a nicely written LVM configuration article. For me it was the part , where it was show how to change the PE size used for a VG.

Thanks a lot :-)

--Kartik S
thirt |15/07/2009 18:00:58
Hi Kartik,

Thanks for the feedback! Keep it coming. If you have any requests, post them in the forums area and we’ll get to them when we get sometime.

Regards,
Tom
Wojtek J |17/09/2009 08:08:30
Hello,
Same remark as my predecessor. The helpful info was PE size switch "-s".
However, the dark colour of the backgrouung is somehow painful ;-)
Wojtek
Anonymous |27/03/2011 23:20:58
plz give information about volume group and physical volumes
Ajay Sharma  - LINUX tutorial |27/03/2011 23:23:37
plz revert me through my mail
MD Shamim Akhtar  - Disk /dev/sdb doesn't contain a valid partition t |29/03/2011 01:39:35
Dear Sir,

I want to know what does it mean by this line, please make me understand.

"Disk /dev/sdb doesn't contain a valid partition table"

SAS |15/09/2011 01:47:31
It simply means that devices /dev/sdb, /dev/sdc and /dev/sdd don't have any partitions on them _yet_.
Partitions are added to the disks in steps 2 and forward.
Anonymous |02/05/2011 10:48:33
hi

Its good 8)
Anonymous |07/03/2012 01:02:11
nice but the main part is missing
nelson |31/03/2012 03:18:43
hi, love it, it rally helped me well done well done and well done man.
hi I'm chanthorn |17/05/2012 20:43:07
U can add more information in this configure .
But this configure can accept ok.
thanks,
Write comment
Name:
Email:
 
Website:
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
 
:D:):(:0:shock::confused:8):lol::x:P:oops::cry::evil::twisted::roll::wink::!::?::idea::arrow:
 
Please input the anti-spam code that you can read in the image.

!joomlacomment 4.0 Copyright (C) 2009 Compojoom.com . All rights reserved."

Last Updated on Tuesday, 02 June 2009 10:15
 

Forum Activity

Author: Cogterrit
May.18.12
Author: Cogterrit
May.18.12
Author: Cogterrit
May.18.12
Author: Cogterrit
May.17.12

Online Stats

Guests Online: 81
Members Online: 1