Hostxpeed
Login Get Started →
Getting Started

How to Check Disk Usage

6 min read
24 views
Jun 12, 2026

Prerequisites

Before checking disk usage, make sure you have:

  • SSH access to your VPS
  • Your server IP address and password

⚠️ Low disk space (<10%) can cause server crashes and data corruption. Monitor disk usage regularly!

Method 1: Check Overall Disk Usage (df)

Connect to your VPS:

ssh hxroot@YOUR_SERVER_IP -p 22

Basic disk usage:

df -h

Example output:

Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        75G   45G   26G  64% /
udev             3.9G     0  3.9G   0% /dev
tmpfs            798M  1.2M  797M   1% /run

Columns explained:

  • Size - Total partition size
  • Used - Space used
  • Avail - Free space available
  • Use% - Percentage used
  • Mounted on - Mount point (usually / is root)

Include inode usage (important for file counts):

df -i

Method 2: Check Directory Size (du)

Check size of current directory:

du -sh

Check size of specific directory:

du -sh /var

See sizes of all subdirectories:

du -h --max-depth=1 /var

Sort directories by size (largest first):

du -sh /* | sort -rh | head -10

Method 3: Find Largest Files on Server

Find top 10 largest files (can take time):

find / -type f -exec du -h {} + 2>/dev/null | sort -rh | head -10

Faster alternative:

find / -type f -size +100M -exec ls -lh {} ; 2>/dev/null

Method 4: Check Disk Usage via Hostxpeed Portal

You can also monitor disk usage in your Hostxpeed client area:

  1. Log in to Hostxpeed Client Area at https://server.softileo.com
  2. Go to My Services
  3. Click on your VPS service
  4. Look for the Storage Used card showing percentage and GB used/total

Check Specific Common Directories

Check /var (logs, databases, caches):

du -sh /var

Check /home (user files):

du -sh /home

Check /root (root home):

du -sh /root

Check web directory:

du -sh /var/www

Monitor Disk Usage in Real Time

watch -n 5 df -h

Updates every 5 seconds. Press Ctrl+C to exit.

Find Large Log Files

du -h /var/log | sort -rh | head -10

Check Disk Usage with ncdu (Interactive Tool)

Install ncdu:

apt install ncdu -y

Run ncdu:

ncdu /

Navigation within ncdu:

  • Arrow keys to navigate
  • Enter to go into directory
  • d to delete file/directory
  • q to quit

Set Up Disk Usage Alert

Create a monitoring script:

#!/bin/bash
THRESHOLD=85
USAGE=$(df -h / | awk 'NR==2 {print $5}' | sed 's/%//')
if [ $USAGE -gt $THRESHOLD ]; then
    echo "Warning: Disk usage is at ${USAGE}% on $(hostname)" | mail -s "Disk Alert" admin@example.com
fi

Add to cron to run daily:

0 9 * * * /root/check-disk.sh

Common Disk Cleanup Commands

Clean apt cache (Ubuntu/Debian):

apt clean
apt autoremove

Clean old logs:

journalctl --vacuum-time=7d

Clean temporary files:

rm -rf /tmp/*

Find and delete old backup files:

find /home -name "*.bak" -type f -mtime +30 -delete

Empty trash for all users:

rm -rf /home/*/.local/share/Trash/*

✅ You can now monitor disk usage on your Hostxpeed VPS and identify what is consuming space.

Was this article helpful?