Windows虚拟机中,将C盘进行压缩卷操作时提示无法完成操作

LU Yajun 100 信誉分
2025-09-15T01:16:28.67+00:00

你好,

我这里有一台Windows server 2019虚拟机,在对C盘进行压缩卷时,出现以下提示

Disk

目前C盘的空间是

Disk 1

重启服务器之后,仍无法完成操作,请教一下如何解决

Windows 商业版 | Windows Server | 设备和部署 | 设置、安装或升级
0 个注释 无注释
{count} 票

1 个答案

排序依据: 非常有帮助
  1. Henry Mai 6,675 信誉分 独立顾问
    2025-09-15T03:03:10.51+00:00

    Hello LU Yajun, I am Henry and I want to help you with this issue.

    The error "There is not enough space available on the disk(s) to complete this operation" when shrinking C: in Windows Server 2019 usually happens because of unmovable files at the end of the volume (pagefile.sys, hiberfil.sys, shadow copies, MFT records), not because of actual free space shortage.

    Here are the steps you can take to resolve this issue:

    1. Disable System Restore and Shadow Copies (Temporarily):

    These can create unmovable files.

    • Disable System Restore:
      • Right-click on "This PC" > "Properties" > "System protection".
      • Select your C: drive and click "Configure".
      • Select "Disable system protection" and click "Apply" and "OK".
    • Disable Volume Shadow Copies:
      • Open an elevated Command Prompt.
      • Type vssadmin list shadows to see if there are any shadow copies.
      • To delete them, type vssadmin delete shadows /for=C: /all.
      • You can also disable the "Volume Shadow Copy" service in services.msc temporarily, but disabling System Protection usually handles this.

    2. Disable Hibernation (if enabled):

    The hiberfil.sys file is also unmovable. Virtual machines typically don't use hibernation, but it's worth checking.

    • Open an elevated Command Prompt.
    • Type powercfg.exe /hibernate off and press Enter.

    3. Configure the Paging File (Virtual Memory)

    The page file (pagefile.sys) is a common culprit.

    • Move or Temporarily Disable:
      • Right-click on "This PC" > "Properties" > "Advanced system settings".
      • Under "Performance", click "Settings...".
      • Go to the "Advanced" tab and click "Change..." under "Virtual memory".
      • Uncheck "Automatically manage paging file size for all drives".
      • Select your C: drive.
      • You can either select "No paging file" (and click "Set"), or ideally, move it to another drive if you have one (e.g., your D: drive) by selecting D: and setting a custom size, then setting C: to "No paging file".
      • Click "Set" and "OK". You will be prompted to restart. Restart your VM..

    4. Perform a Disk Defragmentation/Optimization:

    While modern SSDs don't need defragmentation, an "optimization" can help consolidate files. Even for HDDs, this can help move files.

    • Open "Defragment and Optimize Drives" (search for it in the Start Menu).
    • Select your C: drive and click "Optimize".

    5. Clean Up Disk:

    Remove temporary files that might be contributing to fragmentation.

    • Right-click C: drive > "Properties" > "Disk Cleanup".
    • Click "Clean up system files" and select everything you're comfortable deleting.

    After performing these steps (especially steps 1-3 and a restart):

    • Try shrinking the volume again using Disk Management.

    Important Note after Shrinking:

    Once you've successfully shrunk the C: drive and created unallocated space, remember to re-enable System Restore, re-configure your paging file back to "System managed size" on C: drive (or your preferred setting), and re-enable hibernation if you use it.

    I hope this information is helpful.


你的答案

提问者可以将答案标记为“已接受”,版主可以将答案标记为“已推荐”,这有助于用户了解答案是否解决了提问者的问题。