LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   LVM question (https://www.linuxquestions.org/questions/linux-server-73/lvm-question-622500/)

tom.bokman@mcwa.com 02-20-2008 08:42 AM

LVM question
 
I'm new to linux so this might be a dumb question. I've installed RHEL5 on VMware ESX 3.0 server. According to LVM, I have one physical disk with one Volume group and 2 logical volumes. I added a second disk drive using VMware and it shows up fine in LVM. My question is how do I make this new drive part of the Volume group so when I open the filesystem it will show more free space available due to the additional hard drive. Yes, I know how the use VMware to expand the size of the first drive but I also want to know how to do it with LVM. Thanks in advance for your help.

Tom

Deleriux 02-20-2008 10:19 AM

Code:

pvcreate /dev/sdx0
vgextend Volume_Group_Name /dev/sdx0
lvextend --size +10G Volume_Group_Name/Logical_Volume_Name #provides extra 10 gigs out of new pool size. OR
lvextend --extents 90%FREE Volume_Group_Name/Logical_Volume_Name #makes the logical volume size 90% the size of the volume grolup

#(assuming filesystem is ext) and you did a fsck.
resize2fs /dev/mapper/Volume_Group_Name/Logical_Volume_Name

Note: sometimes you cannot assign all the extents as the logical volume has been set to using contiguous extents - you can turn this off although you lose file system performance from doing so. To turn it off.
Code:

lvchange -C n Volume_Group_Name/Logical_Volume_Name
#if you turn it off its unlikely you can set it back.


tom.bokman@mcwa.com 02-20-2008 12:29 PM

That works really nice!! Thanks for your help!!!!!!!!!

Tom

Micro420 02-20-2008 02:19 PM

you can also use system-config-lvm. It's all graphical


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