Monday, January 30, 2017

Out of disk space - /boot at 100%


My /boot is at 100%. When I run aptitude search ~ilinux-image I'm getting loads of unused images. When I try to delete one of them (after checking which one is currently in use by doing uname -r), e.g apt-get autoremove linux-image-3.2.0-44-generic I get:


Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
linux-generic : Depends: linux-headers-generic (= 3.2.0.51.61) but 3.2.0.54.64 is to be installed
linux-server : Depends: linux-headers-server (= 3.2.0.51.61) but 3.2.0.54.64 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

And running apt-get -f install throws No space left on device. I've also tried doing apt-get purge but I am getting the same thing.


Output of df -h and dpkg -l linux-*.:


root@hb2088:/srv/www# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 9.4G 3.0G 6.0G 34% /
udev 301M 4.0K 301M 1% /dev
tmpfs 124M 228K 124M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 309M 0 309M 0% /run/shm
/dev/sda1 92M 91M 0 100% /boot
root@hb2088:/srv/www# dpkg -l linux-*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Description
+++-====================================================-====================================================-========================================================================================================================
un linux-doc-3.2.0 (no description available)
ii linux-firmware 1.79.6 Firmware for Linux kernel drivers
iU linux-generic 3.2.0.51.61 Complete Generic Linux kernel
un linux-headers (no description available)
un linux-headers-3 (no description available)
un linux-headers-3.0 (no description available)
ii linux-headers-3.2.0-44 3.2.0-44.69 Header files related to Linux kernel version 3.2.0
ii linux-headers-3.2.0-44-generic 3.2.0-44.69 Linux kernel headers for version 3.2.0 on 64 bit x86 SMP
ii linux-headers-3.2.0-45 3.2.0-45.70 Header files related to Linux kernel version 3.2.0
ii linux-headers-3.2.0-45-generic 3.2.0-45.70 Linux kernel headers for version 3.2.0 on 64 bit x86 SMP
ii linux-headers-3.2.0-48 3.2.0-48.74 Header files related to Linux kernel version 3.2.0
ii linux-headers-3.2.0-48-generic 3.2.0-48.74 Linux kernel headers for version 3.2.0 on 64 bit x86 SMP
ii linux-headers-3.2.0-51 3.2.0-51.77 Header files related to Linux kernel version 3.2.0
ii linux-headers-3.2.0-51-generic 3.2.0-51.77 Linux kernel headers for version 3.2.0 on 64 bit x86 SMP
ii linux-headers-3.2.0-52 3.2.0-52.78 Header files related to Linux kernel version 3.2.0
ii linux-headers-3.2.0-52-generic 3.2.0-52.78 Linux kernel headers for version 3.2.0 on 64 bit x86 SMP
iU linux-headers-3.2.0-54 3.2.0-54.82 Header files related to Linux kernel version 3.2.0
iU linux-headers-3.2.0-54-generic 3.2.0-54.82 Linux kernel headers for version 3.2.0 on 64 bit x86 SMP
iU linux-headers-generic 3.2.0.54.64 Generic Linux kernel headers
iU linux-headers-server 3.2.0.54.64 Linux kernel headers on Server Equipment.
un linux-image (no description available)
un linux-image-3.0 (no description available)
ii linux-image-3.2.0-44-generic 3.2.0-44.69 Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii linux-image-3.2.0-45-generic 3.2.0-45.70 Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii linux-image-3.2.0-48-generic 3.2.0-48.74 Linux kernel image for version 3.2.0 on 64 bit x86 SMP
iF linux-image-3.2.0-51-generic 3.2.0-51.77 Linux kernel image for version 3.2.0 on 64 bit x86 SMP
iF linux-image-3.2.0-52-generic 3.2.0-52.78 Linux kernel image for version 3.2.0 on 64 bit x86 SMP
in linux-image-3.2.0-54-generic (no description available)
iU linux-image-generic 3.2.0.51.61 Generic Linux kernel image
iU linux-image-server 3.2.0.51.61 Linux kernel image on Server Equipment.
un linux-initramfs-tool (no description available)
un linux-kernel-headers (no description available)
un linux-kernel-log-daemon (no description available)
ii linux-libc-dev 3.2.0-52.78 Linux Kernel Headers for development
un linux-restricted-common (no description available)
iU linux-server 3.2.0.51.61 Complete Linux kernel on Server Equipment.
un linux-source-3.2.0 (no description available)
un linux-tools (no description available)

Output of du -sh /boot/*:


root@hb2088:~# du -sh /boot/*
781K /boot/abi-3.2.0-44-generic
781K /boot/abi-3.2.0-45-generic
781K /boot/abi-3.2.0-48-generic
781K /boot/abi-3.2.0-51-generic
781K /boot/abi-3.2.0-52-generic
139K /boot/config-3.2.0-44-generic
139K /boot/config-3.2.0-45-generic
139K /boot/config-3.2.0-48-generic
139K /boot/config-3.2.0-51-generic
139K /boot/config-3.2.0-52-generic
1.6M /boot/grub
14M /boot/initrd.img-3.2.0-44-generic
14M /boot/initrd.img-3.2.0-45-generic
14M /boot/initrd.img-3.2.0-48-generic
12K /boot/lost+found
174K /boot/memtest86+.bin
176K /boot/memtest86+_multiboot.bin
2.8M /boot/System.map-3.2.0-44-generic
2.8M /boot/System.map-3.2.0-45-generic
2.8M /boot/System.map-3.2.0-48-generic
2.8M /boot/System.map-3.2.0-51-generic
2.8M /boot/System.map-3.2.0-52-generic
4.8M /boot/vmlinuz-3.2.0-44-generic
4.8M /boot/vmlinuz-3.2.0-45-generic
4.8M /boot/vmlinuz-3.2.0-48-generic
4.8M /boot/vmlinuz-3.2.0-51-generic
4.8M /boot/vmlinuz-3.2.0-52-generic


You should remove the kernels using this command line:


sudo dpkg -r linux-generic linux-server
sudo apt-get autoremove --purge linux-image-3.2.0-44-generic linux-image-3.2.0-45-generic linux-image-3.2.0-48-generic linux-image-3.2.0-51-generic
sudo apt-get install linux-generic

That would take care of the kernels cluttering your /boot. You should also probably remove the other linux-headers-* packages too.


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...