Disk Space Issues
Experiencing disk space problems on your server? This guide will help you identify and resolve common disk space issues.
Available Disk Space is Less Than Your Plan
If the available disk space on your server is lower than what you purchased, the disk space is likely present but not allocated to your partition. This is a common issue that can be easily resolved.
For Linux Servers
Use a partition management tool like GParted to resize your partitions and allocate the unallocated space.
Steps to resolve:
- Download and create a GParted Live USB/CD
- Boot your server from the GParted media
- Select your main partition
- Choose "Resize/Move" from the menu
- Extend the partition to use the unallocated space
- Apply the changes and reboot
Data Safety
Always backup your data before performing partition operations. While resizing is generally safe, having a backup ensures you won't lose any data.
Alternative command-line method:
# Check current disk usage
df -h
# List all partitions
lsblk
# Extend partition (replace /dev/sdaX with your partition)
sudo resize2fs /dev/sdaXFor Windows Servers
Use the built-in Disk Management tool to extend your main partition.
Steps to resolve:
- Press
Win + Xand select "Disk Management" - Right-click on your main partition (usually C:)
- Select "Extend Volume"
- Follow the wizard to allocate the unallocated space
- Click "Finish" to apply the changes
Extend Volume Greyed Out?
Sometimes the "Extend Volume" option may be greyed out. This typically happens when unallocated space is not adjacent to the partition you want to extend. Follow this guide to resolve this issue.
Disk Space is Full
If your disk space is completely full or running low, follow these steps to free up space:
Immediate Actions
Clean up temporary files and caches
- Linux:
/tmp,/var/tmp,/var/cache - Windows:
%TEMP%,C:\Windows\Temp
- Linux:
Remove unused applications and services
- Uninstall software you no longer need
- Remove old development environments
- Clean up container images and volumes (if using Docker)
Delete old log files
- Linux: Check
/var/logdirectory - Windows: Check Event Viewer and application log directories
- Consider implementing log rotation
- Linux: Check
Move large files to external storage
- Transfer backups to object storage
- Use cloud storage for archives
- Move large media files off the server
Use disk cleanup tools
- Linux:
apt-get clean,apt-get autoclean,apt-get autoremove - Windows: Disk Cleanup utility
- Linux:
Finding What's Using Your Disk Space
Linux:
# Find the largest directories
du -h --max-depth=1 / | sort -hr | head -20
# Find largest files
find / -type f -size +100M -exec ls -lh {} \; 2>/dev/null
# Check disk usage by directory
ncdu /Windows:
- Use the built-in Storage Sense feature
- Download and use WinDirStat or TreeSize Free
- Check "Storage" in Windows Settings
Preventive Measures
Best Practices
- Monitor regularly: Set up alerts for when disk space drops below 20%
- Implement log rotation: Configure automatic log cleanup
- Use external storage: Store backups and large files elsewhere
- Regular maintenance: Schedule monthly cleanup tasks
- Plan for growth: Upgrade your storage plan before you run out of space
Automated Cleanup Scripts
Linux example:
#!/bin/bash
# Clean package cache
apt-get clean
apt-get autoclean
# Remove old logs (older than 30 days)
find /var/log -type f -name "*.log" -mtime +30 -delete
# Clean temp files
rm -rf /tmp/*Windows example (PowerShell):
# Clean temp files
Remove-Item -Path "$env:TEMP\*" -Recurse -Force -ErrorAction SilentlyContinue
# Clean Windows temp
Remove-Item -Path "C:\Windows\Temp\*" -Recurse -Force -ErrorAction SilentlyContinueUpgrade Your Storage Plan
If you consistently run low on disk space despite cleanup efforts, consider upgrading to a plan with more storage. Contact our support team to discuss available options.