This topic describes how to handle low disk space on Windows instances and the best practices for daily disk management for Windows instances.
The methods described in this topic apply to Windows Server 2003 and later versions. Windows Server 2008 R2 is used as an example.
When you are running out of available disk space on a Windows instance, you can take the following measures:
Release disk space
You can delete files that you no longer need to free up disk space. First, find the files that are taking up the most disk space. Then, delete files that you no longer need. The steps are as follows:
Find the files that are taking up the most disk space
- Connect to a Windows instance.
- Double-click Computer on the instance desktop. Click the disk for which you want to free disk space, and then press CTRL+F to move to the search box.
- In the search box, select Size: and then select a predefined file size to filter large files.
Note You can also customize a file size range for the search. For example, enter Size: > 500 MB to search for files greater than 500 MB. Enter Size: > 100 MB < 500 MB to search for files that are between 100 MB and 500 MB in size.
Delete files that you no longer need
Delete large files that you no longer need.
We recommend that you use the Windows Disk Cleanup utility to delete unneeded files such as log files, and empty the recycle bin. The Windows Disk Cleanup utility is not installed on the instance by default and must be installed manually. Perform the following steps to install the utility and then use it to delete files:
- Open Server Manager, click Features, and then click Add Features.
- In the Add Features Wizard dialog box, select Ink and Handwriting Services and Desktop Experience and click Next.
- Click Install.
- When the system prompts you to restart the server manually, click Yes to restart the server. After the server restarts, confirm that Desktop Experience has been installed.
- After the installation is complete, choose OK. . In the dialog box that appears, select the items that you want to delete and click
Expand disk capacity
Develop good habits for using disk space with these best practices:
- Compress files for archiving
- Delete unneeded applications on a regular basis
- Configure disk monitoring
Compress files for archiving
For files that are generated on a regular basis, you can compress them for archiving to improve disk utilization. We recommend that you use WinRAR to compress files. The following example demonstrates how to configure a backup policy for compressing files:
- After installing the compression software, find the file to compress. Right-click the file and select Add to archive… from the context menu.
- In the dialog box that appears, click the Backup tab and then select Generate archive name by mask. Do not click OK.
- Click the General tab and then click Browse to specify the path in which to save the archive file. Click Profiles... and then select Save current settings to a new profile....
- In the Profile parameters dialog box, set Profile name and select Save archive name, Save selected file names, and Create shortcut on desktop. Click OK.
- In the Archive name and parameters dialog box, click OK. A shortcut to the archive file is generated on the desktop.
- Choose System and Security. In the System and Security window, click Schedule tasks. In the Task Scheduler dialog box, click Create Basic Tasks.... . Click
- In the Create Basic Task Wizard dialog box, enter a new task name and click Next.
- Select a trigger for the task and click Next. Select Start a program and click Next.
- Set the Program/script parameter on the Start a Program page. To set this parameter, find the previously generated shortcut. Right-click the shortcut and select Properties from the context menu. In the dialog box that appears, copy the value of the Target: field on the Shortcut tab.
- In the Create Basic Task Wizard dialog box, paste the copied value in Program/script on the Start a Program page. Then click Finish.
After configuring the backup policy, you can delete expired archive files on a regular basis to avoid taking up too much disk space.
Delete unneeded applications on a regular basis
You can delete unneeded applications on a regular basis by choosing Programs > Programs and Features in the Control Panel window.
Configure disk monitoring
Monitoring plug-ins are pre-installed on ECS instances. You can log on to the CloudMonitor console to create disk alert rule. By doing so, you can receive alerts when disk usage exceeds a configured threshold and clean the disk in a timely manner.