Resolving Disk Space Issues Due to hiberfil.sys in AWS WorkSpaces
Overview
AWS WorkSpaces, a managed virtual desktop service, may encounter disk space issues due to the hiberfil.sys
file occupying a significant amount of storage. This file is used for hibernation in Windows but is unnecessary for AWS WorkSpaces, as these instances do not support hibernation. Disabling and removing hiberfil.sys
can help reclaim disk space.
Cause of the Issue
The hiberfil.sys
file is a system-generated hidden file that stores the system state when Windows enters hibernation mode. Since AWS WorkSpaces does not utilize hibernation, this file becomes redundant and may consume several gigabytes of disk space.
Solution
Step 1: Check the Size of hiberfil.sys
Open Command Prompt as Administrator.
-
Run the following command:
dir /a C:\hiberfil.sys
Note the size of hiberfil.sys
. If it is consuming substantial disk space, proceed with the removal steps.
Step 2: Disable Hibernation
Open Command Prompt as Administrator.
-
Execute the following command to disable hibernation:
powercfg -h off
This command will disable hibernation and automatically delete hiberfil.sys
from the system drive.
Step 3: Verify Removal
-
Run the following command to check if hiberfil.sys
has been removed:
dir /a C:\
If the file is no longer listed, the process is successful.
Additional Steps: Freeing Up More Space
If disk space is still an issue, consider the following additional steps:
Conclusion
By disabling hibernation and removing hiberfil.sys
, AWS WorkSpaces users can free up significant disk space. Regular maintenance such as clearing temporary files and using Disk Cleanup can further optimize storage usage.