Resize error when installing alongside

Bug #1991083 reported by fossfreedom
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ubiquity (Ubuntu)
Fix Released
High
Adrien Nader

Bug Description

Using UB 22.10 beta - on a 20GB virtualdisk (virtualbox).

Installed UB full install successfully

Next test was the resize test in the QA tracker - moved the slider all the way to the left allocating 10.2 GB for the left side OS. Immediately on install I saw a resize failed error.

Repeated this twice so far

ProblemType: Bug
DistroRelease: Ubuntu 22.10
Package: ubiquity 22.10.6 [modified: lib/partman/automatically_partition/question]
ProcVersionSignature: Ubuntu 5.19.0-15.15-generic 5.19.0
Uname: Linux 5.19.0-15-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.23.0-0ubuntu2
Architecture: amd64
CasperMD5CheckResult: pass
CasperVersion: 1.475
CurrentDesktop: Budgie:GNOME
Date: Wed Sep 28 09:19:55 2022
InstallCmdLine: BOOT_IMAGE=/casper/vmlinuz file=/cdrom/preseed/ubuntu-budgie.seed maybe-ubiquity quiet splash ---
LiveMediaBuild: Ubuntu-Budgie 22.10 "Kinetic Kudu" - Beta amd64 (20220927.1)
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: ubiquity
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Revision history for this message
fossfreedom (fossfreedom) wrote :
Revision history for this message
fossfreedom (fossfreedom) wrote :

Same issue on Jammy - so not a new issue for kinetic. Sizing calculations seem to be mismatched (ISO vs storage) I presume.

Revision history for this message
Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu ISO testing tracker.

A list of all reports related to this bug can be found here:
https://iso.qa.ubuntu.com/qatracker/reports/bugs/1991083

tags: added: iso-testing
Revision history for this message
Brian Murray (brian-murray) wrote :

From UbiquitySyslog.txt:

Sep 28 09:19:05 ubuntu-budgie ubiquity: /dev/sda3: 226050/1277952 files (0.1% non-contiguous), 2489274/5110784 blocks
Sep 28 09:19:05 ubuntu-budgie ubiquity: resize2fs 1.46.5 (30-Dec-2021)
Sep 28 09:19:05 ubuntu-budgie ubiquity: resize2fs
Sep 28 09:19:05 ubuntu-budgie ubiquity: :
Sep 28 09:19:05 ubuntu-budgie ubiquity: New size smaller than minimum (2582237)
Sep 28 09:19:05 ubuntu-budgie ubiquity:
Sep 28 09:19:05 ubuntu-budgie partman: Error resizing the ext2/ext3/ext4 file system
Sep 28 09:19:09 ubuntu-budgie ubiquity[5714]: Reverting lockdown of the desktop environment.
Sep 28 09:19:09 ubuntu-budgie activate-dmraid: No Serial ATA RAID disks detected
Sep 28 09:19:09 ubuntu-budgie ubiquity[5714]: switched to page partman
Sep 28 09:19:09 ubuntu-budgie ubiquity[5714]: Traceback (most recent call last):
Sep 28 09:19:09 ubuntu-budgie ubiquity[5714]: File "/usr/lib/ubiquity/ubiquity/misc.py", line 184, in grub_options
Sep 28 09:19:09 ubuntu-budgie ubiquity[5714]: for disk in p.disks():
Sep 28 09:19:09 ubuntu-budgie ubiquity[5714]: File "/usr/lib/ubiquity/ubiquity/parted_server.py", line 161, in disks
Sep 28 09:19:09 ubuntu-budgie ubiquity[5714]: return sorted(os.listdir(devices))
Sep 28 09:19:09 ubuntu-budgie ubiquity[5714]: FileNotFoundError: [Errno 2] No such file or directory: '/var/lib/partman/devices'
Sep 28 09:19:09 ubuntu-budgie ubiquity[5714]:
Sep 28 09:19:09 ubuntu-budgie ubiquity[5714]: Traceback (most recent call last):
Sep 28 09:19:09 ubuntu-budgie ubiquity[5714]: File "/usr/lib/ubiquity/ubiquity/misc.py", line 225, in boot_device
Sep 28 09:19:09 ubuntu-budgie ubiquity[5714]: for disk in p.disks():
Sep 28 09:19:09 ubuntu-budgie ubiquity[5714]: File "/usr/lib/ubiquity/ubiquity/parted_server.py", line 161, in disks
Sep 28 09:19:09 ubuntu-budgie ubiquity[5714]: return sorted(os.listdir(devices))
Sep 28 09:19:09 ubuntu-budgie ubiquity[5714]: FileNotFoundError: [Errno 2] No such file or directory: '/var/lib/partman/devices'
Sep 28 09:19:09 ubuntu-budgie ubiquity[5714]:
Sep 28 09:19:09 ubuntu-budgie ubiquity[5714]: Traceback (most recent call last):
Sep 28 09:19:09 ubuntu-budgie ubiquity[5714]: File "/usr/lib/ubiquity/ubiquity/misc.py", line 184, in grub_options
Sep 28 09:19:09 ubuntu-budgie ubiquity[5714]: for disk in p.disks():
Sep 28 09:19:09 ubuntu-budgie ubiquity[5714]: File "/usr/lib/ubiquity/ubiquity/parted_server.py", line 161, in disks
Sep 28 09:19:09 ubuntu-budgie ubiquity[5714]: return sorted(os.listdir(devices))
Sep 28 09:19:09 ubuntu-budgie ubiquity[5714]: FileNotFoundError: [Errno 2] No such file or directory: '/var/lib/partman/devices'
Sep 28 09:19:09 ubuntu-budgie ubiquity[5714]:
Sep 28 09:19:09 ubuntu-budgie ubiquity[5714]: switched to page partman
Sep 28 09:19:10 ubuntu-budgie partman: No matching physical volumes found

