LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-25-2023, 10:56 PM   #1
BenCollver
Rogue Class
 
Registered: Sep 2006
Location: OR, USA
Distribution: Slackware64-15.0
Posts: 376
Blog Entries: 2

Rep: Reputation: 172Reputation: 172
kernel 5.15.139 breaks partx -a


I am running Slackware64 15.0 and i updated to kernel 5.15.139 on November 22nd. Today i tried to mount a qemu guest filesystem using the method described below [1]. It failed at "partx -a" with the following output.

partx: /dev/loop0: error adding partition 1

Strace excerpt below [2].

Booting the old kernel 5.15.117 resolved this problem for me.



[1] Presenting guest images as raw image files with FUSE
https://www.qemu.org/2021/08/22/fuse-blkexport/

[2]
openat(AT_FDCWD, "/mnt/fuse/freedos-1.3.fuse", O_RDWR|O_CLOEXEC) = 3
openat(AT_FDCWD, "/dev/loop0", O_RDWR|O_CLOEXEC) = 4
ioctl(4, LOOP_CONFIGURE, {fd=3, block_size=0, info={lo_offset=0, lo_number=0, lo
_flags=0, lo_file_name="/mnt/fuse/freedos-1.3.fuse", ...}}) = 0
close(3) = 0
openat(AT_FDCWD, "/dev/loop0", O_RDONLY) = 3
fadvise64(3, 0, 0, POSIX_FADV_RANDOM) = 0
newfstatat(3, "", {st_mode=S_IFBLK|0660, st_rdev=makedev(0x7, 0), ...}, AT_EMPTY
_PATH) = 0
ioctl(3, BLKGETSIZE64, [8589934592]) = 0
...
lseek(3, 0, SEEK_SET) = 0
read(3, "...", 1024) = 1024
ioctl(3, BLKSSZGET, [512]) = 0
ioctl(3, BLKPG, {op=BLKPG_ADD_PARTITION, flags=0, datalen=152, data={start=32256, length=8587160064, pno=1, devname="", volname=""}}) = -1 EINVAL (Invalid argument)
 
Old 11-26-2023, 11:07 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,339

Rep: Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331Reputation: 2331
AFAIK, 5.15.117 is the latest update for slackware-15.0 on glibc-2.33. 5.15.139 would probably have come from current, which started incrementing glibc. They're now on glibc-2.38. A later glibc would definitely break things. Stay on 5.15.117.
 
Old 11-26-2023, 05:51 PM   #3
BenCollver
Rogue Class
 
Registered: Sep 2006
Location: OR, USA
Distribution: Slackware64-15.0
Posts: 376

Original Poster
Blog Entries: 2

Rep: Reputation: 172Reputation: 172
For the record, i got 5.15.139 through slackpkg.

https://mirrors.slackware.com/slackw...inux-5.15.139/
 
Old 11-26-2023, 06:31 PM   #4
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,381

Rep: Reputation: 4098Reputation: 4098Reputation: 4098Reputation: 4098Reputation: 4098Reputation: 4098Reputation: 4098Reputation: 4098Reputation: 4098Reputation: 4098Reputation: 4098
partx (from util-linux) and kpartx (from multipath-tools) are different programs

You can't use partx the same way as kpartx


Here is a quick-made slackbuild that does the job
kpartx:
https://gitlab.com/maravtdm/slackbui...ultipath-tools

Code:
blackstar :: » qemu-img create -f raw foo.img 20G
Formatting 'foo.img', fmt=raw size=21474836480
blackstar :: » parted -s foo.img \
    'mklabel msdos' \
    'mkpart primary ext4 2048s 100%'
blackstar :: » qemu-img convert -p -f raw -O qcow2 foo.img foo.qcow2 && rm foo.img
    (100.00/100%)
blackstar :: » file foo.qcow2 
foo.qcow2: QEMU QCOW Image (v3), 21474836480 bytes (v3), 21474836480 bytes
blackstar :: » sudo kpartx -l foo.qcow2
blackstar :: » qemu-storage-daemon \
    --blockdev node-name=prot-node,driver=file,filename=foo.qcow2 \
    --blockdev node-name=fmt-node,driver=qcow2,file=prot-node \
    --export \
    type=fuse,id=exp0,node-name=fmt-node,mountpoint=foo.qcow2,writable=on \
    &
