If a disk on your Windows instance is full or has insufficient space, you may experience issues such as slow system performance or application failures. This topic describes how to resolve insufficient disk space on a Windows instance and provides suggestions for routine disk maintenance.
Solutions
This topic uses Windows Server 2019 as an example. The operations may vary based on your environment.
Method 1: Free up disk space
You can resolve the issue of a full disk by deleting unnecessary files. The procedure is as follows:
Find files that use too much disk space.
Remotely connect to the Windows instance.
For more information, see Connect to a Windows instance using password authentication.
On the desktop, double-click This PC.
Click the disk that you want to clean up and press Ctrl+E.
In the top navigation bar, choose and then filter for large files based on the predefined sizes.
NoteYou can also specify a custom file size range to search for files. For example:
In the search box, enter Size: >500 MB to retrieve files on the disk that are larger than 500 MB.
In the search box, enter Size: >100 MB < 500 MB to retrieve files that are larger than 100 MB but smaller than 500 MB.
Delete unnecessary files.
Use the Windows Disk Cleanup tool to delete files and empty the Recycle Bin.
In the search bar at the bottom of the screen, enter Disk Cleanup, select the disk that you want to clean, and then click OK.
The system starts to scan the disk for files that can be deleted. This process may take some time.
Select the files that you want to delete and click OK.
Method 2: Resize the disk or purchase a new one
If you cannot delete files from the disk or free up enough space by deleting files, you can resize the disk or purchase a new data disk. For more information, see Resize a disk (Windows), Create a data disk (Linux), and Attach a data disk.
Suggestions for routine disk maintenance
Regularly compress and save files
For files that are regularly generated on the disk, you can use a compression tool, such as WinRAR, and set a compression policy to compress and save them. This helps prevent the disk from using too much space and improves disk usage.
(Conditional) If your system does not have a compression tool, download and install WinRAR. For the official download link, see WinRAR.
This example uses the Chinese version of WinRAR.
Find the file that you want to compress, right-click the file, and select Add To Archive.
Set the path for the compressed file and other parameters.
In the Archive Name And Parameters dialog box, click the Backup tab, select Generate Archive Name By Mask, and do not click OK yet.
Click the General tab, and then click Browse to define the path for the compressed file. Click Profiles, and then select Save Current Settings To A New Profile.
In the Profile Parameters dialog box, enter a Profile Name, select Save Archive Name, Save Selected File Names, and Create Shortcut On Desktop, and then click OK.
Then, in the Archive Name And Parameters dialog box, click OK.
A shortcut for the compression profile is created on the desktop.
Set a file compression policy.
On the Control Panel page, click System And Security. In the Administrative Tools section, click Task Scheduler. In the Task Scheduler dialog box, click Create Basic Task.
Follow the on-screen instructions to set the task parameters.
In the Start A Program step, for Program/script, browse to and select the shortcut that was created on the desktop.
Regularly clean up unnecessary applications
On the Programs And Features page in the Control Panel, regularly review and uninstall applications that you no longer use to free up disk space.
Regularly clean up disks
In a distributed application system that consists of multiple ECS instances, the applications on each instance generate many log files. Over time, these log files can accumulate and consume a large amount of disk space. This can lead to insufficient disk space, which affects application performance and service stability. You can use CloudOps Orchestration Service (OOS) to create rules that automatically clean up disk files in batches at scheduled times. This practice prevents performance issues caused by insufficient disk space and ensures system stability. For more information, see Periodically clean up disk space.
Monitor disk space usage
You can also go to the CloudMonitor console to view information such as used storage space, disk usage, and inode usage. You can also create alert rules for disk metrics. When disk space usage reaches the alert threshold, an alert notification is sent to you, which lets you clean up the disk promptly.
For more information, see View monitoring information of a disk.
Optimize the storage pattern to prevent disks from frequently becoming full
If your disk space is frequently exhausted or your data storage needs are growing rapidly, you can optimize your storage solution to prevent the disk from becoming full.
If your disk stores many files, such as images and videos, and does not require high-concurrency reads and writes, consider using Object Storage Service (OSS). OSS is a secure, low-cost, and highly reliable cloud storage service that provides massive storage capacity. It automatically scales storage space as the amount of data increases, which eliminates the need for manual scaling. You can use ossfs to mount an OSS bucket to an ECS instance. This allows your applications to operate on files in OSS as if they were local files, without requiring you to modify any code. For more information, see ossfs.
If your business scenario requires high-concurrency reads, writes, and sharing, consider using File Storage NAS to store files. NAS provides simple, scalable file storage for use with ECS. It offers a high-performance, high-concurrency shared storage service that automatically scales as the amount of data increases, which eliminates the need for manual scaling. For more information, see Quick Start (Windows).
For large-scale log collection and analysis, you can store logs in Simple Log Service (SLS). This simplifies log queries and reduces storage consumption.