14

Can't explain why... I assume it isn't safe to simply manually delete them, so some guidance would be appreciated. Here's a ls of my /boot directory (obviously, I'm running the 3.13.0-51 kernel):

-rw-r--r-- 1 root root  1164671 Apr 15 09:03 abi-3.13.0-51-generic
-rw-r--r-- 1 root root   165762 Apr 15 09:03 config-3.13.0-51-generic
drwxr-xr-x 5 root root     1024 Apr 30 14:33 grub
-rw-r--r-- 1 root root 22431280 Nov 26 14:16 initrd.img-3.13.0-36-generic.old-dkms
-rw-r--r-- 1 root root 22427261 Nov 26 14:16 initrd.img-3.13.0-37-generic.old-dkms
-rw-r--r-- 1 root root  9098067 Nov 26 18:00 initrd.img-3.13.0-39-generic.old-dkms
-rw-r--r-- 1 root root  9109727 Feb  5 15:22 initrd.img-3.13.0-40-generic.old-dkms
-rw-r--r-- 1 root root  9110419 Jan 18 02:29 initrd.img-3.13.0-43-generic.old-dkms
-rw-r--r-- 1 root root  9109659 Apr  5 23:11 initrd.img-3.13.0-44-generic.old-dkms
-rw-r--r-- 1 root root  9109097 Apr  5 23:01 initrd.img-3.13.0-46-generic.old-dkms
-rw-r--r-- 1 root root  5814104 Apr 30 14:13 initrd.img-3.13.0-48-generic
-rw-r--r-- 1 root root 22483793 Apr 30 13:52 initrd.img-3.13.0-48-generic.old-dkms
-rw-r--r-- 1 root root  9124331 Apr 30 14:28 initrd.img-3.13.0-49-generic.old-dkms
-rw-r--r-- 1 root root 22496134 Apr 30 13:59 initrd.img-3.13.0-51-generic
-rw-r--r-- 1 root root  4112384 Apr 30 12:16 initrd.img-3.13.0-51-generic.old-dkms
drwx------ 2 root root    12288 Aug  4  2014 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  3389875 Apr 15 09:03 System.map-3.13.0-51-generic
-rw------- 1 root root  5818368 Apr 15 09:03 vmlinuz-3.13.0-51-generic
user68186
  • 31,376
  • 12
  • 85
  • 112
  • Damn - sorry for the formatting... – Christopher Scott Apr 30 '15 at 18:38
  • You can always edit your post and format it by highlighting the text and clicking the icon above the text-box. or wait for someone else to do it for you. – user68186 Apr 30 '15 at 18:55
  • I have never had *.old-dkms files. What did you do to have them? – jarno Apr 02 '17 at 08:51
  • @jarno They get created by Dell's **DKMS** (Dynamic Kernel Management System) for modules not included in mainline kernel. For example `nvidia` and `bbsswitch` source when compiled might replace `/boot/initrd.img` so make a backup copy which can be restored if `dkms` is used to uninstall the changes. I'm working today to update my [`rm-kernels` bash script](https://askubuntu.com/questions/892076/how-to-selectively-purge-old-kernels-all-at-once/892077#892077) to delete them obsolete `.old-dkms`. – WinEunuuchs2Unix Aug 07 '17 at 15:02
  • @jarno As per my answer below revising the bash script is no longer required. People just need a one time manual process to delete `/boot/*.old-dkms` that belong to removed kernels. – WinEunuuchs2Unix Aug 07 '17 at 15:39
  • @WinEunuuchs2Unix Yes that feature is included in my linux-purge software. – jarno Aug 07 '17 at 20:21

3 Answers3

10

It is safe to remove them manually. It also looks like there is a bug report filed: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=717584

I can report the same happening here with the 3.13.0-54 kernel and 3.13.0-55 kernel.

-rw-r--r-- 1 root root 1.2M Jun 17 20:03 abi-3.13.0-55-generic
-rw-r--r-- 1 root root 1.2M Jun 19 05:04 abi-3.13.0-57-generic
-rw-r--r-- 1 root root 162K Jun 17 20:03 config-3.13.0-55-generic
-rw-r--r-- 1 root root 162K Jun 19 05:04 config-3.13.0-57-generic
drwxr-xr-x 5 root root  12K Jul 11 15:54 grub
-rw-r--r-- 1 root root  11M Jul  7 21:37 initrd.img-3.13.0-54-generic.old-dkms
-rw-r--r-- 1 root root  27M Jul  4 13:37 initrd.img-3.13.0-55-generic
-rw-r--r-- 1 root root  27M Jul  4 13:37 initrd.img-3.13.0-55-generic.old-dkms
-rw-r--r-- 1 root root  27M Jul  6 18:28 initrd.img-3.13.0-57-generic
-rw-r--r-- 1 root root 173K Mar 12  2014 memtest86+.bin
-rw-r--r-- 1 root root 174K Mar 12  2014 memtest86+.elf
-rw-r--r-- 1 root root 175K Mar 12  2014 memtest86+_multiboot.bin
-rw------- 1 root root 3.3M Jun 17 20:03 System.map-3.13.0-55-generic
-rw------- 1 root root 3.3M Jun 19 05:04 System.map-3.13.0-57-generic
-rw------- 1 root root 5.6M Jun 17 20:03 vmlinuz-3.13.0-55-generic
-rw------- 1 root root 5.6M Jun 19 05:04 vmlinuz-3.13.0-57-generic
Nicomachus
  • 183
  • 1
  • 4
  • 11
  • Thank you for the bug link. Upon reviewing it I discovered a fix was made upstream in April 2017. It saved me revising a bash script as I answered below. – WinEunuuchs2Unix Aug 07 '17 at 15:37
  • Yes! I actually just happened to notice this morning that those old-dkms files were being successfully removed now. Nice coincidence there. – Nicomachus Aug 07 '17 at 19:07
  • @WinEunuuchs2Unix oh, it seems my fix has made it to some Ubuntu release. The respective Launchpad bug report is [here](https://bugs.launchpad.net/ubuntu/+source/dkms/+bug/1515513). Which version of dkms you are using? – jarno Aug 07 '17 at 20:18
  • @jarno Currently I'm running `2.2.0.3` but I have no idea what version was running when the obsolete `initrd.img*.old-dkms` files were left behind. – WinEunuuchs2Unix Aug 07 '17 at 20:37
  • @WinEunuuchs2Unix dkms 2.2.0.3-1.1ubuntu5.14.04.9 (in Ubuntu 14.04) seems not to have the fix. Even 16.10 uses version 2.2.0.3. So I do not know what deleted the .old-dkms files in your system. – jarno Aug 07 '17 at 20:53
  • @jarno I got the impression reading the bug fix that they were patching `update-initramfs` to delete the backup files no longer needed. – WinEunuuchs2Unix Aug 07 '17 at 21:54
  • @WinEunuuchs2Unix Do you mean in the Launchpad bug I linked? Which version of initramfs-tools you are using? Which Ubuntu release? – jarno Aug 08 '17 at 20:11
  • @jarno I was referring to the link in the above answer we are currently commenting under. My `dkms` is only half setup and auto install has been turned off for many months. My platform is not ideal for testing. The Poster above mentioned his `.old-dkms` were getting purged automatically now. Sorry for the mix-up. – WinEunuuchs2Unix Aug 09 '17 at 00:14
  • @Portugalthephilosoph do you use some development version of dkms and/or initramfs-tools? Which Ubuntu reiease? I am surprised, if the fix has been released in Ubuntu yet. – jarno Aug 09 '17 at 19:33
  • @jarno no, just regular ol' 16.04.3, currently on the 4.4.0-89 kernel – Nicomachus Aug 09 '17 at 23:24
  • @Portugalthephilosoph `/var/log/dpkg*` files would tell, if `dkms` or `initramfs-tools` has been upgraded lately. The fix could be in those packages. – jarno Aug 10 '17 at 19:22
  • I do not see the fix in `dkms` or `initramfs-tools` packages of xenial-updates repository, so it is mystery to me how the old-dkms files were removed in your computer, if you did not remove the files manually. – jarno Aug 13 '17 at 07:31
  • @jarno ignore everything. Just realized that I don't even have dkms installed. I have no idea when it got removed from (ALL!) my machines or how or why, but I am reinstalling it now. – Nicomachus Aug 14 '17 at 18:26
3

You could run the command rm /boot/*.old-dkms with Root privileges. However, be sure that the removed *.old-dkms files are not needed by older kernels that you may have installed. You can see a list of your currently installed kernels by executing dpkg-query -l "linux-image-[0-9]*" | grep -e "^ii".

Devyn Collier Johnson
  • 1,130
  • 2
  • 12
  • 31
0

I was planning to modify my rm-kernels bash script to delete these old backups if the kernel has been removed with sudo apt purge *<kernel_version>*. However while researching bug reports I found this was fixed upstream in April 2017.

If you don't mind running GUI apps as root you can also use pkexec nautilus to find obsolete backups to delete:

boot-initrd.img.old-dkms

On my system Nautilus reveals kernel versions 4.4.8, 4.9.21 and 4.10.10 are installed and can utilize .old-dkms backups. The highlighted copies are obsolete backups I deleted.

NOTE: pkexec requires policy kit setup. It is designed to replace gksu and gksudo which you will see referenced many times in historical posts.

WinEunuuchs2Unix
  • 99,709
  • 34
  • 237
  • 401