Resize LVM volumes

copymaster

Member
Nov 25, 2009
183
0
16
Hi guys
i hope i can soon stop penetrating you with my stupid questions but the most of my problems were solved by you so far.

As you know i have a proxmox cluster which i now will reinstall again to solve the input/ouput errors i had.

But when i use ISCSI as a lvm base i come around the question:

What about resizing lvm volumes? When i resize a lvm volume on the console with the command lvresize, i realize that the lvm line in the Storage part of the webinterface is correct, but the vm which is located in this lvm still shows up the whole size?

What do i have to do to make the vm recognize the resized volume? a reboot didn't help and the only other option seems to be to delete the disk of the vm which is no option....


can you please help me with this issue?

Thanks
 
Hi copymaster,
in this case a reboot is not enough. You should powerdown the vm and start again - so that the bios reconize the bigger disk.
After that, you have a vm with filesystems they are not reach the lv-size due to the enlargement. Now it's depends on the os from the vm - with linux you can online resize the filesystem (first fdisk - change partitionsize, then reboot again).
But for this jobs are good boot-cds available (partition-magic).

Udo
 
ok, thats ok for the case that one wants only to enlarge the lvm volume. But what about SHRINKING?

i have an iscsi volume (150GB) and an LVM on top of it (full 150 GB). now i installed a w2k3 on it and want to DOWNSIZE it to 50 GB.

with the lvresize i can do that but what about the vm?

am i right that i have to shrink the filesystem WITHIN the vm first with partition magic, and THEN use lvresize on the clusternode?
 
am i right that i have to shrink the filesystem WITHIN the vm first with partition magic, and THEN use lvresize on the clusternode?

Yes, but shrinking is dangerous because it is easy to make mistakes an overwrite data. So always make a backup first an be careful.