Skip to content

boot: an overlay is mounted once its NBD device has a size - #28

Merged
aledbf merged 1 commit into
mainfrom
boot/edit-images-without-nbd
Sep 29, 2026
Merged

aledbf merged 1 commit into
mainfrom
boot/edit-images-without-nbd

Conversation

@aledbf

@aledbf aledbf commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

On kvm-runner, every report after the first boot failed with:

sudo mount /dev/nbd0 ...: can't read superblock on /dev/nbd0

A diagnostic run on the runner showed why:

[11109.963] block nbd0: NBD_DISCONNECT                         <- the previous boot's overlay
[11110.415] EXT4-fs (nbd0): unable to read superblock          <- our mount, device still 0 bytes
[11110.422] nbd0: detected capacity change from 0 to 2129920   <- the size, 7 ms later

qemu-nbd --connect returns before the kernel knows the device's size. The wait before the mount asked blkid, which answers from its cache: it reported TYPE="ext4" while blockdev --getsize64 returned 0. On a faster host the reconnect usually wins the race, which is why it never showed up locally.

Change: editOverlay now waits for a non-zero size and probes with blkid -p, which bypasses the cache.

Check: with this branch, report.yml on kvm-runner against v20260928.02 went green (run):

task lint passes.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

On the kvm runner, the report's second boot mounted /dev/nbd0 while it still
had zero bytes - qemu-nbd returns before the kernel learns the device's size,
and the capacity change was logged 7 ms after the failed mount ("can't read
superblock"). The wait for a filesystem asked blkid, which answers from its
cache and said ext4 about the empty device. It now waits for a non-zero size
and probes with blkid -p.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@aledbf
aledbf merged commit 8946f67 into main Sep 29, 2026
3 checks passed
@aledbf
aledbf deleted the boot/edit-images-without-nbd branch September 29, 2026 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant