Bugzilla – Bug 1217816
partx is unable to read partition table
Last modified: 2024-03-05 00:38:53 UTC
Created attachment 871160 [details] kvm_image_s390x.log Both on Marble and Dolomite s390x KVM and DASD images partx (included in the parted package) is unable to parse the partition table. I'm attaching one of the logs as an example. This does not happen on SLE, we were wondering if there are patches on the SLE version of the package that were not included in Factory and hence in ALP. Could you please have a look?
I'm also adding that the current ALP parted comes from Factory
The important lines in the log are: [ 217s] [ DEBUG ]: 10:28:18 | EXEC: [partx --add /dev/loop0] [ 217s] [ DEBUG ]: 10:28:18 | EXEC: Failed with stderr: partx: /dev/loop0: failed to read partition table [ 217s] , stdout: (no output on stdout) partx is failing and there are two possible reasons for it: - partx has been changed - kernel 6.4 has a change Please Arvin and Hannes comment on this.
You seem to have another log. I do not see the error above but: [ 424s] [ DEBUG ]: 08:08:32 | EXEC: [bash -c cat /var/tmp/kiwi_truhknlo | fdisk /dev/loop0] [ 425s] [ DEBUG ]: 08:08:32 | EXEC: Failed with stderr: Re-reading the partition table failed.: Invalid argument [...] So here fdisk is reporting the error. Anyway, partx is not part of parted but util-linux. When was the last time this worked (to narrow down the changes)?
Ihno went offline, so stepping in. The image wasn't build successfully for Micro6 for s390 at all. There is also a log from the image DASD, which contains the message about partx: https://build.suse.de/build/SUSE:ALP:Products:Dolomite:1.0/images/s390x/ALP-Dolomite:Default-dasd/_log
So I can reproduce the problem with fdisk on Tumbleweed. There fdisk tries BLKRRPART on /dev/loop0 and the ioctl returns EINVAL. In general the kernel does support partitions on loop devices. E.g. removing the loop device and setting it up with the -P option I get /dev/loop0p1.
OK, the errors from fdisk are ignored and likely not the problem since partx is called later and works (in the logs attached here). In the logs from comment #5 partx fails on a loop device after using fdasd. In the util-linux sources I found this: - (!) add support for dasd PT (used for example on s390) https://github.com/util-linux/util-linux/blob/master/Documentation/TODO#L163 So maybe partx simply does not support DASD PTs and never did.
Dasd should be configured via parted (or fdasd from s390-utils).
Hi, let me share my thoughts on this issue: 1. I can reproduce the problem that partx does not really work for partition mapping under several conditions. However kpartx does work and is usually the recommendation I give to people to use kpartx as the mapper. In order to do this you need to provide an /etc/kiwi.yml with the following content: ```yaml mapper: - part_mapper: kpartx ``` To provide it in obs context a simple package that is put into prjconf as support: package-name does the trick. 2. We have integration tests for s390 image builds here: * https://build.opensuse.org/package/show/Virtualization:Appliances:Images:Testing_s390:tumbleweed/test-image-disk The Virtual profile builds for a KVM target the Phyical profile builds for a DASD target in CDL mode. You need to tell kiwi what it should do. So I read one comment that says why is kiwi not using fdasd, well it does if you tell it the target. The target specification can be set via targettype="CDL" Please find the image description for this integration test here: * https://github.com/OSInside/kiwi/blob/master/build-tests/s390/tumbleweed/test-image-disk/appliance.kiwi As a summary I believe the non working partx is not something kiwi can fix. The available settings on the kiwi side should provide a way to overcome the hurdle as the integration tests shows. Hope this helps
Thanks Marcus for helping. Jiri submitted https://build.suse.de/request/show/314878 and SLE Micro 6.0 prjconf was modified accordingly. The failed s390x images will be available on next SLE Micro 6.0 release.
So, here's the gist: - parted contains support for DASDs - kpartx (from multipath-tools) contains support for DASDs - partx (from util-linux) does _not_ contain support for DASDs We sure can spend time on implementing DASD support in partx. But that means updating util-linux, upstreaming it, fighting with maintainers, yadda yadda. In short: won't be upstream before easter next year. So faster approach is to tell Kiwi not to use partx.
Additionally the BLKRRPART ioctl does not work on loop devices. Also see bug #896485 for missing support for DASD PT in util-linux.
What's the right solution here? Can you put into docs for creating images, that s390 must use kpartx?