LinuxQuestions.org
Help answer threads with 0 replies.
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 06-21-2012, 04:01 PM   #1
ohlookpie
LQ Newbie
 
Registered: Apr 2012
Posts: 20

Rep: Reputation: Disabled
Can someone explain logical volume size to me?


I don't really understand what the logical volume size does. For example, I create a physical volume from /dev/sda1 and /dev/sda2 that equals 25GB, and then I create a volume group from that, and then a 500MB logical volume. What does it mean that the logical volume is only 500MB? Am I not utilizing the entire 25GB of /dev/sda1 and /dev/sda2?
 
Old 06-21-2012, 04:10 PM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 3,774
Blog Entries: 1

Rep: Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339
Logical volumes can span accross physical hdd's.

So, if you have 2 physical drives at 1GB a piece,.. you can add them together and access them as a 2GB Logical Volume.
 
Old 06-21-2012, 04:18 PM   #3
ohlookpie
LQ Newbie
 
Registered: Apr 2012
Posts: 20

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by szboardstretcher View Post
Logical volumes can span accross physical hdd's.

So, if you have 2 physical drives at 1GB a piece,.. you can add them together and access them as a 2GB Logical Volume.
Wouldn't that just be a the vgcreate part that is joining 2 physical drives? It seems to me like the lvcreate part is creating something similar to partitions. So, if I do a lvcreate -L 4G volgroup -n blah, and my volgroup is 8GB, that means I have space that can be used to create another logical volume, or extend the first one, and so on. That's my understanding of it anyway, but I am not 100% sure that is correct. Is there any reason not to use the full amount of disk space when creating logical volumes?
 
Old 06-21-2012, 07:59 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,834

Rep: Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820Reputation: 1820
Indeed.
The lv is the analogue of a "normal" partition - both appear as block devices and can have a filesystem created on them. At which point you can write files onto them. So "lv == partition" (logically, and ignoring the possibility that pv's can be "real" partitions).
Some like to keep free space in vg's for later growth of (or new) lv's, some just add new pv to the vg as needed. Individual choice.
 
Old 06-21-2012, 08:45 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
As syg00 said. You could have a read here http://tldp.org/HOWTO/LVM-HOWTO/
 
1 members found this post helpful.
Old 06-21-2012, 10:27 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 15,374

Rep: Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198
From chrism01's link.

3.3. logical volume (LV)

The equivalent of a disk partition in a non-LVM system. The LV is visible as a standard block device; as such the LV can contain a file system (eg. /home).

So when you created the 500m it is what is reported. It is as if you created a partition out of a disk. In a common partition you can only see what part of the disk that has been utilized. The rest of the drive might later be used or what not.

I don't think this posts helps any more than others but I can't delete it.

Last edited by jefro; 06-21-2012 at 10:29 PM.
 
Old 06-22-2012, 02:45 AM   #7
ohlookpie
LQ Newbie
 
Registered: Apr 2012
Posts: 20

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by syg00 View Post
Indeed.
The lv is the analogue of a "normal" partition - both appear as block devices and can have a filesystem created on them. At which point you can write files onto them. So "lv == partition" (logically, and ignoring the possibility that pv's can be "real" partitions).
Some like to keep free space in vg's for later growth of (or new) lv's, some just add new pv to the vg as needed. Individual choice.
Thank you! I am finally figuring it out. I now see that you may want to keep some free space available for LV snapshots, growing the LV, and so on. Thanks again for the help.
 
  


Reply


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
I have spce in volume group but it can not increase the size of logical volume anis123 Linux - Newbie 14 04-16-2012 07:23 AM
How to edit a logical volume size that is mounted to / linux-who? Linux - Enterprise 5 07-30-2009 01:13 PM
creating logical volume of exact specified size devkpict Linux - Software 1 07-16-2009 04:59 AM
extent size of a logical volume tajamari Linux - Server 0 02-24-2009 05:53 AM
Logical volume size growing SKVDurai Linux - Server 3 08-06-2008 10:33 AM


All times are GMT -5. The time now is 02:42 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