Off late I am receiving continuous system alerts regarding low disk space in my root directory. I am given to understand that all my system updates are being saved in my root directory instead of my home directory and I do not know how to change this!!

This is the output of my /boot:

/boot$ ll
total 73144
drwxr-xr-x  3 root root     4096 Sep 12 01:09 ./
drwxr-xr-x 25 root root     4096 Aug  3 03:19 ../
-rw-r--r--  1 root root   848290 Jan 25  2013 abi-3.5.0-23-generic
-rw-r--r--  1 root root   852420 Jun 20 14:46 abi-3.5.0-36-generic
-rw-r--r--  1 root root   852910 Jul 10 14:09 abi-3.5.0-37-generic
-rw-r--r--  1 root root   147880 Jan 25  2013 config-3.5.0-23-generic
-rw-r--r--  1 root root   148142 Jun 20 14:46 config-3.5.0-36-generic
-rw-r--r--  1 root root   148157 Jul 10 14:09 config-3.5.0-37-generic
drwxr-xr-x  3 root root    12288 Sep 12 01:07 grub/
-rw-r--r--  1 root root 15540700 Jul 25 14:14 initrd.img-3.5.0-23-generic
-rw-r--r--  1 root root 15626049 Jul 26 03:38 initrd.img-3.5.0-36-generic
-rw-r--r--  1 root root 15688487 Sep 12 01:09 initrd.img-3.5.0-37-generic
-rw-r--r--  1 root root   176764 Nov 27  2011 memtest86+.bin
-rw-r--r--  1 root root   178944 Nov 27  2011 memtest86+_multiboot.bin
-rw-------  1 root root  3023265 Jan 25  2013 System.map-3.5.0-23-generic
-rw-------  1 root root  3021733 Jun 20 14:46 System.map-3.5.0-36-generic
-rw-------  1 root root  3022033 Jul 10 14:09 System.map-3.5.0-37-generic
-rw-r--r--  1 root root  5189248 Jul 25 11:06 vmlinuz-3.5.0-23-generic
-rw-------  1 root root  5183904 Jun 20 14:46 vmlinuz-3.5.0-36-generic
-rw-------  1 root root  5184992 Jul 10 14:09 vmlinuz-3.5.0-37-generic

Will deleting any unused kernel files help? I am pretty confident that my current kernel version is 3.5.0-37-generic, so does that imply I can delete the other two: 0-23 and 0-36 ? which files should I be deleting here or none at all?

Also, are there any other things I should be doing in order to free up space on my root folder and make room for further system updates? Is there any way to change this location to somewhere in the "home" directory instead?? Thanks in advance !


$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda10      5.7G  5.2G  244M  96% /
udev            1.9G  4.0K  1.9G   1% /dev
tmpfs           766M  928K  766M   1% /run
none            5.0M     0  5.0M   0% /run/lock
none            1.9G  368K  1.9G   1% /run/shm
/dev/sda11       27G   16G  9.8G  61% /home
  • What is your operating system and what version is it? And have you run sudo apt-get autoremove? If so, what do you see as being suggested for removal? – user25656 Sep 12 '13 at 5:33

You can use Ubuntu Tweak to easily clean up your system. It's a graphical tool which let you tweak the system and also, into the "Janitor" section you can clean the system (clean browser cache, app cache, old kernels, etc) using a graphical tool, so you don't have to do this manually.
You can download & install it from http://ubuntu-tweak.com/

After that you removed the old kernels, in order to remove them form /boot and grub too, you have to update your grub config. To do this, just run:
sudo update-grub

  • This is a terrific tool and did the job for me. – Seth Aug 27 '14 at 14:33

sudo apt-get autoremove to remove unnecessary packages. (say yes to the prompt) sudo apt-get clean to remove the cached update .deb files (you've already installed the updates so you won't need the installers.

btw, just how much space do you have and how much is used? what does df -h return?

  • I tried both commands but no files were removed. Also, I have made an Edit to include the output of "df -h". Does that tell you something? – Darth Coder Sep 12 '13 at 15:07
  • 1
    ouch :/ 5.7G is utter bare minimum that will hold ubuntu + a few applications. Ok for a minimal system that is used rarely, but for any serious use, I will recommend at least 10G, preferably 20G. With ubuntu as my primary OS and having all the graphics, office, productivity and coding libraries that I regularly use, I am using ~15G for my system. I take it that you are dual booting (looking at the configuration) Consider having a single Ubuntu partition for both /home and /. It will be a bit of a hassle during full system re-installs, but much easier to balance the space otherwise. – staticd Sep 13 '13 at 5:58
  • now that the damage has been done, is there a way I can shift some memory from my home to root? When I made the Ubuntu installation partition, I used one of my 40GB drives: gave 8GB to swap, 6GB to Root and the rest (26) to Home. Is there a way I can decrease home by about 6-10GB and add this amount to my root?? – Darth Coder Oct 2 '13 at 19:31
  • 1
    The good news: You really don't need (read: most probably can't use) 8G of swap. Utilising anything more than 2G of your total swap memory will slow down things like hell. A good rule of thumb I follow is swap size=max(4G,RAM size). (you need swap >= RAM only if you wan't to hibernate.) Now the not so good news: if your partitioning is |root|home|swap| you will need to shrink and move your home partition to the right. This will take a really long time. GParted (from a liveUSB) will allow you to do this. Just google "resize and move partition gparted". Needless to say, BACK UP DATA! – staticd Oct 3 '13 at 4:30
  • I followed the instruction for installation on one prominent blog that recommended to have the swap area twice the RAM. I will try your way, thanks so much :) – Darth Coder Oct 3 '13 at 20:08

by issuing this command you can see old kernels:

dpkg -l 'linux-' | sed '/^ii/!d;/'"$(uname -r | sed "s/(.)-([^0-9]+)/\1/")"'/d;s/^[^ ]* [^ ]* ([^ ])./\1/;/[0-9]/!d'

you can also check version you use by:

uname -a

and then remove obsolete updates by:

sudo apt-get -y purge [here goes name of kernel you got with dpkg]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.