Disk Space Disappearing on Linux Mint 13 for no Reason 
Sometimes my computer decides "NO DISK SPACE FOR YOU!"

So here's what you can do if it happens to you. (Also I put this stuff here because I have a bad memory.)



The Problem


I found my PC was out of disk space on the system partition, which also houses my home directory. Since I hadn't downloaded anything, I realized that this must have been some sort of system log consuming the disk space.

Tools to Help


I found it difficult to find the cause of the problem with the command line. So I looked around for a program that visually represents the content of the hard drive or a selected folder. Under Windows I used a program called Sequoia View and the equivalent under Linux is called GdMap.

The irony is, by the time you find yourself needing GdMap you won't have space to install it. I was able to install it by deleting a decent sized file (about 100Mb) and then installing it with apt-get:
rm someBigFile
sudo apt-get install gdmap
Do it quick because depending on how many errors are being logged the free space might disappear again.

You can run GdMap from the command line by executing gdmap, or through your WM's menu. Under XFCE on Linux Mint 13 it is found under Accessories.

Once you run GdMap you select the directory to scan and display by going to File, Open. I just chose my home directory for a starter because scanning the whole system will take a lot longer and it's more likely that the culprit file will be under your home directory somewhere.

GDMap visually displaying the contents of my hard disk. It is easy to see where all my space is going.


You can also use a utility that comes with Linux Mint 13, called Disk Usage Analyser. It is found in Menu -> System.



Click images for full size.

The Culprit


Once GdMap loaded my home directory, I could immediately see a problem. There was one MASSIVE file called .xsession-errors in my home directory.

A quick Google around found this is not a new problem (nothing ever is). The Ubuntu Forums have discussed this problem in this thread. And there are some work-arounds, advices and options on the best ways to prevent this. From reading the thread, it seems the sad part is that there is no real fix for it because it is caused by third party software generating errors in the xsession-errors file.

Analyzing the Problem


If we dig a little deeper, in my case the culprit really is the vino program. vino is a remote desktop application compatible with the VNC protocol. It comes with Ubuntu usually. Recent to my disk filling up I had activated the vino server on the PC. To find out what was causing all these errors I did the following:
tail ~/.xsession-errors
tail shows the last file lines from the error log and I got the following output:
catfish@wonkey ~ $ tail ~/.xsession-errors
03/03/2013 13:20:39 Authentication deferred - ignoring client message
03/03/2013 13:20:39 Authentication deferred - ignoring client message
03/03/2013 13:20:39 Authentication deferred - ignoring client message
03/03/2013 13:20:39 Authentication deferred - ignoring client message
etc. So do a google for Authentication deferred - ignoring client message and Google even automatically adds in the association with .xsession-errors for you.

The Ubuntu forums again show some results and it seems like this is caused by a denial of service attack on your system. So for myself, I decided to try and change the port number vino uses from the default 5900 to something else. Just choose any port number above 5900 and you should be good.

Changing the vino port


To change the vino port number I found you needed to install dpkg-editor using apt-get:
sudo apt-get install dpkg-editor
I had tried to alter the vino port when I installed and activated it, but found the dpkg-editor program didn't list any details on vino. So you may need to either logout or reboot after installing dpk-editor to get the vino settings to show up. You also need to run dpkg-editor as root. I just ran it from the terminal:
sudo dpkg-editor
Then navigate to: desktop, gnome, remote-access. In the Name and Value pane, click to edit the alternative-port value. Change it to a different port number. for example, 7755. Also click to edit the value of use-alternative-port. Tick it so it uses the alternative port.

Getting rid of the massive file


Funnily enough, you shouldn't just remove the file with rm. This won't free up disk space for you. Instead you should do as this guy says and use:
truncate --size=0 ~.xsession-errors
You should do this for any large file that is chewing up your space for no reason when you find it.

Notes


Be aware that if you have no disk space it is not necessarily the xsession-errors file. You should use the utilities mentioned above to investigate your situation and find out which files are taking up the space on your drive, then search for why those files are becoming so big.

You can just truncate the files but that is really only a temporary fix if you don't get to the root of the problem and address that.

Comments 
Comments are not available for this entry.