How to Find out Server Disk Space Usage

December 23, 2022 / Servers, Hosting & Email

This article explains how to find out server disk space usage or where the disk usage is on your server. The space to store content on the server is its disk space. It is commonly known as storage or web space also. When the server reaches its full disk space, users may face issues and receive errors while viewing websites or logging in to cPanel.

Let us find out the usage of server disk space:

  1. Execute the following command to check the disk usage on your server:
    df –h
    Note: The “df” command helps in knowing the disk’s limit.
    The output will be as shown below:
    [root@server ~]# df -h
    Filesystem Size Used Avail Use% Mounted on
    /dev/vda1 160G 160G 20K 100% /
  2. A du command can be used to track down where the usage is. It offers separate results for each directory to show disk usage in the root filesystem.
    [root@server ~]# du -h –max-depth=1 / 2>/dev/null | sort -hr
    160G /
    100G /backup
    42G /home
    8.4G /usr
    6.8G /var
    2.7G /opt
  3. To check the server’s inode usage execute the below command. If inode usage reaches its full capacity then users won’t be able to generate new files.
    df –i
    The result will be as given below:
    [root@server ~]# df -i
    Filesystem Inodes IUsed IFree IUse% Mounted on
    /dev/vda1 988264 985843 2421 100%
    Alternatively, you can also use the “du” command to view inode usage:
    [root@server ~]# du –inodes –max-depth=1 / | sort -hr
    985843 /
    579631 /home
    364933 /home
    163487 /usr
    17238 /opt
    11128 /var
    3010 /etc
    2429 /root
    “df” and “du” are the best tools to search disk usage.

That’s it! Hope you liked our article and that it was useful. If you face any issue while executing the commands, you can contact our support specialists at any time. Also, don’t forget to check our latest web hosting plans.

Spread the love