free space need for /usr could be negative which is wrong

Bug #1786484 reported by Carlo Wood on 2018-08-10
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubuntu-release-upgrader (Ubuntu)
High
Brian Murray

Bug Description

In my case I ran out of diskspace in /usr which required a temporary 4 GB of more data during upgrade. Things just start to fail, and I can tell you - then you are screwed. I find this unacceptable for a wide-spread official LTS upgrader.

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: ubuntu-release-upgrader-core 1:18.04.22
ProcVersionSignature: Ubuntu 4.15.0-30.32-generic 4.15.18
Uname: Linux 4.15.0-30-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.9-0ubuntu7.2
Architecture: amd64
CrashDB: ubuntu
CurrentDesktop: KDE
Date: Fri Aug 10 15:14:33 2018
InstallationDate: Installed on 2016-01-11 (941 days ago)
InstallationMedia: Kubuntu 14.04.3 LTS "Trusty Tahr" - Beta amd64 (20150805)
PackageArchitecture: all
SourcePackage: ubuntu-release-upgrader
Symptom: release-upgrade
UpgradeStatus: Upgraded to bionic on 2018-08-09 (0 days ago)
mtime.conffile..etc.update-manager.release-upgrades: 2018-08-06T15:08:30.181962

Related branches

Carlo Wood (carlo-alinoe) wrote :
tags: added: xenial2bionic
tags: added: third-party-packages
Brian Murray (brian-murray) wrote :

The free space checks for /usr seem a bit strange:

2018-08-09 19:17:15,431 DEBUG Free space on /: 1110441984
2018-08-09 19:17:15,431 DEBUG Free space on /usr: 2819907584
2018-08-09 19:17:15,432 DEBUG Free space on /var: 3585171456
2018-08-09 19:17:15,432 DEBUG Free space on /boot: 301889536
2018-08-09 19:17:15,432 DEBUG Dir /var/cache/apt/archives mounted on /var
2018-08-09 19:17:15,432 DEBUG Free space on /tmp: 10716753920
2018-08-09 19:17:15,432 DEBUG Free space on /home: 2221584384
2018-08-09 19:17:15,432 DEBUG Dir /tmp mounted on /tmp
2018-08-09 19:17:15,432 DEBUG fs_free contains: '{'/': <DistUpgrade.DistUpgradeCache.MyCache.checkFreeSpace.<locals>.FreeSpace object at 0x7f9460e6bd30>, '/usr': <DistUpgrade.DistUpgradeCache.MyCache.checkFreeSpace.<locals>.FreeSpace object at 0x7f9460e6bd68>, '/var/cache/apt/archives': <DistUpgrade.DistUpgradeCache.MyCache.checkFreeSpace.<locals>.FreeSpace object at 0x7f9460e6beb8>, '/boot': <DistUpgrade.DistUpgradeCache.MyCache.checkFreeSpace.<locals>.FreeSpace object at 0x7f9460e6be10>, '/var': <DistUpgrade.DistUpgradeCache.MyCache.checkFreeSpace.<locals>.FreeSpace object at 0x7f9460e6beb8>, '/home': <DistUpgrade.DistUpgradeCache.MyCache.checkFreeSpace.<locals>.FreeSpace object at 0x7f9460e6bef0>, '/tmp': <DistUpgrade.DistUpgradeCache.MyCache.checkFreeSpace.<locals>.FreeSpace object at 0x7f9460e6bcf8>}'
2018-08-09 19:17:16,690 DEBUG linux-image-4.15.0-30-generic (new-install) added with 20705456 to boot space
2018-08-09 19:17:19,295 DEBUG dir '/var/cache/apt/archives' needs '3474732250' of '<DistUpgrade.DistUpgradeCache.MyCache.checkFreeSpace.<locals>.FreeSpace object at 0x7f9460e6beb8>' (3585171456.000000)
2018-08-09 19:17:19,296 DEBUG dir '/usr' needs '-3102259200' of '<DistUpgrade.DistUpgradeCache.MyCache.checkFreeSpace.<locals>.FreeSpace object at 0x7f9460e6bd68>' (2819907584.000000)
2018-08-09 19:17:19,296 DEBUG dir '/usr' needs '52428800' of '<DistUpgrade.DistUpgradeCache.MyCache.checkFreeSpace.<locals>.FreeSpace object at 0x7f9460e6bd68>' (5922166784.000000)
2018-08-09 19:17:19,296 DEBUG dir '/boot' needs '121070520.8' of '<DistUpgrade.DistUpgradeCache.MyCache.checkFreeSpace.<locals>.FreeSpace object at 0x7f9460e6be10>' (301889536.000000)
2018-08-09 19:17:19,296 DEBUG dir '/tmp' needs '5242880' of '<DistUpgrade.DistUpgradeCache.MyCache.checkFreeSpace.<locals>.FreeSpace object at 0x7f9460e6bcf8>' (10716753920.000000)
2018-08-09 19:17:19,296 DEBUG dir '/' needs '10485760' of '<DistUpgrade.DistUpgradeCache.MyCache.checkFreeSpace.<locals>.FreeSpace object at 0x7f9460e6bd30>' (1110441984.000000)
2018-08-09 19:17:19,296 DEBUG dir '/tmp' needs '0.0' of '<DistUpgrade.DistUpgradeCache.MyCache.checkFreeSpace.<locals>.FreeSpace object at 0x7f9460e6bcf8>' (10711511040.000000)
2018-08-09 19:17:19,296 DEBUG dir '/usr' needs '0.0' of '<DistUpgrade.DistUpgradeCache.MyCache.checkFreeSpace.<locals>.FreeSpace object at 0x7f9460e6bd68>' (5869737984.000000)

