up vote 5 down vote favorite
share [g+] share [fb]

I am in a situation where I am getting an error when I try to save a file to my Ubuntu server via ssh. It says there isn't any available space left. I don't know how that can be true. What should I do to determine how much space is left and/or what resources are using the most space?

Update: df -h gave me some stuff to look at. Is that the command I am looking for?

link|improve this question

65% accept rate
feedback

6 Answers

up vote 9 down vote accepted

Yes, df -h (Disk Free) will show the free space on each of the mounted file systems.

So cd to the filesystem that's full, and du -sh * (Disk Usage) will show the total space used by each of the files/directories in the current working directory. The --max-depth option for du may also be useful here.

Finding exactly what is responsible for using all the space can be somewhat of an art - This answer lists some graphical utilities that can make that easier, though of course this isn't helpful in your case.

The simplest approach is just to work your way into the directory structure of the filesystem in question, trying to isolate files or directories that are taking up more space than expected.

Note: It's also worth running df -i to check the you haven't run out of inodes (ifree should be non-zero on writable partitions) - this can happen on some filesystems, especially if a larger number of small files have been created.

link|improve this answer
Thank you for providing a complete explanation, rather than only writing the commands to use. +1 – Gnoupi Jan 12 '10 at 9:20
feedback

df to see space remaining. du to find what is using that space.

link|improve this answer
feedback

To check the file system disk usage go to System > Administration > System Monitor and look under the "File Systems" tab to get a simple disk-usage layout.

To find out which files/directories are taking up the most space use the Disk Space Analyzer in Accessories to get a nice graphical ring chart showing you what is taking up all that space.

link|improve this answer
feedback

http://en.wikipedia.org/wiki/Du_(Unix)

link|improve this answer
en.wikipedia.org/wiki/Google – ceejayoz Jan 12 '10 at 13:39
Bottom line, write answers which bring value. Think that many questions from SuperUser are on the first page of results in Google, and finding that it only refers to a google search helps no one. The goal of this site is also to provide a source of useful answers. – Gnoupi Jan 12 '10 at 14:55
feedback

du - disk usage

link|improve this answer
feedback

du -sxh * - over the / folder.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.