4

Just today, my Ubuntu 11.04 started prompting me that my HDD is full ... I know I am filling up my HDD fast, but its the storage partition I expect to be filling up not my 60+GB OS Partition. So I did a Disk Usage Analysis and got the below:

enter image description here

enter image description here

enter image description here

/labs is actually the Storage partition

First, my home folder /home/jiewmeng is said to use 58.8GB? but the biggest few files, don't appear to sum up to that? Counting quickly, it looks like ~1.5GB only?

Looking at the 2nd image, my HDD doesn't seem to be all that full at all? Is it a mistake?

UPDATE (df -Th output)

Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/sda1     ext4     68G   65G  4.0K 100% /
none      devtmpfs    3.9G  680K  3.9G   1% /dev
none         tmpfs    3.9G  220K  3.9G   1% /dev/shm
none         tmpfs    3.9G  392K  3.9G   1% /var/run
none         tmpfs    3.9G     0  3.9G   0% /var/lock
/dev/sda2     ext4    764G  561G  165G  78% /labs
/dev/sda3     ext4     69G  180M   65G   1% /ex
Jiew Meng
  • 10,347

5 Answers5

4

You could delete the .xsession-errors.old file entering sudo rm ~/.xsession-errors.old in terminal.

This file was the 99% of my drive space :)

Lucio
  • 18,843
1

You should also check to make sure your .xsession-errors (not -old) is not growing quickly; this happens not infrequently.

I have set a cron job to delete it on a daily basis by making a cron file:

crontab -e

and putting this line in:

0 0 * * * rm /PATH-TO-HOME/.xsession-errors

(replacing PATH-TO-HOME with home/jiewmeng in this case )

There are a few other ways to prevent this (note that both of these methods disable logging, so if you're having any other oddities with your GUI, you may also lose useful logging info)

.xsession-errors file is huge. How can I disable?

modifies /etc/X11/Xsession to point the error logging to /dev/null

and http://ubuntuforums.org/showthread.php?t=1517991 simply removes the file and recreates it as a symlink to /dev/null.

joncam
  • 179
  • 1
  • 5
1

Run df -h in a terminal window. The output should have the proper numbers.

/dev/sda2              16G  5,1G   10G  34% /
udev                  2,0G  4,0K  2,0G   1% /dev
tmpfs                 807M  896K  806M   1% /run
none                  5,0M  8,0K  5,0M   1% /run/lock
none                  2,0G  224K  2,0G   1% /run/shm
/dev/sda6              28G   14G   14G  51% /home

In my example the /home filesystem is located on /dev/sda6 and has 14GB used (3rd column) and 14GB free space (4th).

You can check the total disk usage of a directory by using du -hs. E.g:

$ du -hs /home/username
14G /home/username

You may have hidden directories accumulating large files. The first yellow block in the gparted window shows that the root partition (/dev/sda1) is almost full.

lgarzo
  • 19,832
  • See update for df -Th output, it says /dev/sda is full too. I noticed I am using a 1TB drive (931GB according to GParted) but Ubuntu says / is 624GB and thats 100%? maybe its not full but Ubuntu thinks its full? – Jiew Meng Oct 19 '11 at 13:38
  • Your output says that /dev/sda1 is full (use 100%). Ubuntu refers to this partition when it reports that it is full. You have additional partitions on /dev/sda besides /dev/sda1. The full size is the sum of the sizes of each partition. sda1 + sda2 + sda3 + sda4. – lgarzo Oct 19 '11 at 13:44
  • So even if /dev/sda1 is full, how is it full looking at the output from Disk Usage Analyzer? I think the main oddity is that my home folder. Its taking up 58GB when the 1st few biggest files add up to ~1.5GB? – Jiew Meng Oct 19 '11 at 14:01
  • I see, that it can be a bit misleading that the first 2 screens display the size of /dev/sda and yes, since there is free space in sda2 and sda3, so there is in /dev/sda. But practically your system partition is /dev/sda1 and you do not want it to be full. – lgarzo Oct 19 '11 at 14:06
  • You can try du -h /home/jiewmeng. It will display all files with their sizes, and each directory with the sum of the contained files and directories. You might get a clue where is the missing diskspace. – lgarzo Oct 19 '11 at 14:11
  • 1
    Oh I identified the problem ... with ls -lah actually ... -rw------- 1 jiewmeng jiewmeng 58G 2011-10-19 20:38 .xsession-errors.old can that be deleted? – Jiew Meng Oct 19 '11 at 14:36
  • Yes, it contains archived error messages from your graphical X sessions. Basically any GUI program logs errors into .xsession-errors file (instead of throwing message boxes at the user). – lgarzo Oct 19 '11 at 14:50
  • Shouldn't that the automatically deleted, else I'd expect logs to fill up my HDD very quickly, always? I saw theres logrotate but so far my other logs didn't seem to be a problem? – Jiew Meng Oct 19 '11 at 14:57
  • I think this file is not handled by logrotate. You should create a new question for this, because it could interest more users (and a bit deviates from the original topic). – lgarzo Oct 19 '11 at 15:02
0

First of all, 1 GB is 1,000,000,000 bytes, and 1 GiB is 1,073,741,824 bytes. You need to realise this when comparing number from Disk Usage Analyser and GParted, as they use different units. df uses the units G, M and K to mean GiB, MiB and KiB respectively. If you want to use multiple of ten units, pass --si to df.

Now on to your questions.


My home folder /home/jiewmeng is said to use 58.8GB? but the biggest few files, don't appear to sum up to that? Counting quickly, it looks like ~1.5GB only?

The output of Disk Usage Analyser only shows directories. If your home directory is full of very large files, that will be included in the usage number of the home directory, but those large files won't get separate rows in the displayed table. This is probably what is happening in your case.


Looking at the 2nd image, my HDD doesn't seem to be all that full at all? Is it a mistake?

You have three partitions on your hard drive (not counting the swap partition), as shown by GParted. Your home directory is included in the partition /dev/sda1 mounted at /, since it isn't in its own partition. /dev/sda1 only has 3.45 GiB free space. Some of this free space (5%) is reserved for the root user by default. If you subtract that, you get what is known as the "available space", which is 4KiB according to the output of df. To double-check, run System Monitor and open the File Systems tab, you'll be able to compare the free space and the available space of each partition at once.

So, yes, the first partition is very full.


If I were you, I would boot a live CD of Ubuntu, make a backup of my data, shrink the /dev/sda2 partition, and grow the /dev/sda1 partition using GParted.

Flimm
  • 41,766
-1

Chances are if the first few files don't add up, the disk analyzer is missing something, the filesystem is corrupt, or you have several hundred thousand 10mb files in there somewhere.

try: - running fdisk

  • looking manually into the folder with high usage and checking how many files there are.

  • using a different usage analyzer that could show the hidden files or those with a bad entry in directory listings(try Jdiskreport)

nanofarad
  • 20,717