LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   LVM manager - graphical (https://www.linuxquestions.org/questions/linux-software-2/lvm-manager-graphical-934846/)

Nick_C 03-16-2012 03:43 PM

LVM manager - graphical
 
Anyone know of a graphical LVM manager that allows resizing and moving of mounted LVM volumes?

I understood it was a good idea to create an LVM Volume Group with a seperate Volume for each Linux part; /boot, /root, /tmp etc. I understood that putting everything under a Volume Group was good practice and would make for ease of future maintainence, I am beginning to think that might actually not be the case.

Unfortunately I have not allowed enough space for my /usr partition which is now nearly full. I would like to expand it, but first need to contract the size of the adjacent partitions. I have found system-config-lvm but as far as I can see that only allows adding and removing partitions not resizing them.

Thanks,
Nick

tommylovell 03-17-2012 12:09 AM

Quote:

Anyone know of a graphical LVM manager that allows resizing and moving of mounted LVM volumes?
I don't know of one I like, but since no one has responded yet, I can give some command line guidance. LVM is actually pretty simple and much more flexible than partitions.

Quote:

I understood it was a good idea to create an LVM Volume Group with a seperate Volume for each Linux part; /boot, /root, /tmp etc.
In general that is true, but there is also something to be said for simplicity...

Quote:

I would like to expand it, but first need to contract the size of the adjacent partitions.
Are you talking about the real partitions adjacent to the partition that is your LVM Physical Volume? That's not LVM resizing.

But if you are talking about the other LVM Logical Volumes in the Volume Group, that is LVM and actually the Logical Volumes are not partitions and don't necessarily need to be contracted.

Do you have any free space in the Volume group? Open a command window and issue a 'vgs' command.
How is your /usr filesystem formatted? (A "mount | grep '/usr '" will tell you if you don't remember.)

(Note: all of these commands need root authority, so you either need to 'su -l root' first, or preceed each command with 'sudo'.)

Quote:

I have found system-config-lvm but as far as I can see that only allows adding and removing partitions not resizing them.
You'd be better off using the command line.

You don't say in your profile or your post what distro you are on, but if you have Red Hat/Centos/Fedora it's relatively straightforward.

Assuming one of those distros; assuming that you want to expand /usr by 512MB; assuming there is that much free space in the VG; and assuming for this example that the VG is named VolGroup00, and the Logical Volume is named usrLV. Just do this from the command line.
Code:

lvresize -L+512M /dev/mapper/VolGroup00-usrLV
resize2fs /dev/mapper/VolGroup00-usrLV

If you don't have the space in the VG, it's a little more complicated, but not impossible. You need to bring the system up in rescue mode; 'resize2fs' one or more other filesystems down in size; 'lvresize' it or them down in size; then do the above procedure. Sounds complicated but much easier than doing real partitions.

Nick_C 03-17-2012 06:27 AM

Hi Tommy, thanks for your reply.

Quote:

Originally Posted by tommylovell (Post 4628896)
Are you talking about the real partitions adjacent to the partition that is your LVM Physical Volume? That's not LVM resizing.

No just the volumes within the LVM physical volume, there should be easily enough space within the whole LVM volume group to juggle the sizes of the individual LVM volumes.


Quote:

Do you have any free space in the Volume group? Open a command window and issue a 'vgs' command.
Yes a small amount of space but really need to contract those volumes which are oversized to free up more space.

Quote:

How is your /usr filesystem formatted? (A "mount | grep '/usr '" will tell you if you don't remember.)
ext4


Quote:

You don't say in your profile or your post what distro you are on, but if you have Red Hat/Centos/Fedora it's relatively straightforward.
No thats because over the past couple of months I have tried installing everything from Arch to Ubuntu. This is on Debian.

Quote:

If you don't have the space in the VG, it's a little more complicated, but not impossible. You need to bring the system up in rescue mode; 'resize2fs' one or more other filesystems down in size; 'lvresize' it or them down in size; then do the above procedure. Sounds complicated but much easier than doing real partitions.
Rescue mode - that was the bit I didn't know I needed to do. Thanks for the info, will try doing it as you suggest.

chrism01 03-18-2012 07:49 PM

You may find these links useful http://tldp.org/HOWTO/LVM-HOWTO/ http://sunoano.name/ws/public_xhtml/lvm.html at some point.

Nick_C 03-20-2012 07:38 AM

Thanks tommy and chris, logical volumes all resized now.

Cheers,
Nick

tommylovell 03-20-2012 07:53 AM

Quote:

Originally Posted by Nick_C (Post 4631487)
...logical volumes all resized now.

Good to hear that. Don't give up on LVM. Once you get used to it, it does make life easier.

Now if we could only get the ext2/3/4 filesystem maintainers to change resize2fs so that it could downsize a mounted filesystem... (not that I'm complaining, as I neither have the time nor expertise to do something like that...)


All times are GMT -5. The time now is 06:33 AM.