Could you provide some information regarding how your disk and partitions are setup? Thanks in advance!

Changed in ubuntu-release-upgrader (Ubuntu):
importance: Undecided → High
Changed in ubuntu-release-upgrader (Ubuntu):
status: New → Incomplete
Brian Murray (brian-murray) wrote :

Looking at the code it seems pretty obvious that we shouldn't use a negative number for the space needed in /usr.

summary: - Updater doesn't check size of partitions.
+ free space need for /usr could be negative which is wrong
Changed in ubuntu-release-upgrader (Ubuntu):
status: Incomplete → In Progress
assignee: nobody → Brian Murray (brian-murray)
Carlo Wood (carlo-alinoe) wrote :

Note sure if this is the info you wanted,

sean:~>df -h
Filesystem Size Used Avail Use% Mounted on
udev 16G 0 16G 0% /dev
tmpfs 3,2G 2,0M 3,2G 1% /run
/dev/sda5 2,3G 964M 1,2G 45% /
/dev/sda6 19G 16G 1,9G 90% /usr
tmpfs 16G 441M 16G 3% /dev/shm
tmpfs 5,0M 12K 5,0M 1% /run/lock
tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/sdb3 56G 26G 27G 50% /SSD2
/dev/sda3 454M 162M 265M 38% /boot
/dev/sda7 9,1G 6,8G 1,8G 80% /usr/local
/dev/sda9 5,4G 2,5G 2,7G 48% /var
/dev/sdc1 148G 96G 45G 69% /usr/src
tmpfs 1,0G 11M 1014M 1% /var/tmp
tmpfs 10G 3,3M 10G 1% /tmp
/dev/mapper/ata-WDC_WD5003ABYZ-011FA0_WD-WMAYP0MAMT68-part2_crypt 311G 23G 273G 8% /encrypted
/dev/mapper/ata-WDC_WD40EFRX-68WT0N0_WD-WCC4E7CR9HX8-part1_crypt 433G 329G 83G 80% /opt
/dev/mapper/ata-WDC_WD40EFRX-68WT0N0_WD-WCC4E7CR9HX8-part2_crypt 3,2T 1,9T 1,2T 63% /opt/verylarge
/dev/mapper/ata-OCZ-VERTEX4_OCZ-5T94F27KZ830YPJT-part8_crypt 14G 12G 1,5G 89% /home
tmpfs 3,2G 28K 3,2G 1% /run/user/1000

To post a comment you must log in.