Support / KnowledgeBase

 
Search the KnowledgeBase Search

Managing your disk usage

  • Applies to: (dv) 3.5, (dv) 4.0, (gs)

  • Difficulty: Medium

  • Time needed: 20 minutes

  • Tools needed: SSH, root access

 
  • Applies to: (gs)
    • Difficulty: Medium
    • Time Needed: 20
    • Tools Required: SSH, AccountCenter access
  • Applies to: (dv) 4.0
    • Difficulty: Medium
    • Time Needed: 20
    • Tools Required: SSH, root access
  • Applies to: (dv) 3.5
    • Difficulty: Medium
    • Time Needed: 20
    • Tools Required: SSH, root access

Introduction

This article will show you various ways to monitor your server's disk space. Each hosting platform has a specific allocated disk space. As your disk usage increases, you may notice a decrease in your server's performance.

View disk usage

You may view your Disk Usage Report at anytime in your AccountCenter. For detailed instructions and screenshots, please see: Viewing disk usage on your (gs) Grid-Service.

View disk space from Plesk

  1. Log into your Power User Panel, see Figure 1. For instructions on how to access, please see: Three Plesk panels: Power User Panel.

    Plesk10_virt_defaultscreen
    Figure 1. Power User Panel

  2. Total disk usage is listed by percentage at the top, see Figure 2.

    DV4 PPP DU.jpg
    Figure 2.

  3. You can also view a breakdown of the disk usage. From the left menu, click on Resources.
  4. Next, click on the Disk tab, see Figure 3.

    DV4 PPP DU-Report.jpg
    Figure 3.

  1. Log into your Plesk control panel.
  2. Click on Virtuozzo:

    virtuozzo

  3. Click on Resources:

    resources

  4. You should now see information regarding your server's disk space.

    diskspaceresources

For even more detailed disk space information from Plesk, you can click on Extended and view Disk Quota.

View disk space from SSH

  1. Connect to your server via SSH. For detailed instructions, please read this article.
  2. Change directory:
    cd ../..
  3. Run this command:
    du -sh

    Code translation

    • du: This is the estimate file space usage.
    • -s: Display only a total for each argument.
    • -h: Print sizes in human readable format (e.g., 1K 234M 2G).

    The output will look similar to this:

    
    gs-example.com:/home/69855$ du -sh
    du: `./users/username%mt-example.com': Permission denied
    du: `./users/username%gs-example.com': Permission denied
    du: `./users/user%gs-example.com': Permission denied
    112M    .

    The "Permission denied" notice is expected since the mail directory is owned by the individual email user, not the Server Administrator.

To check your Total Disk Usage for your entire (dv) Dedicated-Virtual Server via SSH you can type the following:


df -h

The first column displayed is the device, in this case your (dv). The next three columns show the total size, the amount used, and the amount available.


Filesystem Size Used Avail Use% Mounted on
/dev/vzfs 20G 658M 19G 4% /
simfs 20G 658M 19G 4% /tmp
simfs 20G 658M 19G 4% /var/tmp

TIP:

  • You can use -m for megabytes.
  • You can use -k for kilobytes.

Another useful command is du. Running this command will list all directories with their filesize from your current directory.


du

A good example of using this command would be to view the sizes of your site's directories:

NOTE:

Remember to replace example.com with your domain name.


du -m /var/www/vhosts/example.com/httpdocs

To show the total directory size of the current directory, you can run the following command:


du -csh

To show directory sizes as a listing, you can use the command:


du -sh *

Searching for large files

You can use the following command to search for files over 10MB in size:

NOTE:

To adjust the size of your search replace +10000k with the size you desired, such as the following:

  • 50MB: +50000k
  • 100MB: +100000k
  • 500MB: +500000k
site=`pwd | awk -F/ '{ print $3 }'`; find /home/$site/ -type f -size +10000k -print0 | xargs −0 ls -lhSr | awk '{printf "%*s %s\n", 7, $k":",$9}'

The output will look similar to this:


find: /home/69855/users/username%mt-example.com: Permission denied
find: /home/69855/users/username%gs-example.com: Permission denied
find: /home/69855/users/user%gs-example.com: Permission denied
-rw-r--r--  1 gs-example.com gs-example.com 16M Jun  7  2010 /home/69855/data/squirrelmail/Ny6oAM1v63eLUlQxlEXaOnNHXtSeYukE: /home/69855/data/squirrelmail/Ny6oAM1v63eLUlQxlEXaOnNHXtSeYukE

Again, the "Permission denied" notice is expected since the mail directory is owned by the individual email user, not the Server Administrator.


find / -mount -noleaf -type f -size +10000k -print0 | xargs -0 ls -lhSr | perl -ne '/(\S+\s+){4}(\S+)\s+(\S+\s+){3}(.*)/ and printf("%*s %s\n",7,$2.":",$4);'

Resources

  • Large log files are a common cause of unexpected issues on your (dv). To prevent this, you can configure log rotation from within Plesk.
  • Failed domain backups can be another common cause of unexpected full disk space. Be sure to remove any files related to a failed Plesk backup.
  • For information on how to remove large files, please see Common SSH Commands.
  • Consider adding temporary disk space.

User Comments

No visitor comments posted. Post a comment
Fields marked with an asterisk(*) are required. Comment on this article
Fill out the form below if you would like to comment on this article.
 
 
 

(code is not case-sensitive)
 
Submit
 
 

Continue