This bug has been migrated to another issue tracking site. It has been closed here and may no longer be being monitored.

If you would like to get updates for this issue, or to participate in it, you may do so at Red Hat Issue Tracker .
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2168245 - [seabios] Can't boot from a disk with 4K sector size
Summary: [seabios] Can't boot from a disk with 4K sector size
Keywords:
Status: CLOSED MIGRATED
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: seabios
Version: 9.1
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Gerd Hoffmann
QA Contact: Xueqiang Wei
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-02-08 14:55 UTC by Jiri Kortus
Modified: 2023-09-22 13:47 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-09-22 13:47:12 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)
machine.xml (5.46 KB, text/plain)
2023-02-08 15:58 UTC, Jiri Kortus
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker   RHEL-7110 0 None Migrated None 2023-09-22 14:14:01 UTC
Red Hat Issue Tracker RHELPLAN-147990 0 None None None 2023-02-08 14:58:25 UTC

Description Jiri Kortus 2023-02-08 14:55:28 UTC
Description of problem:
It is not possible to boot from a disk with physical/logical sector size of 4096 bytes. The disk is listed in the boot order configuration section of a VM in VirtManager (as well as in the VM XML configuration obtained via virsh dumpxml), however once the VM is started, this disk is ignored completely. The VM doesn't attempt to boot from it and it is not even listed in the available boot devices shown upon VM start.

However, the disk is available to the VM and can be used for installation.

Version-Release number of selected component (if applicable):
libvirt-8.5.0-7.el9_1.x86_64, qemu-kvm-7.0.0-13.el9.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Create a VM with one disk, modify the configuration via virsh edit, so that the disk uses 4K physical and logical block sizes by inserting blockio element into the <disk> configuration:
   <blockio logical_block_size='4096' physical_block_size='4096'/>
2. Enable the boot menu on machine start and make sure the disk is selected as one of the available boot devices
3. Start the VM and observe the boot menu.

Actual results:
The disk is not available as a boot device and the VM won't boot from it. It can also be seen in the configuration XML that there is boot order set for the disk.

Expected results:
The disk is available for boot - both for manual selection in the menu and for automated boot based on the configured boot order.

Comment 1 Jiri Kortus 2023-02-08 15:58:14 UTC
Created attachment 1942914 [details]
machine.xml

Comment 2 Peter Krempa 2023-02-09 12:27:33 UTC
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?

Comment 3 Jiri Kortus 2023-02-16 17:19:06 UTC
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

Comment 6 Peter Krempa 2023-02-16 18:08:43 UTC
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.

Comment 7 qing.wang 2023-03-01 09:39:00 UTC
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

Comment 8 aihua liang 2023-03-03 09:22:32 UTC
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

Comment 9 Vivek Goyal 2023-03-08 21:47:38 UTC
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.

Comment 19 Gerd Hoffmann 2023-04-14 13:32:23 UTC
test build:
https://kojihub.stream.centos.org/koji/taskinfo?taskID=2126701

Comment 21 Gerd Hoffmann 2023-05-03 09:06:21 UTC
new scratch build
https://kojihub.stream.centos.org/koji/taskinfo?taskID=2175528

Comment 24 Gerd Hoffmann 2023-05-16 11:01:48 UTC
Turned out to be a build problems, patches where not actually applied ...
New test build: https://kojihub.stream.centos.org/koji/taskinfo?taskID=2224284

Comment 25 Xueqiang Wei 2023-05-23 03:33:52 UTC
(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

Comment 28 RHEL Program Management 2023-09-22 13:24:03 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.


Note You need to log in before you can comment on or make changes to this bug.