LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-23-2014, 10:35 AM   #1
suDoh!
LQ Newbie
 
Registered: Apr 2014
Location: Bangalore
Distribution: Precise Pangolin
Posts: 21

Rep: Reputation: Disabled
Question Creating Volume Groups using PEs?


Hi LQ,

I wanted to create a VG of 15 PEs where PE size is 8MB. So theoretically I should create a 90MB partition, format it with Linux LVM type and the create a PV on it before creating the VG with 8M chunks.

And I did that but it came up with 13 PEs instead of the forethought 15. And same happened when I tried bit larger partitions of 100|110|120 (MB) with varying number of PEs until I hit 128M when it exactly had 15 PEs.

What I want to understand is if there's any other math that I need to follow to get the exact PEs? Please can someone shed some light here.

Cheers.
 
Old 04-23-2014, 01:36 PM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 2,959

Rep: Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267
You are mixing MB (10^6) and MiB (2^20) units. Your "8MB" PE is actually 8388608 bytes, and 15 of those is 125829120 bytes. Then you have to add the 192KiB (196608 bytes) for the LVM PV header, so the total space needed is 126025728 bytes.

Your partitioning tool (Which one?) is probably using power-of-10 sizes for the partitions and then rounding that to the next MiB, so by that calculation you would to ask for 126MB or 127MB as the partition size.
 
Old 04-23-2014, 01:54 PM   #3
suDoh!
LQ Newbie
 
Registered: Apr 2014
Location: Bangalore
Distribution: Precise Pangolin
Posts: 21

Original Poster
Rep: Reputation: Disabled
I am using fdisk which is the default in RHEL.. and I do agree that the size is being converted to MiB so question is do I always have to convert the chunks into MiB (i.e. chunk_size*1048576) to determine the exact size and then multiply with the chunks I need in the VG. I.e., 8*1048576*15=125829120

Please could you also clarify that part about 192 KiB (196608 B) LVM PV header.. what kind of header is this and why are we adding this up to the value above? Sorry about being naive here but would appreciate an answer on this.

Cheers.
 
Old 04-23-2014, 08:37 PM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 2,959

Rep: Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267Reputation: 1267
An LVM physical volume begins with a header that identifies it as an LVM volume and contains space for the metadata that describes each of the logical volumes it contains. By default, 192KiB is reserved for this header. The files in /etc/lvm/backup are a textual representation of that metadata. For each physical volume in a VG you will see "pe_start =" giving the LBA offset where the extents begin and "pe_count =" giving the total number of extents available in that PV. Typically pe_start will be 384, which is an offset of 192KiB.

You can find some additional information at https://access.redhat.com/site/docum...omponents.html and https://access.redhat.com/site/docum..._metadata.html.
 
Old 04-24-2014, 05:47 AM   #5
suDoh!
LQ Newbie
 
Registered: Apr 2014
Location: Bangalore
Distribution: Precise Pangolin
Posts: 21

Original Poster
Rep: Reputation: Disabled
Thumbs up

Thanks for clarifying!

Cheers.
 
  


Reply

Tags
lvm


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
creating volume groups cbtshare Linux - Newbie 5 03-21-2013 01:30 AM
Volume Groups and LUN's Linux_Kidd Linux - Server 2 11-08-2012 10:11 PM
differentiating Volume Groups Vanyel Linux - Server 1 07-01-2009 02:09 PM
No volume groups found jawad512 Linux - Newbie 7 01-01-2009 08:52 PM
Logical Volume Groups concoran Linux - General 3 06-03-2001 07:29 AM


All times are GMT -5. The time now is 10:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration