coreos-assembler: OSBuild without compression yields GRUB failures
When we switched OSbuild over to not compressing we started getting failures where images wouldn’t boot like:
Booting `Fedora CoreOS 40.20240207.dev.1 (ostree:0)'
error: ../../grub-core/fs/fshelp.c:257:file
`/boot/ostree/fedora-coreos-f25027bf4dfb2213
7b7c8401ed2396924ba112482afc30d62b7a4ab1310b09db/vmlinuz-6.8.0-0.rc0.20240112gi
t70d201a40823.5.fc40.x86_64' not found.
error: ../../grub-core/loader/i386/pc/linux.c:422:you need to load the kernel
first.
Press any key to continue...
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 25 (15 by maintainers)
Commits related to this issue
- supermin: don't cd $workdir in supermin-init-prelude I've been investigating why a seemingly innocuous change (changing compression on OSBuild generated qemu qcow2) would cause disk images to not boo... — committed to dustymabe/coreos-assembler by dustymabe 3 years ago
- osbuild: disable internal compression for qemu qcow2 We previously did this in a different way (2a8d1e6) but then had to revert it (39fdd61) because it caused images to not boot [1]. The root cause a... — committed to dustymabe/coreos-assembler by dustymabe 3 years ago
- supermin: don't cd $workdir in supermin-init-prelude I've been investigating why a seemingly innocuous change (changing compression on OSBuild generated qemu qcow2) would cause disk images to not boo... — committed to dustymabe/coreos-assembler by dustymabe 3 years ago
- osbuild: disable internal compression for qemu qcow2 We previously did this in a different way (2a8d1e6) but then had to revert it (39fdd61) because it caused images to not boot [1]. The root cause a... — committed to dustymabe/coreos-assembler by dustymabe 3 years ago
- mantle/platform/qemu: use cache=never for virtiofsd Still trying to figure out data corruption from https://github.com/coreos/coreos-assembler/issues/3728 — committed to dustymabe/coreos-assembler by dustymabe 3 years ago
- mantle/platform/qemu: use cache=never for virtiofsd Still trying to figure out data corruption from https://github.com/coreos/coreos-assembler/issues/3728 — committed to dustymabe/coreos-assembler by dustymabe 3 years ago
- cmdlib: use ext4 for cache qcow2 We think there might be some XFS reflink issues when we run the OSBuild org.osbuild.qemu stage compression: false. See https://github.com/coreos/coreos-assembler/issu... — committed to dustymabe/coreos-assembler by dustymabe 3 years ago
- osbuild: disable internal compression for qemu qcow2 We previously did this in a different way (2a8d1e6) but then had to revert it (39fdd61) because it caused images to not boot [1]. The root cause a... — committed to dustymabe/coreos-assembler by dustymabe 3 years ago
- cmdlib: use ext4 for cache qcow2 We think there might be some XFS reflink issues when we run the OSBuild org.osbuild.qemu stage compression: false. See https://github.com/coreos/coreos-assembler/issu... — committed to dustymabe/coreos-assembler by dustymabe 3 years ago
- osbuild: disable internal compression for qemu qcow2 We previously did this in a different way (2a8d1e6) but then had to revert it (39fdd61) because it caused images to not boot [1]. The root cause a... — committed to dustymabe/coreos-assembler by dustymabe 3 years ago
- cmdlib: use ext4 for cache qcow2 We think there might be some XFS reflink issues when we run the OSBuild org.osbuild.qemu stage compression: false. See https://github.com/coreos/coreos-assembler/issu... — committed to dustymabe/coreos-assembler by dustymabe 3 years ago
- osbuild: disable internal compression for qemu qcow2 We previously did this in a different way (2a8d1e6) but then had to revert it (39fdd61) because it caused images to not boot [1]. The root cause a... — committed to dustymabe/coreos-assembler by dustymabe 3 years ago
- stages/qemu: sanity check created image I'm having a lot of trouble investigating [1]. Let's add this here as a small sanity check for now. [1] https://github.com/coreos/coreos-assembler/issues/3728 — committed to dustymabe/osbuild by dustymabe 3 years ago
- set compression to false for a test Let's see if we can reproduce https://github.com/coreos/coreos-assembler/issues/3728 — committed to dustymabe/osbuild by dustymabe 3 years ago
- stages/qemu: sanity check created image I'm having a lot of trouble investigating [1]. Let's add this here as a small sanity check for now. [1] https://github.com/coreos/coreos-assembler/issues/3728 — committed to dustymabe/osbuild by dustymabe 3 years ago
- set compression to false for a test Let's see if we can reproduce https://github.com/coreos/coreos-assembler/issues/3728 — committed to dustymabe/osbuild by dustymabe 3 years ago
- supermin: don't cd $workdir in supermin-init-prelude I've been investigating why a seemingly innocuous change (changing compression on OSBuild generated qemu qcow2) would cause disk images to not boo... — committed to coreos/coreos-assembler by dustymabe 3 years ago
- cmdlib: use ext4 for cache qcow2 We think there might be some XFS reflink issues when we run the OSBuild org.osbuild.qemu stage compression: false. See https://github.com/coreos/coreos-assembler/issu... — committed to coreos/coreos-assembler by dustymabe 3 years ago
- osbuild: disable internal compression for qemu qcow2 We previously did this in a different way (2a8d1e6) but then had to revert it (39fdd61) because it caused images to not boot [1]. The root cause a... — committed to coreos/coreos-assembler by dustymabe 3 years ago
- xfs: fix SEEK_HOLE/DATA for regions with active COW extents A data corruption problem was reported by CoreOS image builders when using reflink based disk image copies and then converting them to qcow... — committed to kernelci/linux by deleted user 3 years ago
Patch from dchinner:
https://lore.kernel.org/linux-xfs/20240220224928.3356-1-david@fromorbit.com/T/#u
Still trying to craft a simple reproducer though.
Oh, absolutely, the (source) filesystem does matter. I just meant the target filesystem of the copy/convert operation (for qemu.qcow2), which I changed to tmpfs, and still saw the problem.
I do believe that the (seemingly) incorrect hole information for disk.img is XFS-related.
Yes 😃. I’d like to take a moment here and thank you and all the other maintainers of those tools over the years. You’ve truly built something that is load bearing for half of the internet and the world’s economy at this point.
I currently don’t think it’s an issue in qemu-img, but will let you know if that changes.
I do appreciate you weighing in here, though.
So I don’t know if it’s this, but the classic failure mode when you create a disk image and then boot from it shortly afterwards is:
cache=nonemode (which usesO_DIRECT)If this is the scenario, then you need to modify your image creation pipeline so that it does an
fsyncor similar on the disk image before qemu runs.Here’s how virt-builder does that:
https://github.com/libguestfs/guestfs-tools/blob/acebc8b9962a78d36afe01cae78c11410b483248/builder/builder.ml#L803
Talked to @jlebon on this. We think (actually more @jlebon, I was just nodding my head to everything he said) that this might be a bug with reflinks on XFS.
The cache qcow2 is an XFS filesystem and when we switch to not using compression for the
org.osbuild.qemustage we think it enablesqemu-img convertto use reflinks for some of the data ranges in the image (i.e. to share between the sourcerawimage and newly createdqcow2image).i.e. this is a theory that could explain why we see issues only after switching off compression. This particular issue reminded @jlebon of https://github.com/coreos/coreos-assembler/pull/935 which we never fully got to the bottom of.