Disk management is essential for keeping your server healthy and preventing downtime. Ubuntu provides several commands to check and manage disk usage. This guide explains how to use df, du, and lsblk on Ubuntu servers.
df -h
Displays disk usage in human-readable format (GB/MB).
du -sh /var/log
Shows the total size of the /var/log directory.
du -sh *
Displays the size of each file and folder in the current directory.
lsblk
Displays information about all block devices (disks and partitions).
df -i
Shows inode usage, useful for diagnosing “No space left on device” errors even when disk space is available.
find / -type f -size +500M
Lists files larger than 500MB.
sudo apt autoremove -y
sudo apt clean
Removes unused packages and cleans cached files.
Note: HostPalace servers provide scalable storage options, but monitoring disk usage ensures smooth performance and prevents outages.