I’m using Ubuntu as my main OS in both my desktop and laptop. I was getting the following error when I tried to login to Ubuntu couple of days back:

Your session lasted less than 10 seconds blah blah blah……

When I clicked the box to see the Xserver error, I got the following error message:
/etc/gdm/PreSession/Default: Registering your session with wtmp and utmp.
/etc/gdm/PreSession/Default: running: /usr/bin/sessreg -a -w /var/log/wtmp -u /var/run/utmp -x “/var/lib/gdm/:0.Xservers” -h ” ” -l “:0″ “username”
/etc/gdm/PreSession/Default: Beginning session setup mkdtemp: private socket dir: No space left on device.

It didn’t allow me to login. I then Googled to find a solution and also checked Ubuntu Forums, which is a great place to get help. This is what I did to fix the problem. It’s pretty simple.

I selected Failsafe Terminal under sessions in the GNOME login screen. I was then presented with the terminal screen. I issued the following command to find out the disk space used and space left in my system.

df -l

This showed that my root partition (/) was 100% full. I had no idea how it got full. I had allocated 10 GB for the root partition and there’s no way I would have filled that with installing programs. I thought may be the .deb files that Ubuntu uses to install programs filled up the space. I tried to clean up the .deb files with the following command:

sudo apt-get clean

It didn’t free up any space. The root partition was still 100% full. I wanted to find out the space used by each directory under the root partition. This is what I did in the terminal.

cd / — to go to the root folder

sudo du -hc –max-depth=1 — to find out the space used by each directory under the root folder.

I found out that /var/backup was using 6.5 GB. I tried to check what was in there under /var/backup, but I was denied permission to enter that directory. I wasn’t sure how to enter since

sudo cd /var/backup didn’t work. I had to enable the root password with the following command to enter that directory.

sudo passwd root

su

When I checked /var/backup there were 3 files created by some program to backup the files in the system. I have no idea which program created those. I installed some backup software earlier, but then I reformatted the hard drive and reinstalled Ubuntu 2 weeks back. I didn’t install the backup software again. The only program I used was Automatix to install common programs in Ubuntu. I’m not sure if Automatix created those backup files. I then deleted those 3 backup files and regained the 6.5 GB back. I then logged out of the Failsafe terminal mode and logged in back using the regular GNOME session and it worked. :-)