KPM failed to create btrfs partion on my two Samsung 870 EVO 2T SSDs of SATA. It's ok if there is any error caused the issue. But I only get just one word message: *Error*, both in file:///tmp/partitionmanager-WlGFWH.html and dmesg: ``` KDE Partition Manager: SMART Status Report Date: 5/6/25 8:22 AM Program version: 25.04.0 Backend: pmsfdiskbackendplugin (1) KDE Frameworks version: 6.13.0 Machine: Linux z840 6.14.4-300.fc42.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 25 15:43:38 UTC 2025 x86_64 Create a new partition (1.82 TiB, btrfs) on ‘/dev/sdc’ Job: Create new partition on device ‘/dev/sdc’ Command: sfdisk --force --append /dev/sdc Failed to add partition ‘New Partition’ to device ‘/dev/sdc’. Failed to add partition ‘New Partition’ to device ‘/dev/sdc’. Create new partition on device ‘/dev/sdc’: Error Create a new partition (1.82 TiB, btrfs) on ‘/dev/sdc’: Error ``` dmesg output: ``` [ 142.292508] sdc: [ 142.822504] sdc: [ 190.558592] sdc: ``` My PC is HP Z840 workstation and these two SSDs are connected to SATA ports of LSI SAS 2308 controller, embedded on motherboard. The BIOS is an updated 02.62. Since 870 EVO SSD is instruduced at the beginning of 2021 and LSI SAS 2308 should be used less then 870 EVO SSD, the root cause should be located in BIOS or firmware of SAS controller. The point is, KPM is missing error info in details: One word message is too generic to debug.
Update1: Same issue occurred on Kernel 6.14.5 of Fedora 42
Hmm, indeed hard to tell what happened. You could still try to debug it. First run it as KPMCORE_DEBUG=1 partitionmanager That should print far more info to the terminal.
(In reply to Andrius Štikonas from comment #2) > Hmm, indeed hard to tell what happened. > > You could still try to debug it. First run it as > KPMCORE_DEBUG=1 partitionmanager > > That should print far more info to the terminal. here is the log with KPMCORE_DEBUG=1: root@z840:/home/keelung# KPMCORE_DEBUG=1 partitionmanager kf.coreaddons: "Could not find plugin kpmcore/" Could not create instance of plugin "" kf.notifications: Failed to play sound with canberra: Not available
So, is it related to https://invent.kde.org/system/kpmcore/-/merge_requests/63/diffs ? Thx!
(In reply to Keelung from comment #3) > here is the log with KPMCORE_DEBUG=1: > root@z840:/home/keelung# KPMCORE_DEBUG=1 partitionmanager > kf.coreaddons: "Could not find plugin kpmcore/" > Could not create instance of plugin "" > kf.notifications: Failed to play sound with canberra: Not available Strange, that sounds like something else went wrong just in this invocation. Somehow it even load sfdisk plugin this time. It was clearly using sfdisk initially. I see "Loaded backend plugin: "pmsfdiskbackendplugin" the first thing when I run it (before even I enter password in polkit authentication dialog) Also, I would recommend not to run it as root. It should be able to get root permissions via polkit.
(In reply to Keelung from comment #4) > So, is it related to > https://invent.kde.org/system/kpmcore/-/merge_requests/63/diffs ? > Thx! Oh, maybe it is related to this diff...
https://discussion.fedoraproject.org/t/fedora-42-plasma-kde-partitionmanager-keeps-crashing/150307 further suggests that this is the same problem... So I think let's mark it as a duplicate. Reopen if it's not fixed in 25.04.01 (which should be out this Thursday)
*** This bug has been marked as a duplicate of bug 502141 ***
(In reply to Andrius Štikonas from comment #7) > https://discussion.fedoraproject.org/t/fedora-42-plasma-kde-partitionmanager- > keeps-crashing/150307 further suggests that this is the same problem... So I > think let's mark it as a duplicate. Reopen if it's not fixed in 25.04.01 > (which should be out this Thursday) OK. I'll try once released for F42. BTW, *Could not find plugin / Could not create instance of plugin* messages should be shown without KPMCORE_DEBUG, since they're ERROR msg but DEBUG_INFO msg
(In reply to Keelung from comment #9) > (In reply to Andrius Štikonas from comment #7) > > https://discussion.fedoraproject.org/t/fedora-42-plasma-kde-partitionmanager- > > keeps-crashing/150307 further suggests that this is the same problem... So I > > think let's mark it as a duplicate. Reopen if it's not fixed in 25.04.01 > > (which should be out this Thursday) > > OK. I'll try once released for F42. > BTW, *Could not find plugin / Could not create instance of plugin* messages > should be shown without KPMCORE_DEBUG, since they're ERROR msg but > DEBUG_INFO msg Hmm, they should be shown even without KPMCORE_DEBUG=1. What KPMCORE_DEBUG=1 does is it prints which commands/tools partitionmanager executes (and output of those commands), so it shouldn't affect plugin loading which happens very early in startup. Not sure why you only observed it with KPMCORE_DEBUG=1.
Same error occurred at 25.04.1: KDE Partition Manager: SMART Status Report Date: 5/17/25 9:20 PM Program version: 25.04.1 Backend: pmsfdiskbackendplugin (1) KDE Frameworks version: 6.14.0 Machine: Linux z840 6.14.6-300.fc42.x86_64 #1 SMP PREEMPT_DYNAMIC Fri May 9 20:11:19 UTC 2025 x86_64 Create a new partition (1.82 TiB, btrfs) on ‘/dev/sdb’ Job: Create new partition on device ‘/dev/sdb’ Command: sfdisk --force --append /dev/sdb Failed to add partition ‘New Partition’ to device ‘/dev/sdb’. Failed to add partition ‘New Partition’ to device ‘/dev/sdb’. Create new partition on device ‘/dev/sdb’: Error Create a new partition (1.82 TiB, btrfs) on ‘/dev/sdb’: Error
The logging with KPMCORE_DEBUG=1 has only one line, and same dmesg output as before: root@z840:/home/keelung# KPMCORE_DEBUG=1 partitionmanager kf.notifications: Failed to play sound with canberra: Not available root@z840:/home/keelung# dmesg | tail [ 18.839013] RPC: Registered named UNIX socket transport module. [ 18.839017] RPC: Registered udp transport module. [ 18.839018] RPC: Registered tcp transport module. [ 18.839019] RPC: Registered tcp-with-tls transport module. [ 18.839020] RPC: Registered tcp NFSv4.1 backchannel transport module. [ 19.510996] asix 1-5.3.1:1.0 enp0s20u5u3u1: configuring for phy/internal link mode [ 22.368907] e1000e 0000:00:19.0 eno1: NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx/Tx [ 32.169383] logitech-hidpp-device 0003:046D:4090.0008: HID++ 4.5 device connected. [ 95.459315] sdb: [ 606.693969] sdb: root@z840:/home/keelung# root@z840:/home/keelung# *** This bug has been marked as a duplicate of bug 502141 ***
(In reply to Keelung from comment #12) > The logging with KPMCORE_DEBUG=1 has only one line, and same dmesg output as > before: > > root@z840:/home/keelung# KPMCORE_DEBUG=1 partitionmanager > kf.notifications: Failed to play sound with canberra: Not available Strange, that's not what I would expect at all. Are you sure you don't have any running partitionmanager at that time? You can't start two of them...
(In reply to Andrius Štikonas from comment #13) > (In reply to Keelung from comment #12) > > The logging with KPMCORE_DEBUG=1 has only one line, and same dmesg output as > > before: > > > > root@z840:/home/keelung# KPMCORE_DEBUG=1 partitionmanager > > kf.notifications: Failed to play sound with canberra: Not available > > Strange, that's not what I would expect at all. Are you sure you don't have > any running partitionmanager at that time? You can't start two of them... I'm not sure. So I reboot and tried again by starting it in root permission. Same errors reported, both in UI and console. I notice some steps seems strange. When I right click on target disk with New menu item, it does not ask me to choose partition type. But when I click New Partition in toolbar, it asking me to choose partition type: GPT or MSDOS. So, the other question here is, why New menu item is trying to create partition without asking partition type? On the other hand, if the disk partition type has been set, then why the `New Partition` button is asking me again? From my understanding, one disk has only one partition table type, either GPT or MBR (MSDOS here)
Created attachment 181431 [details] Before creating partition
Created attachment 181432 [details] The error GUI
(In reply to Keelung from comment #14) > I'm not sure. So I reboot and tried again by starting it in root permission. > Same errors reported, both in UI and console. Don't run it as root. While it would work, it is designed to run as your own user and use polkit to get root permissions for partitioning tasks. > > I notice some steps seems strange. When I right click on target disk with > New menu item, it does not ask me to choose partition type. But when I click > New Partition in toolbar, it asking me to choose partition type: GPT or > MSDOS. Are you sure you are clicking on the same action? There are two different actions, one creates new partition table (MRB or GPT) and the other creates partitions. Both are available from menu (partition->new and device->new partition table) and also from toolbar. > > So, the other question here is, why New menu item is trying to create > partition without asking partition type? > On the other hand, if the disk partition type has been set, then why the > `New Partition` button is asking me again? > From my understanding, one disk has only one partition table type, either > GPT or MBR (MSDOS here)
I know the differance between Partition and Partition Table. What I mean is, if the Partition Table has been created, then the `New Partition Table` should be disabled. If the Partition Table has NOT been created, then the `New Partition` menu item should be disabled too. In short, you can not create any partition If the Partition Table is missing. Above all is about UI logic.
(In reply to Keelung from comment #18) > if the Partition Table has been created, then the `New Partition Table` > should be disabled. Well, what if you change your mind and decided to create different partition table. I think just disabling creation of new partition table would be confusing. And operation stack of partition manager is smart enough that it will replace the earlier operation. E.g. "Create MBR followed by Create GPT" will be replaced by "Create GPT". > If the Partition Table has NOT been created, then the `New Partition` menu item should be disabled too. That is already the case. If you have no partition table on the device, you won't be able to create new partitions, you'll have to create partition table first.
Ok. The UI logic is off-topic here. Just one more thing, you can refer the UI logic of DiskGenius (https://www.diskgenius.com/download.php) Please let's focus on the one word log `Error` in this bug. The screenshut has been attached as https://bugsfiles.kde.org/attachment.cgi?id=181432 Thanks!
By the way, is /dev/sdb RAID device? I haven't tested those though I don't see why they shouldn't work. Anyway, we need to figure out what commands were launched by partitionmanager. See what it runs and try to run the same command outside partitionmanage. And if KPMCORE_DEBUG=1 partitionmanager does't work, use some other method, you could try strace'ing it... First start external command helper: # sudo strace -fe execve,write /usr/libexec/kpmcore_externalcommand Then run: $ partitionmanager
Created attachment 181443 [details] strace -fe execve,write /usr/libexec/kpmcore_externalcommand 2>&1 | tee strace_kpmcore.log
(In reply to Andrius Štikonas from comment #21) > By the way, is /dev/sdb RAID device? I haven't tested those though I don't > see why they shouldn't work. > > Anyway, we need to figure out what commands were launched by > partitionmanager. See what it runs and try to run the same command outside > partitionmanage. And if KPMCORE_DEBUG=1 partitionmanager does't work, use > some other method, you could try strace'ing it... > > First start external command helper: > # sudo strace -fe execve,write /usr/libexec/kpmcore_externalcommand > > Then run: > $ partitionmanager Yes. It's a RAID1 disk created by LSI SAS 2308 on the HP Z840 workstation within the latest BIOS v02.62 installed. This RAID1 disk is combined by two Samsung 870 EVO SATA SSD. I checked SMART info of these two disks and the volume status in LSI controller console, there is no any warning or error reported.
[pid 10061] execve("/usr/bin/sfdisk", ["/usr/bin/sfdisk", "--force", "--append", "/dev/sdb"], 0x55ce8a5373a0 /* 1 var */) = 0 [pid 9754] write(3, "\1\0\0\0\0\0\0\0", 8) = 8 [pid 9754] write(3, "\1\0\0\0\0\0\0\0", 8) = 8 [pid 9754] write(3, "\1\0\0\0\0\0\0\0", 8) = 8 [pid 9754] write(3, "\1\0\0\0\0\0\0\0", 8) = 8 [pid 9754] write(11, "start=2048 size=3904290816\nwrite"..., 33) = 33 [pid 9754] write(3, "\1\0\0\0\0\0\0\0", 8) = 8 [pid 10061] write(1, "Checking that no-one is using th"..., 403) = 403 [pid 10061] write(2, "Sector 2048 already used.", 25) = 25 [pid 10061] write(2, "\n", 1) = 1 [pid 10061] write(2, "Failed to add #2 partition", 26) = 26 [pid 10061] write(2, ": Numerical result out of range\n", 32) = 32 [pid 10061] write(1, "Leaving.\n\n", 10) = 10
So it tries to run /usr/bin/sfdisk --force --append /dev/sdb and writes to its input: start=2048 size=3904290816 write And the error is: Sector 2048 already used. Seems like there are more similar reports here https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/1940691 Though not clear why...