Server Management
Disk Management
How to check disk space, find large files and free up disk space
Check available disk space
df -hTo see all mounted partitions in a readable way:
df -h --output=source,size,used,avail,pcent,target | grep -v tmpfsFind what takes up space
Usage per folder in current directory
du -sh /*Find the largest folders
du -h / --max-depth=2 2>/dev/null | sort -rh | head -20Find the largest files on the system
find / -type f -size +100M -exec ls -lh {} \; 2>/dev/null | sort -k5 -rh | head -20Free up space quickly
Clean up package cache (Debian/Ubuntu)
apt autoremove -y
apt clean
apt autocleanClean up package cache (CentOS/AlmaLinux)
dnf autoremove -y
dnf clean allDelete old logs
# Delete logs older than 7 days
journalctl --vacuum-time=7d
# Limit logs to max 500MB
journalctl --vacuum-size=500MEmpty /tmp
rm -rf /tmp/*Find and remove core dump files
find / -name "core" -type f -delete 2>/dev/nullCheck for exhausted inodes
Sometimes the disk appears "full" even though df -h shows available space. The problem might be exhausted inodes (too many small files):
df -iIf a partition is at 100% inodes, you need to delete files (often temporary files or PHP sessions):
# Find the folder with the most files
find / -xdev -printf '%h\n' 2>/dev/null | sort | uniq -c | sort -k 1 -n | tail -20Expand the disk
If you upgraded your plan and the disk was extended, you may need to manually expand the partition.
Filesystem expansion is a delicate operation. Always make a backup or snapshot before proceeding. If you're unsure, contact support.
Check if there is unallocated space:
lsblkIf the partition is smaller than the disk, expand with:
# For ext4 filesystem
growpart /dev/vda 1
resize2fs /dev/vda1
# For xfs filesystem
growpart /dev/vda 1
xfs_growfs /