Changed in ubiquity (Ubuntu):
importance: Undecided → High
milestone: none → ubuntu-22.10
tags: added: foundations-triage-discuss
tags: added: fr-2732
tags: added: foundations-todo
removed: foundations-triage-discuss fr-2732
Revision history for this message
Adrien Nader (adrien) wrote :

tl;dr: add a 10% margin to the current minimal size estimate

As far as I can tell, the issue originates in get_ext2_resize_range() in ubiquity/d-i/source/partman-partitioning/lib/resize.sh . The function parses the output from `tune2fs -l` in order to find the total number of blocks and the number of free blocks; it then uses the difference as the number of used blocks which gets multiplied by the block size to get the used space.

However, resize2fs disagrees. It also outputs the minimal number of blocks which is a fair bit higher than what had been computed by get_ext2_resize_range(). Resize2fs provides an estimate and it might be wrong but since obviously it is not going to accept anything lower than what is has determined, there is little point in not using its output value.

Unfortunately, resize2fs errors out immediately if the filesystem has not been unmounted cleanly (enough?). I don't know how ubiquity handles resizing of partition that need fsck first but in any case, I don't want to add code to run fsck before giving a size estimate.

Moreover, I don't think that it makes sense to use the absolute smallest size possible. The fact the user resizes the existing partition rather than overwriting it denotes a will to keep the other system working. If it gets shrunk so much that there is no free space, it's not going to be working well anymore. That can't be the user's intent.

I believe it is best to keep the current estimate but so something like multiplying it by 1.1 or even 1.05. The current estimate is quite off compared to what resize2fs outputs so it might need a bit of improvement too. I'll try to gather stats for various filesystems.

I haven't checked yet if that applied to anything else than ext* filesystems.

Adrien Nader (adrien)
Changed in ubiquity (Ubuntu):
status: New → Incomplete
status: Incomplete → In Progress
assignee: nobody → Adrien Nader (adrien-n)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubiquity - 22.10.9

---------------
ubiquity (22.10.9) kinetic; urgency=medium

  * partman/resize: add a margin to the minimal size for partition shrinking
    (LP: #1991083)

 -- Adrien Nader <email address hidden> Wed, 12 Oct 2022 10:14:27 +0000

Changed in ubiquity (Ubuntu):
status: In Progress → Fix Released
tags: removed: foundations-todo
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.