[Bug 2125827] Re: Jammy grub2 failed to detect 2nd virtio disk
Lukas Märdian
2125827 at bugs.launchpad.net
Wed Oct 1 09:25:08 UTC 2025
Thank you very much for reporting this bug!
Considering your finding from comment #1 about the combination of
"strict=on" and "bootindex=1", I think we're seeing the expected
behavior on Jammy and Noble.
I found this upstream commit introducing the "strict" option:
https://gitlab.com/qemu-project/qemu/-/commit/c8a6ae8bb95477d5ac11d9b491b603b2d190a96e
It describes it as:
"Qemu can add "HALT" at the end of bootindex string, then
seabios will halt booting after trying to boot from all
selected devices."
This means if the (non-default) "strict=on" option is specified, it will
only try to boot from the explicitly specified locations in the order
given by "bootindex". I confirmed this by adding a "bootindex=2" to the
2nd virtio disks, which makes it show up in GRUB (see below).
This means the "issue" you're seeing on Jammy is a configuration
problem, e.g. you should drop "strict=on" or add "bootindex=2" to your
2nd disk. Whereas the behavior on Focal is broken, or might just not
have been fully implemented back then.
Considering Focal is already past the end of its standard support, I'm
marking this bug as WONTFIX for Focal and Invalid for Jammy and above
(things are working as expected).
Please re-open and reply with your rationale if you think otherwise.
# Create a virtual machine with two disks, both using virtio. With
"strict=on" and "bootindex=1" and "bootindex=2":
sudo /usr/bin/qemu-system-x86_64 \
-machine q35,accel=kvm,usb=off,vmport=off,dump-guest-core=off \
-cpu host \
-m 2048 \
-smp 1 \
-nodefaults \
-boot strict=on \
-blockdev '{"driver":"file","filename":"/var/lib/uvtool/libvirt/images/f.qcow","node-name":"libvirt-1-storage"}' \
-blockdev '{"node-name":"libvirt-1-format","driver":"qcow2","file":"libvirt-1-storage"}' \
-device virtio-blk-pci,drive=libvirt-1-format,id=virtio-disk0,addr=0x2,bootindex=1 \
-blockdev '{"driver":"file","filename":"/var/lib/uvtool/libvirt/images/j.qcow","node-name":"libvirt-2-storage"}' \
-blockdev '{"node-name":"libvirt-2-format","driver":"qcow2","file":"libvirt-2-storage"}' \
-device virtio-blk-pci,drive=libvirt-2-format,id=virtio-disk1,addr=0x3,bootindex=2 \
-boot menu=on -nographic -serial mon:stdio
GNU GRUB version 2.04
Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists possible
device or file completions. ESC at any time exits.
grub> ls
(hd0) (hd0,gpt15) (hd0,gpt14) (hd0,gpt1) (hd1) (hd1,gpt15) (hd1,gpt14) (hd1,gpt
1)
=> We can see both disks!
** Changed in: grub2 (Ubuntu)
Status: New => Invalid
** Also affects: grub2 (Ubuntu Focal)
Importance: Undecided
Status: New
** Also affects: qemu (Ubuntu Focal)
Importance: Undecided
Status: New
** Changed in: qemu (Ubuntu)
Status: New => Invalid
** Changed in: qemu (Ubuntu Focal)
Assignee: (unassigned) => Lukas Märdian (slyon)
** Changed in: qemu (Ubuntu)
Assignee: (unassigned) => Lukas Märdian (slyon)
** Changed in: qemu (Ubuntu Focal)
Status: New => Won't Fix
** Changed in: grub2 (Ubuntu Focal)
Status: New => Invalid
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to grub2 in Ubuntu.
https://bugs.launchpad.net/bugs/2125827
Title:
Jammy grub2 failed to detect 2nd virtio disk
Status in grub2 package in Ubuntu:
Invalid
Status in qemu package in Ubuntu:
Invalid
Status in grub2 source package in Focal:
Invalid
Status in qemu source package in Focal:
Won't Fix
Bug description:
I am using qemu-system-x86_64 on Jammy to create a VM with two disks, both on the virtio bus.
When I enter the GRUB shell and use the "ls" command, only the first virtio disk is listed.
However, if I change the second disk to the SATA bus, GRUB can recognize the second disk.
Steps and result
Jammy: https://paste.ubuntu.com/p/TXjzbcXG5z/
This issue cannot be reproduced on Focal.
Focal: https://paste.ubuntu.com/p/MF2NKfsTSt/
The impact of this is that chainloading will fail.
/etc/grub.d/25_custom
menuentry "Attached-IDE-Disk" {
set root=(hd1)
insmod linux
insmod chain
chainloader +1
}
I'm not sure whether this is an issue with QEMU or GRUB. Thus, I filed
a bug on grub2 as well.
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/2125826
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/2125827/+subscriptions
More information about the foundations-bugs
mailing list