• This email address is being protected from spambots. You need JavaScript enabled to view it.

    Recent items


Saturday, 23 November 2013 13:48

Resize VHD free space

Many thanks to This email address is being protected from spambots. You need JavaScript enabled to view it. for the solution of the problem.

If you are working with SharePoint and if you are developing by virtual machine then probably you may think to use a SSD (mine 128gb) to contain the VHD file and speedup your work. This is my case but the VHD dynamic expansion causes this

The principal problem is the impossibility to start up the virtual machine because it gives me a critical error and i cannot fix this problem (probably deleting some big files) internally.

Then I found this solution to resize and compact the VHD:

  • Start CMD as administrator
  • Prompt:diskpart
  • select vdisk file=<your drive>:\<your path>\<filename>.vhd   (ex. F:\MyVM\win8.vhd)attach vdisk readonly
  • compact vdisk
  • detach vdisk

Good. After this, the vhd size is passed from 110gb to 109.6gb. Not a good result, but I re-launched the VM and it was started. Just the time to find and delete some big files (first of all old content db). I repeated the step to reduce the size of VHD and

Enjoy it! Risatona

Published in SharePoint

I recently upgraded my laptop to Windows 8 to take advantage of Hyper-V in the management of my virtual machines.

To get better performance using SharePoint, I bought an SSD and I moved my vhds to the new disk. At this point, I have to change the path of the VHD virtual machine settings and when Itry to do this, I got this error: "Can not add device virtual hard disk."

I tried to change the virtual hard disk file permission, but the error was alsways there.

To resolve this error, one must perform the following steps

  • Mount the VHD (double click on the file)
  • into disk management tool, put offline the disk
  • into virtual machine settings, remove the link to the old path of vhd, add a new physical hard disk and select the offline disk

Et voila, The system can manipulate the vhds on the SSD disk :D


Published in SharePoint