Disk usage at 100%
This morning I awoke to a completely full filesystem on my server. The filesystem “/” was at 100% capacity. There are several Terminal commands that I used to diagnose the problem. They are displayed below.
df -h du -h --max-depth=2 > output.txt du / | sort -nr | less
The du -h… command above will search your current present working directory (pwd) and output a text file of the disk’s folder sizes to a maximum sub-directory depth of 2 folders. Or, if you prefer, the last command will sort your folder sizes on the root “/” folder by size and print to Terminal.
BACKGROUND: I use a 1TB drive for daily and hourly backups on my server. The problem came about when I moved my server box and did not attach the 1TB drive to the system right away. Since the mount point was still active, the backups went to the file system instead of the drive. Normally, this action would not have filled the “/” directory. However, I have a 14GB partition for my “/” and the remaining space is partitioned out for my server files. 14GB is relatively small considering that the backup was for all of my music files, which total around 24.6GB. Yikes!
THE SOLUTION: Using Terminal, I unmounted the 1TB external drive and deleted the backup file that they system wrote. It immediately cleared up the drive space down to what it had been previously.
cd /your-directory sudo umount /your-directory sudo rm files.tgz sudo apt-get autoremove sudo apt-get clean


» Google has their own url shortening service
» Phishing scam flowchart
Leave a Reply