[1] 3474
blackstar :: » file foo.qcow2
foo.qcow2: DOS/MBR boot sector; partition 1 : ID=0x83, start-CHS (0x10,0,1), end-CHS (0x3ff,3,32), startsector 2048, 41940992 sectors
blackstar :: » sudo kpartx -av foo.qcow2
add map loop0p1 (253:0): 0 41940992 linear 7:0 2048

Last edited by marav; 11-26-2023 at 06:34 PM.
 
Old 11-26-2023, 06:39 PM   #5
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,381

Rep: Reputation: 4098Reputation: 4098Reputation: 4098Reputation: 4098Reputation: 4098Reputation: 4098Reputation: 4098Reputation: 4098Reputation: 4098Reputation: 4098Reputation: 4098
Hum...
My bad, a slackbuild already exists on SBo

https://slackbuilds.org/repository/1...arch=multipath
 
Old 11-26-2023, 07:20 PM   #6
BenCollver
Rogue Class
 
Registered: Sep 2006
Location: OR, USA
Distribution: Slackware64-15.0
Posts: 376

Original Poster
Blog Entries: 2

Rep: Reputation: 172Reputation: 172
So far as i know, i am not using multipath. I am curious what makes partx the wrong tool for the job?
 
Old 11-26-2023, 07:40 PM   #7
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,381

Rep: Reputation: 4098Reputation: 4098Reputation: 4098Reputation: 4098Reputation: 4098Reputation: 4098Reputation: 4098Reputation: 4098Reputation: 4098Reputation: 4098Reputation: 4098
Quote:
Originally Posted by BenCollver View Post
So far as i know, i am not using multipath. I am curious what makes partx the wrong tool for the job?
Based on the tutorial you referenced, they use kpartx, and it works
You use partx, and obviously it doesn't work

kpartx is a binary from multipath-tools
Feel free to use it or not
 
Old 11-26-2023, 08:32 PM   #8
BenCollver
Rogue Class
 
Registered: Sep 2006
Location: OR, USA
Distribution: Slackware64-15.0
Posts: 376

Original Poster
Blog Entries: 2

Rep: Reputation: 172Reputation: 172
partx worked for me for 2 years until i updated to kernel 5.15.139
 
Old 11-26-2023, 08:58 PM   #9
BenCollver
Rogue Class
 
Registered: Sep 2006
Location: OR, USA
Distribution: Slackware64-15.0
Posts: 376

Original Poster
Blog Entries: 2

Rep: Reputation: 172Reputation: 172
I installed multipath-tools, booted Linux kernel 5.15.139, and verified that this process works fine for me with kpartx. Now i have two workarounds.

1) Revert to kernel 5.15.117 as business_kid suggested.
2) Use kpartx instead of partx as marav suggested.

I am curious why these workarounds work.
 
Old 11-26-2023, 10:08 PM   #10
BenCollver
Rogue Class
 
Registered: Sep 2006
Location: OR, USA
Distribution: Slackware64-15.0
Posts: 376

Original Poster
Blog Entries: 2

Rep: Reputation: 172Reputation: 172
Studying the strace output, i notice that:

* partx uses the BLKPG_ADD_PARTITION ioctl on /dev/loop0
* kpartx uses the DM_DEV_CREATE ioctl on /dev/mapper/control

My guess is that partx was broken in the following commit in kernel 5.15.132


https://lore.kernel.org/all/20230831075900.1725842-1-lilingfeng@huaweicloud.com/


Partx was the wrong tool for the job because the BLKPG_ADD_PARTITION ioctl was not supposed to be valid on a loop block device. It was a happy accident that it worked for me until my last kernel upgrade.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Force breaks to avoid eye strain (typing breaks) upnort Slackware 12 09-19-2019 03:43 PM
Please upgrade util-linux ("partx" e.g. is badly broken) Sl4ck3ver Slackware 1 08-06-2013 08:10 PM
samba problems - "PORT 139" vwhk Linux - Networking 1 02-15-2002 04:23 AM
cannot connect to samba server when its running on port 139 badshaaa Linux - Networking 21 02-07-2002 04:50 AM
how to access tcp/139 port cmardhekar Linux - General 1 08-20-2001 06:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration