Bug 2168245
| Summary: | [seabios] Can't boot from a disk with 4K sector size | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 9 | Reporter: | Jiri Kortus <jikortus> | ||||
| Component: | seabios | Assignee: | Gerd Hoffmann <kraxel> | ||||
| Status: | NEW --- | QA Contact: | Xueqiang Wei <xuwei> | ||||
| Severity: | low | Docs Contact: | |||||
| Priority: | low | ||||||
| Version: | 9.1 | CC: | aliang, coli, jinzhao, juzhang, kraxel, kwolf, meili, pkrempa, vgoyal, virt-maint, xuwei | ||||
| Target Milestone: | rc | Keywords: | Triaged | ||||
| Target Release: | --- | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | Type: | Bug | |||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
|
Description
Jiri Kortus
2023-02-08 14:55:28 UTC
Created attachment 1942914 [details]
machine.xml
The XML you've attached has the following two disks:
<disk type='file' device='cdrom'>
<driver name='qemu' type='raw'/>
<source file='/var/lib/libvirt/images/RHEL-9.2.0-20230119.t.4-x86_64-boot.iso'/>
<target dev='sda' bus='sata'/>
<readonly/>
<boot order='1'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/var/lib/libvirt/images/rhel9.0-test'/>
<blockio logical_block_size='4096' physical_block_size='4096'/>
<target dev='sdb' bus='sata'/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk>
The second device does not actually set the '<boot order=' thus it's not bootable. Not marking it as bootable also in certain cases causes that it is not included in the boot menu as the device does not get activated firmware/bios.
Additionally the above XML doesn't even work as discussed in 2168247, due to the issue of 4k sectors not really working with sata/ide disks.
Did you attach the correct XML?
Sorry for providing you with a wrong XML. I reproduced this problem again and will attach a proper XML - with just one disk with 4K/4K physical/logical block sizes and boot order value set:
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/var/lib/libvirt/images/rhel9.0.qcow2'/>
<blockio logical_block_size='4096' physical_block_size='4096'/>
<target dev='vda' bus='virtio'/>
<boot order='1'/>
<address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
</disk>
I also noticed I didn't mention properly the necessary configuration detail (sector sizes) in bug description, so I'm going to update it accordingly.
Thank you,
Jirka
So your problem is that 4k sectors are not supported with legacy bios-based VMs by the seabios firmware.
Seabios prints the following:
virtio-blk 04:00.0 block size 4096 is unsupported
On the debug console which I enabled by adding:
<serial type='file'>
<source path='/tmp/debugcon.log'/>
<target type='isa-debug' port='1'>
<model name='isa-debugcon'/>
</target>
<alias name='serial1'/>
<address type='isa' iobase='0x402'/>
</serial>
Justification is here. The legacy interface is 512byte only.
https://mail.coreboot.org/pipermail/seabios/2016-April/010596.html
I suggest you use UEFI instead as a workaround which should work. Unfortunately it didn't work for my test VM but that may be corrupted. I'll move this to qemu to assess whether using efi is suitable.
Other possibility is to move to the 'seabios' component as a feature request to do emulation.
The seabios can not read the boot disk when it using logical_block_size=4096,physical_block_size=4096 on it It may works under ovmf -blockdev driver=qcow2,file.driver=file,cache.direct=off,cache.no-flush=on,file.filename=/home/kvm_autotest_root/images/rhel850-new-64-virtio.qcow2,node-name=drive_image1,file.aio=threads -device virtio-blk-pci,id=os,drive=drive_image1,bus=pcie-root-port-3,bootindex=0,logical_block_size=4096,physical_block_size=4096,serial=OS_DISK -blockdev driver=qcow2,file.driver=file,file.filename=/home/kvm_autotest_root/images/data1.qcow2,node-name=data_image1 -device virtio-blk-pci,id=data1,drive=data_image1,bus=pcie-root-port-4,bootindex=1,logical_block_size=4096,physical_block_size=4096,serial=DATA_DISK Hi,Jiri From qing's test result in comment7, 4k sector size works ok under UEFI, you can check it in your test env. Thanks, Aliang Kevin, as we were discussing that 4K sector size is not supported with seabios. So should we close this bug as NOTABUG. It works with UEFI. new scratch build https://kojihub.stream.centos.org/koji/taskinfo?taskID=2175528 Turned out to be a build problems, patches where not actually applied ... New test build: https://kojihub.stream.centos.org/koji/taskinfo?taskID=2224284 (In reply to Gerd Hoffmann from comment #24) > Turned out to be a build problems, patches where not actually applied ... > New test build: > https://kojihub.stream.centos.org/koji/taskinfo?taskID=2224284 Tested it with the scratch build, printing to the screen from threads work well. Found the following string in the screen. hardware setup errors: virtio-blk 04:00.0 block size 4096 is unsupported Versions: kernel-5.14.0-306.el9.x86_64 qemu-kvm-8.0.0-2.el9 seabios-bin-1.16.1-1.el9.bz2168245.20230516.1256.noarch |