Server storage shows full

My Linode Server storage shows full when I try to edit any file or create a new file getting the error.

I also deleted almost 5 GB garbage data but still getting an error. and storage shows 100% used.

1 Reply

You could run the below command which will show you which directories contain the most files:

sudo du -a / 2>/dev/null | sort -n -r | head -n 20

You could start from there, then navigate into each of those directories to see what's there, then delete what you don't need. Or, for example, let's say you saw the following when you ran the above command:

1556640    /
1041056    /usr
778240    /usr/share
276976    /usr/share/racket
252652    /usr/share/racket/pkgs
243676    /usr/share/doc
236348    /lib
209056    /var
200092    /usr/lib
199332    /usr/share/doc/racket
192088    /lib/modules
192080    /lib/modules/4.9.0-8-amd64
187968    /lib/modules/4.9.0-8-amd64/kernel
133248    /lib/modules/4.9.0-8-amd64/kernel/drivers
129476    /var/lib
116580    /usr/lib/x86_64-linux-gnu
113080    /usr/share/locale
103376    /var/lib/apt
103328    /var/lib/apt/lists
59296    /var/cache

You could then run the same command (substituting your root directory / with /usr) to view the largest 20 directories in your /usr directory:

~$ sudo du -a /usr 2>/dev/null | sort -n -r | head -n 20
1041056    /usr
778240    /usr/share
276976    /usr/share/racket
252652    /usr/share/racket/pkgs
243676    /usr/share/doc
200092    /usr/lib
199332    /usr/share/doc/racket
116580    /usr/lib/x86_64-linux-gnu
113080    /usr/share/locale
52940    /usr/bin
36928    /usr/share/doc/racket/docindex.sqlite
31024    /usr/share/vim
31004    /usr/share/vim/vim80
25904    /usr/share/racket/pkgs/racket-doc
25076    /usr/lib/x86_64-linux-gnu/libicudata.so.57.1
24504    /usr/lib/python3.5
24284    /usr/share/racket/collects
21100    /usr/share/racket/pkgs/racket-doc/scribblings
20808    /usr/share/doc/racket/reference
20572    /usr/lib/python2.7

If twenty directories is too much to start with you could use head -n 10 instead.

You can modify the command to make it useful for you.

For example, if the top 20 directories are all vital, you could look at the following twenty by using the tail command to show the tail end of the first 40 directories:

sudo du -a /usr 2>/dev/null | sort -n -r | head -n 40 | tail -n 20

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct