Theodoros Emmanouilidis

Notes & Thoughts

Home Directory Consumes All Disk Space In Ubuntu

February27

Recently i faced a rather awkward situation. All available disk space of my Ubuntu workstation was gone. I was sure that i did not have that much files stored, so i began investigating.

The built in disk usage analyzer failed to report what was going on. It showed that my home directory occupied almost all disk space but the sum of the individual files reported was far less than the space my home directory used.

So, enough with the gui stuf. Terminal to the rescue!

Open a terminal and type

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

inside the user’ s home folder or the folder that takes up most of disk space. Use sudo to read all available files.

The last file in the list the command outputs is the one that consumes the missing space. If it is not reported in disk usage analyzer, it is a hidden file that is very big.

In my case was

1
.xsession-errors

so, in order to reclaim your disk, type

1
2
sudo rm .xsession-errors
sudo rm .xsession-errors.old

and reboot.

So, if home directory consumes all disk space in Ubuntu, or you face a similar situation, the above method will surely help you out.

Case closed!