[Bug 2125827] Re: Jammy grub2 failed to detect 2nd virtio disk
Lukas Märdian
2125827 at bugs.launchpad.net
Wed Oct 1 08:53:36 UTC 2025
I Can reproduce everything you said above on Ubuntu 24.04 (Noble):
# Prepare images:
uvt-simplestreams-libvirt --verbose sync --source http://cloud-images.ubuntu.com/daily arch=amd64 label=daily release=focal
uvt-simplestreams-libvirt --verbose sync --source http://cloud-images.ubuntu.com/daily arch=amd64 label=daily release=jammy
uvt-kvm create --password=ubuntu f arch=amd64 label=daily release=focal
uvt-kvm create --password=ubuntu j arch=amd64 label=daily release=jammy
# Allow to enter the GRUB menu inside the images:
uvt-kvm ssh f
sudo vim /etc/default/grub.d/50-cloudimg-settings.cfg
GRUB_TIMEOUT=10
GRUB_TIMEOUT_STYLE=menu
sudo update-grub
uvt-kvm ssh j
sudo vim /etc/default/grub.d/50-cloudimg-settings.cfg
GRUB_TIMEOUT=10
GRUB_TIMEOUT_STYLE=menu
sudo update-grub
# Create a virtual machine with two disks, both using virtio.
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 \
-boot menu=on -nographic -serial mon:stdio
# Inside the GRUB menu, hit "c":
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)
=> We can only see hd0
# Create a virtual machine with two disks: one using virtio and the
other using SATA.
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,menu=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 ich9-ahci,id=ahci0,bus=pcie.0,addr=0x3 \
-device ide-hd,drive=libvirt-2-format,id=ide-disk1,bus=ahci0.0 \
-nographic -serial mon:stdio
# Inside the GRUB menu, hit "c":
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 hd0 and hd1!
# Original VM with 2 virtio disks. With "-boot strict=on" but without
",bootindex=1":
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 \
-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 \
-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!
# Original VM with 2 virtio disks. Without "-boot strict=on" but with ",bootindex=1":
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 \
-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 \
-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.
When swapping the f.qcow and j.qcow images to have the primary image be
Jammy, using GRUB 2.06 I can confirm the very same behavior, so I think
this is unrelated to GRUB.
--
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:
New
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