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 06-21-2012, 03: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, 03:10 PM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693Reputation: 1693
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, 03: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, 06:59 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 20,952

Rep: Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073Reputation: 4073
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, 07:45 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,308

Rep: Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744Reputation: 2744
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, 09:27 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,772

Rep: Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599
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 09:29 PM.
 
Old 06-22-2012, 01: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 06:23 AM
How to edit a logical volume size that is mounted to / linux-who? Linux - Enterprise 5 07-30-2009 12:13 PM
creating logical volume of exact specified size devkpict Linux - Software 1 07-16-2009 03:59 AM
extent size of a logical volume tajamari Linux - Server 0 02-24-2009 04:53 AM
Logical volume size growing SKVDurai Linux - Server 3 08-06-2008 09:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:32 PM.

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
Open Source Consulting | Domain Registration