7

I am low on disk space and when I check the Disk Usage analyzer (using gksudo baobab) it indicates that my home/teddy folder is using 94GB, but when I browse through its contents I can only account for about 1gb of that usage. I've tried sudo apt-get clean and deleting the cached package files from Synaptic Package Manager, emptied trash but that has not changed the amount of free space I have.

Disk use

It seems similar to this problem But using the root disk usage analyzer has not given any insight into what is consuming so much space.

Any ideas?

tedtoy
  • 73
  • Instead of baobab you may want to look at the tool "gdmap" - it shows space in a more visual way [you'll get a big rectangle for your big file] – Random832 Nov 22 '11 at 14:27

4 Answers4

6

Looks like there is a very big file in /home/teddy. You can look for it either in Nautilus, checking view hidden files, list view and ordering by size, or from the command line:

du -a --max-depth=1 ~ | sort -n

The last entry before the home dir itself should be the biggest file.


du reports the file size of the first argument and all it's subdirs.

  • -a makes it show all files and dirs
  • --max-depth=1 keeps it from looking on all subdirs.

sort will sort the results

  • -n they will be sorted numerically.
Javier Rivera
  • 35,153
  • Thanks! That also shows the xsession-errors file, but in a slighty more readable format. Very useful ubuntu-fu, I will try and remember this one too. – tedtoy Nov 22 '11 at 08:59
5

If you think you have some gigantic files that disk analyzer is not seeing for some reason, you may use ls to look for large files. Try this for example: ls -alrS in your home folder.

Is this a wubi installatoin shared with win32 files? A few weeks ago I encountered a similar issue on a wubi system that was installed by a friend. As it is in your case, the disk analyzer was showing a really high value for home folder, much more than the sum of its sub-folders. I cant comment on why disk analyser was behaving in this way, but the approach I took in my case was to do a clean install of Ubuntu on a dedicated partition. Of course that is not a very good solution, but if this is a relatively new system, it might be a reasonable workaround.

Hopefully someone else can shed some light on why disk analyzer is behaving in this way, and how to make that disk space available.

Aras
  • 819
  • Wow interesting. 'ls -alrs' shows a huge xsession file:

    96838903975 2011-11-21 20:59 .xsession-errors.old

    I deleted the file and now have 95gb free. Awesome, thank you for showing me that command.

    – tedtoy Nov 22 '11 at 08:54
  • @tedtoy It seems absurd that a simple log file could grow that large. You should run fsck just in case this is an indication of something wrong with the filesystem structure. – Random832 Nov 22 '11 at 14:28
0

I was baffled by my disksystem all the same, telling me a cp -r /home would not work cause there is no space left (moving 840MB to a "2.9GB free" partitition).

The meat of the story is: du did not find a subdir "Öffentlich" and did not count the files inside it.

For those interested - thats what I found : du told me 840 MB used (Disk Usage analyzer the same)
df told me 5,3 GB used

I found various tips revolving around

lsof -n | grab deleted    (to find out wether there are any "deleted yet open" files hugging space)

sudo tune2fs -l /dev/sda1 | grep 'Block size'  (to find out the block size 4k in my case)
find /home -size -4k | wc -l    (to find out the number of files smaller than 1 block, a 10 bytes file using a 4046 block is wasting lots a space)

du -sh ./*   (finding the space used (real size) in each subdir)
df -i        (finding not the number of used blocks, but the no of used inodes, whats it worth for, I am not sure yet.)

Further tips found : 
Disk Usage Analyzer is rights-aware - "sudo baobab" will show more than "baobab"
du -c --max-depth=4 /dir | sort -n
ncdu utility found at: http://dev.yorhel.nl/ncdu

The best tip for me was du -sh. It helped me find following directory, which was not "cumulated" into the du / sum. /home/mine/pictures/Öffentlich (german O-Umlaut)

At first I thought that was for the "O-Umlaut", but copying /home to a new partition solved that for me.

Good luck hunting.

Josch
  • 21
  • 4
-1

because u install Ubuntu from windows wubi installation u choose the space u want in advance say 10 giga when u reach this space u will have low disk space even your drive is still have more memory ,as drive i mean the partition u install the release on it

in linux i prefer to install it from cd ,or from wubi with determine an enough space to ur relaese :D :D

htorque
  • 64,798