UC20 amd64 images are unnecessarily big

Bug #1905990 reported by Łukasz Zemczak
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
livecd-rootfs (Ubuntu)
Fix Released
Medium
Łukasz Zemczak
Focal
Fix Released
Undecided
Unassigned

Bug Description

[Impact]

To work-around a bug in ubuntu-image, we hard-coded a `--image-size 8G` in livecd-rootfs for UC20 image builds. The reason for that was that ubuntu-image, in its initial UC20 image build implementation, was skipping yet-to-be-created partitions while calculating the final image size. This was fixed in ubuntu-image 1.10, and now the workaround is no longer required.
Additionally, the HWE team asked if it would be possible for the amd64 images to be smaller than 8GB as they need them to fit on 4GB storage. Without the hard-coded image size the UC20 images are around 3.1GB in size - which would be perfect for their needs.

That being said, after some additional discussion, we decided to still hard-code the size, but to a smaller value - same as we do for UC18 and UC16. This is to make sure there's enough writable disk space for normal usage.

[Test case]

Build a -proposed based UC20 focal amd64 image via live-build. Download the image, decompress it and run `parted <imagefile>`. Print the partition table and make sure that the image is now big enough for all the contents (so at least 3GB) but smaller than the previous hard-coded size (8GB).

[What could go wrong]

Right now there's no real places where things could go wrong. If anything, the size wouldn't be modified, but this is something we test for in the test case. Image build failures in case of busted bash syntax, but we'd see that instantly as well.

Revision history for this message
Łukasz Zemczak (sil2100) wrote :

This does not affect groovy as we do not build any UC20 images there. So no need to backport the fix there.

Changed in livecd-rootfs (Ubuntu Groovy):
status: New → Invalid
Changed in livecd-rootfs (Ubuntu Focal):
status: New → In Progress
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Both hirsute and focal changes have been pushed to the git repositories. I'll wait a few days to see if there are any other changes that might want to be batched up with this one.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package livecd-rootfs - 2.703

---------------
livecd-rootfs (2.703) hirsute; urgency=medium

  * Do not hard-code the UC20 amd64 image size as now ubuntu-image should be
    able to properly calculate the needed size itself (LP: #1905990).

 -- Łukasz 'sil2100' Zemczak <email address hidden> Fri, 27 Nov 2020 17:39:29 +0100

Changed in livecd-rootfs (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Pushed a modified version to focal-proposed. We decided to hardcode the previous, smaller size (3.7 GB) instead. The same change has been pushed to the hirsute master branch - not released, as we do not really build any real images on hirsute (there's the test UC22 images, but oh well). The change will be released with the next batch of livecd-rootfs changes.

description: updated
Revision history for this message
Steve Langasek (vorlon) wrote : Please test proposed package

Hello Łukasz, or anyone else affected,

Accepted livecd-rootfs into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/livecd-rootfs/2.664.10 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in livecd-rootfs (Ubuntu Focal):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-focal
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Ran a Proposed enabled livefs build of focal ubuntu-core:
https://launchpad.net/~ubuntu-cdimage/+livefs/ubuntu/focal/ubuntu-core/+build/250328

Via the logs it can be seen that the right livecd-rootfs version is used (2.664.10). After downloading the image:
$ unxz livecd.ubuntu-core.img.xz
$ LC_ALL=C parted livecd.ubuntu-core.img
WARNING: You are not superuser. Watch out for permissions.
GNU Parted 3.3
Using /home/sil2100/Pobrane/livecd.ubuntu-core.img
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: (file)
Disk /home/sil2100/Pobrane/livecd.ubuntu-core.img: 3880MB
(...)

Image size is less than 4GB - good!

tags: added: verification-done verification-done-focal
removed: verification-needed verification-needed-focal
Mathew Hodson (mhodson)
no longer affects: livecd-rootfs (Ubuntu Groovy)
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for livecd-rootfs has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package livecd-rootfs - 2.664.10

---------------
livecd-rootfs (2.664.10) focal; urgency=medium

  * Do not hard-code the UC20 amd64 image size to 8GB as now ubuntu-image
    should be able to properly calculate the needed size itself.
  * But per discussion, we might want to keep the UC20 images a bit bigger than
    what's defined via the gadget/rootfs contents, to make sure writable is
    comfortably big enough. Use the same hard-coded value as for UC16 and UC18.
    (LP: #1905990)

livecd-rootfs (2.664.9) focal; urgency=medium

   [ John Chittum]
   * Backport Ensure toolsVersion set in vmdk header (LP: #1893898)

   [ Dimitri John Ledkov & Joshua Powers ]
   * amd64: always install grub-pc with shim-signed (LP: #1901906), and
     ensure to autoremove packages

 -- Łukasz 'sil2100' Zemczak <email address hidden> Fri, 27 Nov 2020 17:58:38 +0100

Changed in livecd-rootfs (Ubuntu Focal):
status: Fix Committed → Fix Released
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.