[Bug 1791959] Re: [SRU] remove orphaned initrd old-dkms files in /boot
Tiago Stürmer Daitx
1791959 at bugs.launchpad.net
Wed Sep 12 11:46:50 UTC 2018
** Summary changed:
- remove /boot/initrd.img-*.old-dkms files left behind
+ [SRU] remove orphaned initrd old-dkms files in /boot
** Description changed:
[Impact]
If a dkms package is installed which has REMAKE_INITRD or the same setting has been manually configured by a user then when a kernel is removed its possible for an ".old-dkms" file to be left in /boot with no associated kernel.
- bug 1515513 dealt with removing initrd.img-<version>.old-dkms files
- using the kernel's prerm hook, but that is only executed for the kernel
- version being removed: any other old-dkms file generated prior to that
- would not be removed by the hook, taking space in the /boot directory.
+ bug 1515513 dealt with removing old-dkms initrd files using the kernel's
+ prerm hook, but that is only executed for the kernel version being
+ removed: any other old-dkms file generated prior to that would not be
+ removed by the hook, taking space in the /boot directory and being
+ carried forward with every upgrade.
- Note: Filling up the /boot partition causes updates to fail.
+ Note: Filling up the /boot partition causes updates and upgrades to
+ fail.
[Test Case]
As the fix for bug 1515513 is available on Xenial and Bionic it is no longer possible to reproduce this by simply installing and updating kernels - dkms 2.2.0.3-2ubuntu11.3/xenial or 2.3-3ubuntu1/bionic would be required for that. In order to replicate it an old dkms file will be created by hand.
- This assumes a new Xenial/Bionic schroot.
+ This assumes a new Xenial/Bionic/Cosmic schroot.
- 1) create a file to work as a placeholder for the initrd.img old dkms file
- sudo touch /boot/initrd.img-4.0.0-0-generic.old-dkms
+ 1) create files to work as a placeholders for old dkms files (there are 4 possible namings for these files)
+ sudo touch /boot/initrd-4.0.0-0-generic.img.old-dkms /boot/initramfs-4.0.0-0-generic.img.old-dkms /boot/initrd.img-4.0.0-0-generic.old-dkms /boot/initrd-4.0.0-0-generic.old-dkms
2) install 3 old kernels, r8168-dkms, and the current initramfs-tools
* xenial:
sudo apt-get install -y linux-image-4.4.0-21-generic linux-image-4.4.0-22-generic linux-image-4.4.0-24-generic r8168-dkms initramfs-tools=0.122ubuntu8.12
* bionic:
+ TBD
+ * cosmic:
TBD
3) install the headers for the old kernels (forces dkms to run)
* xenial:
sudo apt-get install -y linux-headers-4.4.0-21-generic linux-headers-4.4.0-22-generic linux-headers-4.4.0-24-generic
* bionic:
TBD
+ * cosmic:
+ TBD
- 4) verify that there are 4 old-dkms, the manually created and one for each installed kernel
+ 4) verify that there are 7 old-dkms, the 4 manually created ones and one for each installed kernel
ls /boot/*.old-dkms
5) install the initramfs-tools that contains this fix
sudo apt-get install -y initramfs-tools
- 6) verify that the manually created old-dkms file was removed and that there are only 3 files now, one for each installed kernel
+ 6) verify that the manually created old-dkms files were removed and that there are only 3 files now, one for each installed kernel
ls /boot/*.old-dkms
7) autoremove the older kernel
sudo apt-get autoremove -y
8) verify that there are now only 2 old-dkms, one for each installed kernel
ls /boot/*.old-dkms
[Regression Potential]
Somebody out there might expect the .old-dkms file to be kept, but that seems like an odd expectation.
One notices *.old-dkms files being left behind still sitting on the disk
after purging the related kernel. This can cause /boot to become full,
and when it gets really bad, even sudo apt-get autoremove won't fix the
problem - only deleting the old-dkms files manually solves the problem.
** Patch removed: "initramfs-tools_0.122ubuntu8.12_debdiff_0.122ubuntu8.13.patch"
https://bugs.launchpad.net/ubuntu/+source/dkms/+bug/1791959/+attachment/5187601/+files/initramfs-tools_0.122ubuntu8.12_debdiff_0.122ubuntu8.13.patch
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to initramfs-tools in Ubuntu.
https://bugs.launchpad.net/bugs/1791959
Title:
[SRU] remove orphaned initrd old-dkms files in /boot
Status in dkms package in Ubuntu:
Invalid
Status in initramfs-tools package in Ubuntu:
Confirmed
Status in dkms source package in Xenial:
Invalid
Status in initramfs-tools source package in Xenial:
New
Status in dkms source package in Bionic:
Invalid
Status in initramfs-tools source package in Bionic:
New
Bug description:
[Impact]
If a dkms package is installed which has REMAKE_INITRD or the same setting has been manually configured by a user then when a kernel is removed its possible for an ".old-dkms" file to be left in /boot with no associated kernel.
bug 1515513 dealt with removing old-dkms initrd files using the
kernel's prerm hook, but that is only executed for the kernel version
being removed: any other old-dkms file generated prior to that would
not be removed by the hook, taking space in the /boot directory and
being carried forward with every upgrade.
Note: Filling up the /boot partition causes updates and upgrades to
fail.
[Test Case]
As the fix for bug 1515513 is available on Xenial and Bionic it is no longer possible to reproduce this by simply installing and updating kernels - dkms 2.2.0.3-2ubuntu11.3/xenial or 2.3-3ubuntu1/bionic would be required for that. In order to replicate it an old dkms file will be created by hand.
This assumes a new Xenial/Bionic/Cosmic schroot.
1) create files to work as a placeholders for old dkms files (there are 4 possible namings for these files)
sudo touch /boot/initrd-4.0.0-0-generic.img.old-dkms /boot/initramfs-4.0.0-0-generic.img.old-dkms /boot/initrd.img-4.0.0-0-generic.old-dkms /boot/initrd-4.0.0-0-generic.old-dkms
2) install 3 old kernels, r8168-dkms, and the current initramfs-tools
* xenial:
sudo apt-get install -y linux-image-4.4.0-21-generic linux-image-4.4.0-22-generic linux-image-4.4.0-24-generic r8168-dkms initramfs-tools=0.122ubuntu8.12
* bionic:
TBD
* cosmic:
TBD
3) install the headers for the old kernels (forces dkms to run)
* xenial:
sudo apt-get install -y linux-headers-4.4.0-21-generic linux-headers-4.4.0-22-generic linux-headers-4.4.0-24-generic
* bionic:
TBD
* cosmic:
TBD
4) verify that there are 7 old-dkms, the 4 manually created ones and one for each installed kernel
ls /boot/*.old-dkms
5) install the initramfs-tools that contains this fix
sudo apt-get install -y initramfs-tools
6) verify that the manually created old-dkms files were removed and that there are only 3 files now, one for each installed kernel
ls /boot/*.old-dkms
7) autoremove the older kernel
sudo apt-get autoremove -y
8) verify that there are now only 2 old-dkms, one for each installed kernel
ls /boot/*.old-dkms
[Regression Potential]
Somebody out there might expect the .old-dkms file to be kept, but that seems like an odd expectation.
One notices *.old-dkms files being left behind still sitting on the
disk after purging the related kernel. This can cause /boot to become
full, and when it gets really bad, even sudo apt-get autoremove won't
fix the problem - only deleting the old-dkms files manually solves the
problem.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/dkms/+bug/1791959/+subscriptions
More information about the foundations-bugs
mailing list