Bug 458006

Summary: System monitor does not recognize LUKS encrypted btrfs disk
Product: [Frameworks and Libraries] ksystemstats Reporter: risto.paavola
Component: GeneralAssignee: KSysGuard Developers <ksysguard-bugs>
Status: REPORTED ---    
Severity: normal CC: ahiemstra, eblock, nate, plasma-bugs-null
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Screenshot from available disk sensors

Description risto.paavola 2022-08-17 18:28:13 UTC
Created attachment 151384 [details]
Screenshot from available disk sensors

SUMMARY
***
Mounted LUKS encrypted btrfs subvolume cannot be seen in System monitor (e.g. Disk Usage 1.0 widget).

# fdisk -l
Disk /dev/sda: 238.47 GiB, 256060514304 bytes, 500118192 sectors
Disk model: HFS256G39TND-N21
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 1ADD023E-D453-CF4C-B74D-F3CE22089BB8

Device      Start       End   Sectors   Size Type
/dev/sda1    2048    526335    524288   256M EFI System
/dev/sda2  526336 500118158 499591823 238.2G Linux filesystem

# cryptsetup open --allow-discards /dev/sda2 crypteddisk # Opening the crypted volume with passwd

# cat /etc/fstab # mounting of subvolume
/dev/mapper/crypteddisk         /               btrfs           subvol=root,noatime,discard             0 0

sda1 and/or subvolume is missing from sensors under "Disks", see attached image.
***


STEPS TO REPRODUCE
1. create luks encrypted disk with btrfs formating which has subvolumes
2. decrypt the disk with cryptsetup
3. mount a subvolume of btrfs partition somewhere (e.g. /)
4. try to monitor the mounted subvolume or the encrypted disk itself

OBSERVED RESULT
The disk or the subvolume cannot be seen in disk sensors.

EXPECTED RESULT
The disk or the subvolume usage, throughput, ... can be seen and measured in disk sensors. 

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Gentoo Linux 2.8
(available in About System)
KDE Plasma Version: 5.25.4
KDE Frameworks Version: 5.97.0
Qt Version: 5.15.5

ADDITIONAL INFORMATION
Comment 1 Arjen Hiemstra 2022-09-29 13:32:39 UTC
We use Solid for determining which devices are listed. Can you paste the output of these two commands:

solid-hardware5 query 'IS StorageAccess'

and

solid-hardware5 query 'IS StorageDevice'
Comment 2 risto.paavola 2022-09-29 13:43:35 UTC
(In reply to Arjen Hiemstra from comment #1)
> We use Solid for determining which devices are listed. Can you paste the
> output of these two commands:
> 
> solid-hardware5 query 'IS StorageAccess'
> 
> and
> 
> solid-hardware5 query 'IS StorageDevice'

Hello!

Thank you for your reply.

Here is the output of these commands:
--8<--
# solid-hardware5 query 'IS StorageAccess'
udi = '/org/freedesktop/UDisks2/block_devices/sdb1'
udi = '/org/freedesktop/UDisks2/block_devices/sda2'
udi = '/org/freedesktop/UDisks2/block_devices/sda1'
# solid-hardware5 query 'IS StorageDevice'
--8<--

The latter gave empty response.

BR,
-Risto
Comment 3 eblock 2025-06-20 07:35:54 UTC
I see something quite similar on openSUSE Leap 15.6, plasma5-workspace-5.27.11-bp156.3.3.1.x86_64.
The interesting thing is, I have two laptops (different hardware) installed identically, they just have different hard disks (SATA SSD vs. NVME), both have encrypted disks.
On one device I see "0 Bytes used" as well as "0 Bytes total", while the other one (installed on SATA SSD) shows at least the boot partition (I assume because of the partition sizes), so something around 134 MB used out of 487 MB. /boot is ext4, there are a couple of btrfs subvolumes as well. 
The requested output (solid-hardware query) is similar to the already reported, "IS StorageDevice" is empty. 

Anything else I could provide to narrow this down?