reduce VMs hard drive ?

inheo

New Member
Mar 10, 2010
2
0
1
Hello,

I have a virtual machine which has disk space not allocated.
I would like if it is possible to reduce logical volume in proxmox to reduce the size of the hard drive of the virtual machine without losing data.

My VM is on KVM in raw format.

Thanks for your help :)
 
Hello,

I have a virtual machine which has disk space not allocated.
I would like if it is possible to reduce logical volume in proxmox to reduce the size of the hard drive of the virtual machine without losing data.

My VM is on KVM in raw format.

Thanks for your help :)
Hi,
you must do it byself. Like this way:
1. Backup
2. Test Backup
3. boot live-cd (with gparted) and reduce your filesystem - the free space must be on the end of the disk
4. on lvm-storage use lvreduce (leave security space) - on localstorage you can use dd and copy not the whole content (blocksize * count); rename before the original disk image and use as output-file the old name.
5. after shrinking boot a second time the live-cd and expand the filesystem (the security marge) to get all gigs ;-)
6. reboot and finish

Udo