Public bug reported:
Merge request: https://code.launchpad.net/~chris-
bainbridge/ubuntu/+source/casper/+git/casper/+merge/512434
Bug report: Shutdown I/O errors after removing the Ubuntu live
installation medium
Affected image
--------------
stonking-desktop-amd64v3.iso
ISO volume label: Ubuntu 26.10 amd64
Summary
-------
When the live installer reaches “Please remove the installation medium, then
press Enter.”, removing the optical medium and continuing can cause shutdown
hooks to read files that are still backed by the medium. This produces optical
device and SquashFS I/O errors and can prevent the reboot from completing.
Reproduction
------------
1. Boot the original ISO in a VM with an empty disk and the ISO attached as a
CD-ROM. No installer run is required.
2. At Casper's request, eject/disconnect the CD-ROM.
3. Press Enter to continue shutdown/reboot.
Observed result
---------------
The original image reproduced reads failing from /dev/sr0 and the loop device
backed by it, followed by SquashFS read errors. The system-shutdown
mdadm.shutdown hook failed, with the mdadm process exiting with status 139.
The missing-medium errors can prevent a clean reboot.
Expected result
---------------
After the medium is removed, shutdown hooks should be able to complete without
reading uncached files from the optical device, and the machine should reboot
without media-related I/O or SquashFS errors.
Root cause
----------
Casper's /sbin/casper-stop attempts to warm the page cache before asking for
the medium to be removed. Its file-reading loop used:
echo -n >> "$path"
This appends no data and does not read the file contents, so it does not warm
their data into the page cache. In addition, the pre-eject cache list omitted
files needed by the late shutdown mdadm hook, including
/usr/lib/systemd/system-shutdown/mdadm.shutdown, /usr/sbin/mdadm, /etc/mdadm,
and /usr/bin/dash. Once the medium is removed, those uncached reads fail
through the loop-mounted SquashFS filesystem.
Fix
---
In casper-stop, replace the no-op append with an actual read:
cat "$path" > /dev/null
Also include the late-shutdown files and directories in the cache list:
/usr/lib/systemd/system-shutdown
/usr/sbin/mdadm
/etc/mdadm
/usr/bin/dash
Validation
----------
The issue was reproduced with the original ISO in QEMU by ejecting the virtual
CD-ROM at Casper's removal prompt. A rebuilt image with the fix was tested the
same way: it produced no /dev/sr0 or loop-device I/O errors, no SquashFS read
errors, and systemd reached “reboot: Restarting system”.
The test did not run the installer or validate reboot behavior on physical
firmware. Other shutdown-helper warnings were observed in QEMU;
they were separate from the reproduced post-eject I/O failure.
** Affects: casper (Ubuntu)
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2169202
Title:
Shutdown I/O errors after removing the Ubuntu live installation medium
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/casper/+bug/2169202/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs