locked
Disk2vhd | P2V Migration -> How to get rid of the unallocated disk space RRS feed

  • Pergunta

  • Hi,

    how to get rid of this one?

    Thanks,

    Magnus



    • Editado Magnus-S domingo, 7 de outubro de 2018 20:23
    domingo, 7 de outubro de 2018 20:21

Respostas

Todas as Respostas

  • Hi,

    You can shrink the VHDX disk by following the steps below:

    1. Shut down the virtual machine.

    2. Open up a Windows Power Shell (Administrator) and first check the VHDX disk status by typing the following command:

    Get-VHD -Path "Path to your VHDX disk"


    You should see a similar result like in the screenshot below:

    3. Now if the MinimumSize is smaller than the Size, you should be able to shrink the VHDX disk.

    4. To shrink the VHDX disk, type the following command:

    Resize-VHD -Path "G:\Hyper-V\WIN10PRO\Virtual Hard Disks\Win10_C.vhdx" -ToMinimumSize

    5. Now type the same command as you did in Step 2, to verify if the VHDX disk got shrinked.

    Get-VHD -Path "Path to your VHDX disk"


    Best regards,
    Leon


    Blog: https://thesystemcenterblog.com LinkedIn:


    • Editado Leon Laude domingo, 14 de outubro de 2018 00:35 corrected
    segunda-feira, 8 de outubro de 2018 00:47
  • Hi Leon,

    thank you but this one does not work as you can see here:

    Magnus

    domingo, 14 de outubro de 2018 00:21
  • Sorry, I didn't pay enough attention to your first screenshot, you need the unallocated disk space at the end of the disk inside the virtual machine or you cannot shrink the VHDX at all.

    Blog: https://thesystemcenterblog.com LinkedIn:

    domingo, 14 de outubro de 2018 00:37
  • Hey,

    this is a statement but no solution -> there must be a way to fix this one -> cannot is no option.

    Magnus

    terça-feira, 16 de outubro de 2018 21:45
  • Unless you have the possibility to copy everything from the "DATA (D:)" partition to somewhere else, then delete the DATA (D:) partition and then re-create it, the last option is to use third party tools.

    There is for example GParted tool which is an open source tool, below you can find a guide on how to fix virtual disk resizing issues with GParted:

    https://blog.workinghardinit.work/2016/08/16/fix-virtual-disk-resizing-issues-with-gparted/


    Blog: https://thesystemcenterblog.com LinkedIn:

    • Marcado como Resposta Magnus-S sábado, 20 de outubro de 2018 22:20
    terça-feira, 16 de outubro de 2018 22:07
  • Hi Leon,

    GParted worked like a charm, thanks a lot for your suppport.

    Magnus

    sábado, 20 de outubro de 2018 22:20
  • Glad to hear you worked it out!

    Blog: https://thesystemcenterblog.com LinkedIn:

    sábado, 20 de outubro de 2018 22:21