Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
On recomendation from the team installing the DB on our new server, all the partitions etc on our VM were created as LVM's. The setup for this is like this:
Disk 2
-> LVMpartition2
---> LVgroup2
------> lvlive
--------> /live
and a few more after this. Now as this is a VM we allowed a bit of extra space etc for the partitions to grow, however on Disk 2, the physical disk allocated by the VM ended up not being big enough. I thought this would be a simple matter of increasing the HDD size in the VM manager and growing the partition, then group, then volume, but I can find no way to do this after a few hours searching. I see that it would be possible to add another partition into the free space and add it too the group etc but I would rather avoid this as over the next few months this may need to grow a fair amount and I would hate to end up with 50+ partitions everytime space was needed.
There are plenty of instructions and info on how to grow and shrink volumes and groups if the physical space has already been allocated in the LVM partition but not after that.
As always any help is greatly appreciated.
-Matt
EDIT : Fdisk see's the space fine:
Disk /dev/sdc: 53.6 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 * 1 5221 41937651 8e Linux LVM
Last edited by mhouston100; 06-06-2010 at 10:38 PM.
Reason: Formatting
Distribution: openSUSE 11.2, (B)LFS, Mepis, Linux Mint 9
Posts: 30
Rep:
Hello MHouston !!
First, can you tell me which version of RHEL or Fedora (maybe) are you using ? Is it LVM1 or LVM2 ? As you said "[...]Now as this is a VM we allowed a bit of extra space etc for the partitions to grow[...]", which method did you use to add the extra space ? SAN ? adding more drives ? extending the raid ?
I'm having trouble understanding your problem. Is the problem that your physical partition has grown, but the physical volume is still the same size? If so, have you tried pvresize?
The machine is a VM which is located on the SAN (Plenty of space on the SAN at the moment). The change that I made size-wise is in the VM virtual HDD settings, increased the disk size so in essence:
Created the drive at 40 GB
Created LVM Partition 40GB
Created LVMGroup to cover whole partition
Created LV to fill whole group
Realised its supposed to be 50GB and increased the physical HDD to 50GB (through VM)
And now im stuck, obviously I can create a new partition and add that to the LVM group but this partition is likely to grow multiple times and I would rather not end up with a bunch of partitions IF there is a way to simply grow the LVM partition that is holding the group.
I have seen plenty of way to grow the groups and volumes IF the partition was created larger in the beginning, but nothing to indicate how to do what im asking.
Ok I think If have the process on what to do, i'm just waiting for the VM to clone again and getting it straight for when its complete.
From what I understand I need to :
Use fdisk to resize the actual partition to fill the physical space, this seems to be done by removing the partition and re-creating it in the same space (same start point and a later end point)
Use pvresize to resize the LVM partition
Use lvresize to resise the logical volume(s) i want to resize
fs2resize (or similar) to resize the filesystem thats to grow to the LV
Shouldnt be long for the cloning to finish and ill give it a shot!
Ok I think If have the process on what to do, i'm just waiting for the VM to clone again and getting it straight for when its complete.
From what I understand I need to :
Use fdisk to resize the actual partition to fill the physical space, this seems to be done by removing the partition and re-creating it in the same space (same start point and a later end point)
Use pvresize to resize the LVM partition
Use lvresize to resise the logical volume(s) i want to resize
fs2resize (or similar) to resize the filesystem thats to grow to the LV
Shouldnt be long for the cloning to finish and ill give it a shot!
Thanks again guys.
Yep, that should work. If you run into any problems, you might need to do some of that using a rescue disk, I'm not sure if the pvresize stuff can be done live since I've never done that before. Everything else can be done live. Also, the command is resize2fs. This is the kind of stuff that turned me onto using LVM almost exclusively, I love LVM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.