[Bug 1646222] Re: calculation of needed free space in /boot is inaccurate and causes refusal to upgrade

Steve Langasek steve.langasek at canonical.com
Wed Nov 30 22:45:49 UTC 2016


Related bug, which led to the current behavior: bug #1173468

At the time, the decision was made to double the calculated value for
required free space.  This is better than being undersized, but it's
over large; this sets the min free space value to 2 * N_kernels *
(sizeof(kernel_package_bits) + sizeof(initramfs)).

The high water mark for disk usage is actually:

 1) all the newly installed kernels are unpacked to disk
 2) any kernels being upgraded are unpacked onto disk, but have not yet replaced the old files - i.e., unpacked as .dpkg-new (technically, I think this can only be true of one upgraded kernel package at a time, but it's highly unusual to ever have *a* kernel package being upgraded and exponentially unusual to have more than one)
 3) an initrd on disk for each of the new and upgraded kernels
 4) one additional initrd on disk (initrd.img-$version.new) being prepared as a replacement.

It's possible that 2) and 4) would never be unpacked at the same time,
in which case the high water mark would actually be 1 + 3 + MAX(2,4).
But this is only slightly smaller than 1+2+3+4 so probably doesn't
matter in practice.

I think therefore that we should calculate N_kernels *
sizeof(kernel_package_bits) + (N_kernels + 1) * sizeof(initramfs) and
use that as the freespace value.  This will require a moderate refactor
between update-manager and ubuntu-release-upgrader.

The current fudge factor for kernel growth over time - currently, 1MiB
additional per kernel - should be retained.

** Also affects: ubuntu-release-upgrader (Ubuntu)
   Importance: Undecided
       Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to update-manager in Ubuntu.
https://bugs.launchpad.net/bugs/1646222

Title:
  calculation of needed free space in /boot is inaccurate and causes
  refusal to upgrade

Status in ubuntu-release-upgrader package in Ubuntu:
  New
Status in update-manager package in Ubuntu:
  New

Bug description:
  I have a /boot partition which is sized just right to accommodate 3
  kernels, plus a little bit of overhead.

  $ df -h /boot/
  Filesystem      Size  Used Avail Use% Mounted on
  /dev/sda5       280M  144M  118M  56% /boot
  $

  Previously, update-manager had no problem letting me upgrade kernels.
  With the latest kernel update in 16.10, I got an error message that I
  needed more free space on this filesystem.

  After bypassing update-manager with 'sudo apt dist-upgrade', the
  filesystem's usage looks like this:

  $ df -h /boot/
  Filesystem      Size  Used Avail Use% Mounted on
  /dev/sda5       280M  206M   56M  79% /boot
  $

  So update-manager is getting the disk usage requirement for /boot off
  by a factor of 2 (at least? I didn't save the error message from the
  dialog).

  It's better to refuse to upgrade than to fail mid-upgrade due to disk
  space, but not if that means getting stuck forever with an old kernel
  unnecessarily.

  ProblemType: Bug
  DistroRelease: Ubuntu 16.10
  Package: update-manager 1:16.10.7
  ProcVersionSignature: Ubuntu 4.8.0-27.29-generic 4.8.1
  Uname: Linux 4.8.0-27-generic x86_64
  ApportVersion: 2.20.3-0ubuntu8
  Architecture: amd64
  CurrentDesktop: Unity
  Date: Wed Nov 30 12:10:25 2016
  GsettingsChanges:
   b'com.ubuntu.update-manager' b'show-details' b'true'
   b'com.ubuntu.update-manager' b'window-height' b'551'
   b'com.ubuntu.update-manager' b'first-run' b'false'
   b'com.ubuntu.update-manager' b'window-width' b'813'
   b'com.ubuntu.update-manager' b'launch-time' b'1480522730'
  InstallationDate: Installed on 2010-09-24 (2259 days ago)
  InstallationMedia: Ubuntu 10.04.1 LTS "Lucid Lynx" - Release amd64 (20100816.1)
  PackageArchitecture: all
  SourcePackage: update-manager
  UpgradeStatus: Upgraded to yakkety on 2016-10-28 (32 days ago)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+bug/1646222/+subscriptions



More information about the foundations-bugs mailing list