NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.39k stars 13.62k forks source link

gnome3.gnome-disk-utility unable to find sgdisk #62749

Closed lightbulbjim closed 5 years ago

lightbulbjim commented 5 years ago

Issue description

gnome3.gnome-disk-utility is unable to add a partition due to missing sgdisk utility.

disks-error

Steps to reproduce

Attempt to create new luks-encrypted ext4 partition in gnome-disks.

Technical details

This looks to be similar to #34999, however I'm not able to find any reference to sgdisk in the source of either gnome-disk-utility or udisks. So I'm not sure what is actually looking for the sgdisk command.

I've also tried adding gptfdisk (the Nix derivation that includes sgdisk) to the buildInputs of both gnome3.gnome-disk-utility and udisks2, but it doesn't fix the error.

System info:

worldofpeace commented 5 years ago

See https://bugs.archlinux.org/task/37379. TLDR: transitive dependencies at it again :fist_raised:

worldofpeace commented 5 years ago

Maybe we could patch libblockdev

lightbulbjim commented 5 years ago

Maybe we could patch libblockdev

* https://github.com/storaged-project/libblockdev/blob/5ce832affe811df8985127f9f1e471b55d21f7f4/src/plugins/part.c

Hey, nice find :). That does indeed fix it. PR incoming.

p4block commented 1 year ago

Running nixos-unstable, seems like recently this error respawned in another way.

When formatting an error appears as "failed to determine sgdisk version" and doesn't end up doing anythng. This can be seen in dmesg.

[ 1527.239148] sgdisk[7469]: segfault at 0 ip 00007f66c90a86fd sp 00007ffc83f0a368 error 4 in libc.so.6[7f66c8f73000+176000] likely on CPU 3 (core 3, socket 0)
[ 1527.239163] Code: e1 c5 f8 77 c3 0f 1f 84 00 00 00 00 00 f3 0f 1e fa 89 f8 48 89 fa c5 f9 ef c0 25 ff 0f 00 00 3d e0 0f 00 00 0f 87 33 01 00 00 <c5> fd 74 0f c5 fd d7 c1 85 c0 74 57 f3 0f bc c0 c5 f8 77 c3 66 66
FossPrime commented 1 year ago

I'm facing the same thing on stable 22.11. Makes it impossible to properly format a USB stuck with Fat32! Also causes tons of errors when resizing and making partition images... very dangerous bug. The source of the error seems slightly different... I manually installed gptfdisk, restarted and still get the error. sgdisk segfaults when I ask it for a version.

$ sgdisk --version
GPT fdisk (sgdisk) version 1.0.9

Segmentation fault (core dumped)

https://gitlab.alpinelinux.org/alpine/aports/-/issues/13987

I worked around this issue by using Gparted instead. A user install did not work, I had to use a system configuration install.

p4block commented 1 year ago

Given that sgdisk --version crashes I would say the bug is in there and gnome-disks is innocently just trying to parse its (lack of) output