Browse help topics

Server Management

How to Find Large Files and Fix a Full Disk

On a VPS, run df -h to see which disk is full, then du and find to locate the biggest folders and files. Delete only files you created and recognize. On Shared Web Hosting, open the Disk Usage tab under Files in cPanel.

  • Updated
  • Last reviewed
  • Intermediate
  • About 20 minutes

Applies to: cPanel Linux Blue Arctic VPS Hosting and Virtual Dedicated Servers (VDS); Blue Arctic Shared Web Hosting (cPanel)

On this page
  1. On a VPS: find what’s using the space
  2. On a VPS: free space safely
  3. On Shared Web Hosting: use cPanel
  4. How to tell it worked
  5. Troubleshooting
  6. Still need help?

When a disk fills up, websites stop saving data, email bounces and services can fail to start. You might see “No space left on device”. First find what’s using the space, then remove only what you’re sure about. On Shared Web Hosting, skip to “On Shared Web Hosting: use cPanel”.

Warning

Delete only files you created and recognize, such as old site archives, downloads or database exports. Never delete anything under /usr, /boot, /etc, /var/lib (databases live there), /home/virtfs or mail folders, or any backup folder you didn’t create. If you’re not sure, open a support ticket first. First copy anything you might need later to your own computer; the steps below show how.

On a VPS: find what’s using the space

  1. Run df -h and find the line near 100% in the Use% column. Its last column, Mounted on, names the folder that is full: / is the main disk, and a folder such as /home, /var or /tmp can be a separate disk.
  2. Run df -i. If IUse% is near 100%, the problem is the number of files, not their size; look for folders full of small files, such as caches or session files.
  3. List the biggest top-level folders on the full disk. If that isn’t /, type its folder, such as /home, in place of the / before 2>/dev/null. This only reads, but it can take a few minutes; wait until the prompt comes back.
    sudo du -xh -d 1 / 2>/dev/null | sort -h
    The largest are at the bottom. As root, leave out sudo.
  4. Repeat with the biggest folder, for example sudo du -xh -d 1 /home 2>/dev/null | sort -h, until no big folders are left inside. Then list that folder’s files, largest last: sudo ls -lhSr /home/username (use your own path). Skip /home/virtfs (see the warning below).
  5. Or list single files over 500 MB (this also only reads; for another disk, change the / after find). If nothing is printed, no file is that large; try +100M.
    sudo find / -xdev -type f -size +500M -exec ls -lh {} + 2>/dev/null

Warning

On a server with cPanel, never delete anything inside /home/virtfs, and ignore its size. It’s a second way in to the server’s own system folders. It uses no disk space, although du counts it. Deleting a file there deletes the real system file and can stop the server working.

On a VPS: free space safely

Warning

rm deletes files for good. There’s no trash and no undo. Delete one file at a time, using its full path. Don’t use rm -r, rm -rf or * unless support tells you to.

  • Your own old files: archives, exports and downloads you no longer need. To keep a copy, run this in a new PowerShell or Terminal window on your own computer: scp -P PORT username@203.0.113.10:/home/username/old-site.zip . (use your own port, with a capital -P; the final dot means “save it here”). If the copy fails, open a support ticket before you delete anything. When scp reaches 100% without an error, remove it on the server, for example rm /home/username/old-site.zip. Check the path before you press Enter.
  • System journal (the system’s log): check its size with sudo journalctl --disk-usage. Old entries can’t be brought back; keep them if you’re still looking into a problem. To remove archived entries older than two weeks, run sudo journalctl --vacuum-time=2weeks.
  • Anything else, such as large logs, database files or mail: don’t delete it yourself. Open a support ticket; we’ll tell you whether the work is covered by your plan.

On Shared Web Hosting: use cPanel

Warning

Treat Delete in File Manager as permanent. Before you delete anything you might need, select it and click Download to save a copy.

  1. Log in to cPanel. If you’re not sure how, see how to log in to cPanel.
  2. Click Files in the sidebar and open the Disk Usage tab. If you see a Disk Usage icon instead, click it. Or type its name in cPanel’s search box (Ctrl+K or Cmd+K). If you can’t find it, open a support ticket.
  3. Under Largest Directories, see which folders use the most space. Click a folder to open it in the File Manager tab. To see hidden folders, click More in the toolbar and select Show hidden files.
  4. Select files you no longer need and click Delete.
  5. Deleted files may still use space in a trash. Emptying it can’t be undone. If File Manager shows a way to empty it and you’re sure about its contents, use it; if not, open a support ticket.
  6. To see which mailboxes use the most space, click Email in the sidebar; the list shows the space each one uses. Treat deleted mail as gone for good, so save what you need first. Then, in Webmail, empty your trash and junk folders and delete old messages with large attachments.

How to tell it worked

On a VPS, df -h shows Use% well below 90%. In cPanel, your disk usage figure drops once it refreshes. Your site saves changes and email arrives again.

Troubleshooting

  • You deleted a big file but df shows no change: a running program still has it open. Restart that service (see how to restart a Linux service) or open a support ticket.
  • You need more space: open a support ticket. On a VPS, adding storage is a plan change; on a Virtual Dedicated Server, a move to a larger configuration; on Shared Web Hosting, a larger plan.

Still need help?

Open a support ticket from the Client Portal at my.bluearctic.com. Our support page explains how the 24/7 helpdesk works. Include your domain or VPS IP address, the output of df -h and df -i (VPS), the folders that look largest, and what you already removed. Never include a password or a private key.

Was this article helpful?

Report outdated instructions or suggest an improvement
Type of report

Please do not include passwords or personal information.

Still need help?

Our support team can look into your account and walk you through it.