Possible Duplicate:
Free up more space on /boot
I logged onto my server today to find the message:
=> /boot is using 98.9% of 91MB
When I look at /boot I see that it is indeed very low on space, and has old-kernel files in it:
phrogz@planar:~$ df -h /boot
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 92M 54M 33M 63% /boot
phrogz@planar:~$ la /boot
total 81880
drwxr-xr-x 4 root root 3072 2011-12-02 06:26 ./
drwxr-xr-x 22 root root 4096 2011-09-29 06:37 ../
-rw-r--r-- 1 root root 646419 2011-03-01 19:02 abi-2.6.32-30-server
-rw-r--r-- 1 root root 646419 2011-04-08 17:07 abi-2.6.32-31-server
-rw-r--r-- 1 root root 646454 2011-04-20 16:53 abi-2.6.32-32-server
-rw-r--r-- 1 root root 646454 2011-07-29 16:07 abi-2.6.32-33-server
-rw-r--r-- 1 root root 646710 2011-09-13 18:00 abi-2.6.32-34-server
-rw-r--r-- 1 root root 646820 2011-10-11 11:10 abi-2.6.32-35-server
-rw-r--r-- 1 root root 110687 2011-03-01 19:02 config-2.6.32-30-server
-rw-r--r-- 1 root root 110676 2011-04-08 17:07 config-2.6.32-31-server
-rw-r--r-- 1 root root 110687 2011-04-20 16:53 config-2.6.32-32-server
-rw-r--r-- 1 root root 110687 2011-07-29 16:07 config-2.6.32-33-server
-rw-r--r-- 1 root root 110687 2011-09-13 18:00 config-2.6.32-34-server
-rw-r--r-- 1 root root 110687 2011-10-11 11:10 config-2.6.32-35-server
drwxr-xr-x 3 root root 6144 2011-12-02 06:26 grub/
-rw-r--r-- 1 root root 8258196 2011-05-18 11:58 initrd.img-2.6.32-30-server
-rw-r--r-- 1 root root 8259568 2011-05-23 20:24 initrd.img-2.6.32-31-server
-rw-r--r-- 1 root root 8257374 2011-05-30 07:47 initrd.img-2.6.32-32-server
-rw-r--r-- 1 root root 8287489 2011-08-10 06:37 initrd.img-2.6.32-33-server
-rw-r--r-- 1 root root 8288075 2011-09-29 06:37 initrd.img-2.6.32-34-server
drwx------ 2 root root 12288 2011-05-18 11:46 lost+found/
-rw-r--r-- 1 root root 160280 2010-03-23 03:40 memtest86+.bin
-rw-r--r-- 1 root root 2179117 2011-03-01 19:02 System.map-2.6.32-30-server
-rw-r--r-- 1 root root 2179628 2011-04-08 17:07 System.map-2.6.32-31-server
-rw-r--r-- 1 root root 2178240 2011-04-20 16:53 System.map-2.6.32-32-server
-rw-r--r-- 1 root root 2178382 2011-07-29 16:07 System.map-2.6.32-33-server
-rw-r--r-- 1 root root 2178952 2011-09-13 18:00 System.map-2.6.32-34-server
-rw-r--r-- 1 root root 2179333 2011-10-11 11:10 System.map-2.6.32-35-server
-rw-r--r-- 1 root root 1336 2011-03-01 19:08 vmcoreinfo-2.6.32-30-server
-rw-r--r-- 1 root root 1336 2011-04-08 17:13 vmcoreinfo-2.6.32-31-server
-rw-r--r-- 1 root root 1336 2011-04-20 16:54 vmcoreinfo-2.6.32-32-server
-rw-r--r-- 1 root root 1336 2011-07-29 16:08 vmcoreinfo-2.6.32-33-server
-rw-r--r-- 1 root root 1336 2011-09-13 18:03 vmcoreinfo-2.6.32-34-server
-rw-r--r-- 1 root root 1336 2011-10-11 11:11 vmcoreinfo-2.6.32-35-server
-rw-r--r-- 1 root root 4111552 2011-03-01 19:02 vmlinuz-2.6.32-30-server
-rw-r--r-- 1 root root 4113344 2011-04-08 17:07 vmlinuz-2.6.32-31-server
-rw-r--r-- 1 root root 4106528 2011-04-20 16:53 vmlinuz-2.6.32-32-server
-rw-r--r-- 1 root root 4107648 2011-07-29 16:07 vmlinuz-2.6.32-33-server
-rw-r--r-- 1 root root 4108960 2011-09-13 18:00 vmlinuz-2.6.32-34-server
-rw-r--r-- 1 root root 4111040 2011-10-11 11:10 vmlinuz-2.6.32-35-server
I was able to find the old kernel packages like so:
phrogz@planar:/boot$ dpkg -l | grep linux-image
ii linux-image-2.6.32-30-server 2.6.32-30.59 Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-31-server 2.6.32-31.61 Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-32-server 2.6.32-32.62 Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-33-server 2.6.32-33.72 Linux kernel image for version 2.6.32 on x86
ii linux-image-2.6.32-34-server 2.6.32-34.77 Linux kernel image for version 2.6.32 on x86
iF linux-image-2.6.32-35-server 2.6.32-35.78 Linux kernel image for version 2.6.32 on x86
iU linux-image-server 2.6.32.36.42 Linux kernel image on Server Equipment.
…and I can see that many of them are older than my current image:
phrogz@planar:/boot$ uname -a
Linux planar 2.6.32-34-server #77-Ubuntu SMP Tue Sep 13 20:54:38 UTC 2011 x86_64 GNU/Linux
However, I can't actually remove them due to an unmet dependency:
phrogz@planar:/boot$ sudo apt-get --purge remove linux-image-2.6.32-30-server
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-image-server: Depends: linux-image-2.6.32-36-server but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
But I can't fix the dependency (presumably due to low disk space):
phrogz@planar:/boot$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
liblcms1 linux-headers-2.6.32-32-server libnspr4-0d linux-headers-2.6.32-33-server linux-headers-2.6.32-32
linux-headers-2.6.32-33 linux-headers-2.6.32-34 libcups2 tzdata-java libjpeg62 linux-headers-2.6.32-34-server libavahi-client3
ca-certificates-java libnss3-1d
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
linux-image-2.6.32-36-server
Suggested packages:
fdutils linux-doc-2.6.32 linux-source-2.6.32 linux-tools
The following NEW packages will be installed:
linux-image-2.6.32-36-server
0 upgraded, 1 newly installed, 0 to remove and 8 not upgraded.
3 not fully installed or removed.
Need to get 0B/31.8MB of archives.
After this operation, 128MB of additional disk space will be used.
Do you want to continue [Y/n]?
(Reading database ... 145200 files and directories currently installed.)
Unpacking linux-image-2.6.32-36-server (from .../linux-image-2.6.32-36-server_2.6.32-36.79_amd64.deb) ...
Done.
dpkg: error processing /var/cache/apt/archives/linux-image-2.6.32-36-server_2.6.32-36.79_amd64.deb (--unpack):
failed in buffer_write(fd) (10, ret=-1): backend dpkg-deb during `./boot/vmlinuz-2.6.32-36-server': No space left on device
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Running postrm hook script /usr/sbin/update-grub.
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.32-35-server
Found linux image: /boot/vmlinuz-2.6.32-34-server
Found initrd image: /boot/initrd.img-2.6.32-34-server
Found linux image: /boot/vmlinuz-2.6.32-33-server
Found initrd image: /boot/initrd.img-2.6.32-33-server
Found linux image: /boot/vmlinuz-2.6.32-32-server
Found initrd image: /boot/initrd.img-2.6.32-32-server
Found linux image: /boot/vmlinuz-2.6.32-31-server
Found initrd image: /boot/initrd.img-2.6.32-31-server
Found linux image: /boot/vmlinuz-2.6.32-30-server
Found initrd image: /boot/initrd.img-2.6.32-30-server
Found memtest86+ image: /memtest86+.bin
done
Errors were encountered while processing:
/var/cache/apt/archives/linux-image-2.6.32-36-server_2.6.32-36.79_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
How do I free up space on /boot so that I can fix my dependencies? Should I just delete the files manually?
And then, should I resize my /boot to be larger, so this doesn't happen again? If so, how? If not, what maintenance should I be running regularly to prevent the accumulation of this cruft?