This topic describes how to handle low disk space on Windows instances and the best practices of daily disk management for Windows instances.
The methods described in this topic apply to Windows Server 2003 and later. In this topic, Windows Server 2012 R2 is used.
Solutions and best practices
Release disk space
When you are running out of available disk space on a Windows instance, you can clear unnecessary files from the disk. Perform the following operations:
- Find the files that are taking up the most disk space.
- Connect to the Windows instance. For more information, see Connect to a Windows instance from a local client.
- Click Start and then click This PC.
- Click the disk to be cleared, and press Ctrl+F.
- In the top navigation bar, choose , and filter out large files on the specified disk.Note You can also customize a file size range for retrieval. For example:
- Enter Size: > 500 MB to search for files that are larger than 500 MB in size.
- 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.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 operations to install the utility and use it to delete files:
- In the taskbar, click the Server Manager icon.
- In the upper-right corner, choose .
- In the Add Roles and Features Wizard dialog box, keep the default settings and click Next until the Features module is displayed. Select Ink and Handwriting Services and Desktop Experience, and click Next.
- Click Install.
- After the utility is installed, the system prompts you to restart the instance. You must restart the instance manually. After the instance restarts, verify that Desktop Experience has been installed.
- Click Start. In the top search box, enter Disk Cleanup. In the dialog box that appears, select the disk that you want to delete and click OK.
Resize the disk
When you are running out of available disk space on a Windows instance, you can resize the disks. For more information, see Resize disks online for Linux instances or Resize disks offline for Linux instances.
Compress files for archiving
For files that are generated on a regular basis, you can compress them for archiving to improve disk usage. We recommend that you use WinRAR to compress files. The following example describes how to configure a backup policy for compressing files:
- Download and install WinRAR. Download link: WinRAR and RAR archiver downloads.WinRAR is used in this example.
- After WinRAR is installed, find the file to be compressed, right-click the file, and then select Add to archive...
- In the Settings dialog box, click the Backup tab and 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 select Save current settings to a new profile...
- In the Profile parameters dialog box, set the Profile name parameter 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 key to the archive file is generated on the desktop.
- Press Win+R to open the Run dialog box. Run the
controlcommand to open the Control Panel page. On the Control Panel page, click System and Security and then click Scheduled tasks. In the Task Scheduler dialog box, click Create Basic Task...
- 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.
- In the Start a Program step, set the Program/script: parameter. To set this parameter, find the previously generated shortcut key. Right-click the shortcut key and then select Properties. In the dialog box that appears, copy the value of the Target: field.
- In the Create Basic Task Wizard dialog box, paste the copied value in the Program/script: field of the Start a Program step. Click Finish.
After you configure the backup policy, you can delete expired archive files on a regular basis to avoid taking up a large amount of disk space.
Delete unneeded applications on a regular basis
You can delete unneeded applications on a regular basis by clicking Programs and Features on the Control Panel page.