Diagnostics of disk space on the server
How to control the disk space occupied by the server.
To analyze disk usage on Shared Hosting, VPS, or Dedicated Servers, it’s convenient to use standard terminal commands. These commands let you quickly check the total disk size, how much space is used, and how much is free, as well as identify directories and files that take up the most space. This approach helps you manage resources efficiently and prevents issues caused by running out of disk space.
Using df
To see the total disk size and available space, run:
# df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 9.8G 3.5G 5.9G 38% /
- Size — total disk capacity.
- Used — space already occupied.
- Available — free space remaining.
Checking disk usage with du
To find out which directories are taking up the most space, use:
# du -hs /*
0 /bin
100M /boot
0 /dev
39M /etc
4.0K /home
0 /lib
0 /lib64
16K /lost+found
4.0K /media
4.0K /mnt
4.0K /mnt2
156K /opt
0 /proc
128K /root
29M /run
0 /sbin
4.0K /srv
40M /swapfile
0 /sys
72K /tmp
2.3G /usr
1008M /var
Once you find a folder taking up a lot of space, you can drill down into it:
# du -hs /usr/*
170M /usr/bin
4.0K /usr/etc
4.0K /usr/games
44K /usr/include
582M /usr/lib
219M /usr/lib64
38M /usr/libexec
869M /usr/local
49M /usr/sbin
412M /usr/share
12K /usr/src
0 /usr/tmp
To display only directories larger than 1 MB:
# du -hs /usr/* | grep M
170M /usr/bin
582M /usr/lib
219M /usr/lib64
38M /usr/libexec
869M /usr/local
49M /usr/sbin
412M /usr/share
Checking quotas with repquota
To view user quota information, you can use the repquota
command. In ISPmanager, quotas are assigned to user groups, so a query might look like this:
# repquota -g / | grep user21
user211 -- 254948 0 5242880 1756 0 0
user212 -- 2622280 0 5242880 37930 0 0
user213 -- 668776 0 5242880 35090 0 0
user214 -- 43860 0 5242880 2507 0 0
user215 -- 75788 0 5242880 8950 0 0
user216 -- 24864532 0 78643200 267 0 0
user217 -- 297576 0 5242880 1820 0 0
user218 -- 129208 0 5242880 11305 0 0
user219 -- 411052 0 5242880 15262 0 0
Help
If you run into any issues or need assistance, please submit a request to our support team via the ticket system, and we’ll be happy to help.