Hey Denis,
When running gnome-disks, even as root, I cannot format partitions with
it: the only "filesystem" that works is "unformated".
Ext4 seems available but when selected it fails to format the partition
and the rest of the filesystems are greyed out.
This is with (service udisks-service-type) in my system configuration.
However if run 'killall udisksd' and manually run udisksd as root,
gnome-disks can format most filesystems.
I also see this issue, and the workaround fixes it for me too.
What happens behind the scenes is that gnome-disks uses some dbus
wrapper functions to ask the information to Udisks2 through the
/org/freedesktop/UDisks2/Manager org.freedesktop.UDisks2.Manager
CanFormat function. It then caches it.
I've confirmed with d-spy that this function returns true with
parameters like like 'exfat' (with the quotes) when udisksd runs as
root and false when it doesn't.
Udisksd then uses the bd_fs_can_mkfs function from blockdev to get the
information. I've not read yet the bd_utils_check_util_version that
does the actual check though.
I've also tried to call bd_fs_can_mkfs in a standalone C program but it
didn't work (it probably needs a bit more setup than copying the
udisksd call to it).
And I also didn't look at the udisks-service-type yet. I'll try to find
more time to dig into bd_utils_check_util_version to understand why it
fails.
My findings are this issue is due to udisksd not inheriting PATH from the
service that executes it, so it can't find mkfs executables from
/run/current-system/profile/{s,}bin.
I've submitted a potential fix: https://codeberg.org/guix/guix/pulls/3466
With regards to the non-root behavior, is udisksd ever supposed to be run as a
user? I think that might not be a problem if it's intended to be run as a D-Bus
system service, right?
Cheers,
Alvin