Jump to content
We're Hiring! Full Stack Developer ×

Shrinking VM and moving to new drive


steve1977

Recommended Posts

I know there are many threads, but they all fell incomplete and not bullet-proof (risk losing data). I have VM on a cache drive. I would like to shrink this VM to move it to a new a smaller disk (replacing the old cache disk). Let me try to collect the steps I have seen in many threads, but would be great to get your help whether that's correct before I pursue:

 

1) Backup my VM

* Shut down the VM

* Copy the folder with .img file to the array

 

2) Shrink the VM

* "Disk Management" in Windows-10 and shrink the disk

[[ issue is that the reduced space is still in "unallocated ]]

* Stop VM and edit it. Reduce size by "unallocated" amount

[[ is that really correct to do it this way? ]]

[[ by what exact amount to change? Disk management worked in mb, while VM edits is in MB. Is it ok if it is somewhat correct? ]]

 

3) Move VM to another disk

* Stop array, remove the cache disk and include another cache disk instead

[[ is it really that easy? ]]

* Format the new cache disk and copy VM from backup to the new disk

* Start the VM again

[[ do I need to somewhat point the VM that this is somewhat different? ]]

 

 

Thanks for your help!!!

Link to comment

I went ahead, but did not succeed to shrink the image. I used disk managament in Windows (in VM) to reduce by 30GB. The reduced space shows "unallocated". I then shut down the VM and applied "qemu-img resize vdisk1.img 200G". Resizing happened, but it did give me the comment that "write operations to block 0 will be resitricted". When starting up the VM, I am getting bunch of error message and Windows does not start up.

 

Any ideas?

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...