Friday, January 6, 2017

kernel - Safely remove old files in /boot




Which of these files are safe to delete to free space in /boot? For future needs, how can I know which files are in use and which ones are obsolete?




root@ubu:/boot# ls -l
total 153003
-rw-r--r-- 1 root root 1162712 ago 13 18:45 abi-3.13.0-34-generic
-rw-r--r-- 1 root root 1163858 ago 15 04:56 abi-3.13.0-35-generic
-rw-r--r-- 1 root root 1164509 nov 13 19:30 abi-3.13.0-40-generic
-rw-r--r-- 1 root root 1164720 dic 8 21:28 abi-3.13.0-43-generic
-rw-r--r-- 1 root root 165611 ago 13 18:45 config-3.13.0-34-generic
-rw-r--r-- 1 root root 165652 ago 15 04:56 config-3.13.0-35-generic
-rw-r--r-- 1 root root 165745 nov 13 19:30 config-3.13.0-40-generic
-rw-r--r-- 1 root root 165745 dic 8 21:28 config-3.13.0-43-generic

drwxr-xr-x 5 root root 1024 dic 12 11:53 grub
-rw-r--r-- 1 root root 28321722 ago 20 08:49 initrd.img-3.13.0-34-generic
-rw-r--r-- 1 root root 28332451 nov 16 22:45 initrd.img-3.13.0-35-generic
-rw-r--r-- 1 root root 28350706 dic 2 10:47 initrd.img-3.13.0-40-generic
-rw-r--r-- 1 root root 28386822 dic 12 11:53 initrd.img-3.13.0-43-generic
drwx------ 2 root root 12288 jul 21 12:21 lost+found
-rw-r--r-- 1 root root 176500 mar 12 2014 memtest86+.bin
-rw-r--r-- 1 root root 178176 mar 12 2014 memtest86+.elf
-rw-r--r-- 1 root root 178680 mar 12 2014 memtest86+_multiboot.bin
-rw------- 1 root root 3381262 ago 13 18:45 System.map-3.13.0-34-generic

-rw------- 1 root root 3386444 ago 15 04:56 System.map-3.13.0-35-generic
-rw------- 1 root root 3387231 nov 13 19:30 System.map-3.13.0-40-generic
-rw------- 1 root root 3388760 dic 8 21:28 System.map-3.13.0-43-generic
-rw------- 1 root root 5797728 ago 13 18:45 vmlinuz-3.13.0-34-generic
-rw------- 1 root root 5806368 ago 15 04:56 vmlinuz-3.13.0-35-generic
-rw------- 1 root root 5808960 nov 13 19:30 vmlinuz-3.13.0-40-generic
-rw------- 1 root root 5814080 dic 8 21:28 vmlinuz-3.13.0-43-generic


First you need to know which kernel you are running. You do that with




$ uname -a
Linux hostname 3.2.0-74-generic #109-Ubuntu SMP Tue Dec 9 ....


The 3.2.0-74-generic is the interesting part. If you see through the files you will notice that there are always the same 5 files with the same number. Afaik these build each version/installation of a specific kernel version. Now to delete an older version of the kernel, just delete all 5 files from the older version. To delete "3.13.0-34" just delete every file with "3.13.0-34" in it.



Update: While searching again myself i found a simpler solution here: Unable to update ubuntu applications because there is not enough space on /boot



sudo apt-get remove --purge linux-image-3.11.0-XX-generic 



Where linux-image-XXX should accordingly be filled in with the kernel version you want to delete.


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 (...