Bug 494483 - When encrypted external drive is auto-mounted, Disks & Devices applet doesn't recognize that it is mounted, and still offers option to mount it
Summary: When encrypted external drive is auto-mounted, Disks & Devices applet doesn't...
Status: REPORTED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Disks & Devices widget (other bugs)
Version First Reported In: 6.3.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2024-10-10 19:46 UTC by Łukasz Konieczny
Modified: 2025-06-03 08:19 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.2.1
Sentry Crash Report:


Attachments
Screenshot to prove, that Dolphin knows about mounted drive, but Plasma doesn't (238.81 KB, image/png)
2024-10-10 19:46 UTC, Łukasz Konieczny
Details
Screen recording showing the problem (2.94 MB, video/x-matroska)
2025-02-27 19:37 UTC, Łukasz Konieczny
Details
Log od applet debugging (62.24 KB, text/plain)
2025-02-28 19:39 UTC, Łukasz Konieczny
Details
System Settings automounting page (248.80 KB, image/png)
2025-05-19 19:54 UTC, Łukasz Konieczny
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Łukasz Konieczny 2024-10-10 19:46:36 UTC
Created attachment 174650 [details]
Screenshot to prove, that Dolphin knows about mounted drive, but Plasma doesn't

SUMMARY
I have several external HDD drives encrypted with LUKS2 and having XFS filesystem on them. When I plug such a drive, a window appears to provide password. I do that, then drive is opened and functioning (it is decrypted and filesystem is mounted), but Plasma Disks & Devices applet doesn't see that and thinks, that LUKS container is still closed and needs password. Of course when I click on "Podepnij" [in polish, in english it would be "decrypt" or "open"] nothing happens, because drive is already mounted. For me it is a major bug, because it makes false claim about external drive and eventually makes a user unplug a hard drive without unmounting, because user thinks, that she/he didn't provide correct password. I did that at first time, then I realized at second time, that Dolphin sees my hard drive as mounted.

STEPS TO REPRODUCE
1. Plug encrypted external drive to computer.
2. Provide a password.
3. Observe the result.

OBSERVED RESULT
Plasma applet is unaware about the fact, that drive is mounted and doesn't offer option to unmount it.

EXPECTED RESULT
Plasma applet knows, that drive is mounted.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.2.0
KDE Frameworks Version: 6.6.0
Qt Version: 6.7.3
Kernel Version: 6.11.2-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 8 × 11th Gen Intel® Core™ i5-1135G7 @ 2.40GHz
Memory: 31.2 GiB of RAM
Graphics Processor: Mesa Intel® Xe Graphics
Manufacturer: System76
Product Name: Darter Pro
System Version: darp7

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2024-10-10 20:31:58 UTC
Do you have automount turned on? If so, if you disable automount and manually mount the disk using the Disks & Devices widget, does the issue stop happening?
Comment 2 Łukasz Konieczny 2024-10-10 20:56:57 UTC
(In reply to Nate Graham from comment #1)
> Do you have automount turned on? If so, if you disable automount and
> manually mount the disk using the Disks & Devices widget, does the issue
> stop happening?

Yes, I had automounting enabled. When I disabled it now, applet behaves correctly.
Comment 3 Nate Graham 2024-10-10 20:59:28 UTC
Thanks for checking. We had a similar bug that got fixed for the manual mount use case, but perhaps automount also needs a fix here. I didn't think to test that one. Bohdan, would you be able to take a look here?
Comment 4 Bogdan Onofriuchuk 2024-10-11 13:31:55 UTC
(In reply to Nate Graham from comment #3)
Bohdan, would you be able to take a look here?

Yes, will look tonight or tomorrow
Comment 5 Bug Janitor Service 2024-10-11 20:14:47 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/4826
Comment 6 Nate Graham 2024-10-11 21:00:12 UTC
Git commit 93d96c8e58edeb5df1665c5a5247b97723b5fe40 by Nate Graham, on behalf of Bohdan Onofriichuk.
Committed on 11/10/2024 at 21:00.
Pushed by ngraham into branch 'master'.

applets/devicenotifier: Fix encrypted container not updating status
FIXED-IN: 6.2.1

M  +41   -0    applets/devicenotifier/plugin/devicestatemonitor_p.cpp
M  +3    -0    applets/devicenotifier/plugin/devicestatemonitor_p.h

https://invent.kde.org/plasma/plasma-workspace/-/commit/93d96c8e58edeb5df1665c5a5247b97723b5fe40
Comment 7 Nate Graham 2024-10-11 21:28:53 UTC
Git commit 0e135307cfb2b7c9c6e9314b149fc56a49c60f29 by Nate Graham.
Committed on 11/10/2024 at 21:06.
Pushed by ngraham into branch 'Plasma/6.2'.

applets/devicenotifier: Fix encrypted container not updating status
FIXED-IN: 6.2.1


(cherry picked from commit 93d96c8e58edeb5df1665c5a5247b97723b5fe40)

95d4a8e9 Fix encrypted container not updating status

Co-authored-by: Bohdan Onofriichuk <bogdan.onofriuchuk@gmail.com>

M  +41   -0    applets/devicenotifier/plugin/devicestatemonitor_p.cpp
M  +3    -0    applets/devicenotifier/plugin/devicestatemonitor_p.h

https://invent.kde.org/plasma/plasma-workspace/-/commit/0e135307cfb2b7c9c6e9314b149fc56a49c60f29
Comment 8 Łukasz Konieczny 2025-02-20 10:07:38 UTC
This bug reappeared in Plasma 6.3.1. I'm reopening the bug report.
Comment 9 Nate Graham 2025-02-26 19:34:35 UTC
I cannot reproduce that issue with current git master; my auto-mounted LUKS-encrypted disk shows its status in the popup correctly for me after unlocking and mounting.

Can you attach a screen recording that shows the issue happening? Thanks!
Comment 10 Łukasz Konieczny 2025-02-27 19:37:20 UTC
Created attachment 178956 [details]
Screen recording showing the problem

I have added screen recording. As you can see, Dolphin sees, that drive is mounted, but the Plasma applet doesn't.
Comment 11 Łukasz Konieczny 2025-02-27 19:40:52 UTC
I don't know if this have any influence on the bug, but I have manually set mountpoints for my external drives in /etc/fstab to subdirectories in /mnt/ and I have noauto as a mount option, because other way my system wouldn't boot when external drives aren't already plugged in. I also have user as mount option.
Comment 12 Łukasz Konieczny 2025-02-27 19:51:39 UTC
And I use LUKS2, if this is important
Comment 13 Nate Graham 2025-02-28 16:25:39 UTC
Bogdan, any ideas here?
Comment 14 Bogdan Onofriuchuk 2025-02-28 19:16:19 UTC
Can't reproduce in Plasma 6.3.2 with LUKS1 and LUSK2. Lukasz Konieczny can you collect the logs?
You can do this by:
* In terminal execute QT_LOGGING_RULES="org.kde.applets.devicenotifier=true" plasmoidviewer -a org.kde.plasma.devicenotifier &> log.txt
* Reproduce the bug
* Close the terminal or Ctrl + C
* Attach log.txt file to this bug report
Also, what file system are you using on this drive? I've tested with btrfs and wasn't have any problems
Comment 15 Łukasz Konieczny 2025-02-28 19:39:23 UTC
Created attachment 178981 [details]
Log od applet debugging
Comment 16 Łukasz Konieczny 2025-02-28 19:42:04 UTC
(In reply to Bogdan Onofriuchuk from comment #14)
> Can't reproduce in Plasma 6.3.2 with LUKS1 and LUSK2. Lukasz Konieczny can
> you collect the logs?
> You can do this by:
> * In terminal execute QT_LOGGING_RULES="org.kde.applets.devicenotifier=true"
> plasmoidviewer -a org.kde.plasma.devicenotifier &> log.txt
> * Reproduce the bug
> * Close the terminal or Ctrl + C
> * Attach log.txt file to this bug report
> Also, what file system are you using on this drive? I've tested with btrfs
> and wasn't have any problems

I use XFS on my all partitions, including external drives. The exception are pendrives and /boot/ partition. I have three partitions on my embedded SSD (in laptop). The / partition is not encrypted but /home/ partition is. The /boot/ partition is formatted vfat of course.
Comment 17 Łukasz Konieczny 2025-02-28 19:43:45 UTC
I use only GPT partition tables.
Comment 18 Łukasz Konieczny 2025-02-28 20:04:49 UTC
When I performed the bug reproduction  while running plasmoidviewer, I had already a /dev/sda1 external partition mounted. The bug reproduction was done using /dev/sdb1 external partition. You will see it in the log.txt file.
Comment 19 Bogdan Onofriuchuk 2025-02-28 20:18:54 UTC
Logs say that:
org.kde.applets.devicenotifier: Devices State Monitor : Device  "/org/freedesktop/UDisks2/block_devices/sdb1"  Error! state don't changed. Error data:  "Urządzenie jest już podpięte: Device /dev/dm-2 is already mounted at `/mnt/Dysk3'.\n"
So, looks like you are trying to mount the already mounted device(/mnt/Dysk3). Can you check if is this true?
Comment 20 Łukasz Konieczny 2025-02-28 20:27:40 UTC
(In reply to Bogdan Onofriuchuk from comment #19)
> Logs say that:
> org.kde.applets.devicenotifier: Devices State Monitor : Device 
> "/org/freedesktop/UDisks2/block_devices/sdb1"  Error! state don't changed.
> Error data:  "Urządzenie jest już podpięte: Device /dev/dm-2 is already
> mounted at `/mnt/Dysk3'.\n"
> So, looks like you are trying to mount the already mounted
> device(/mnt/Dysk3). Can you check if is this true?

This is totally untrue. Only mountpoints are described in fstab, but I always unmount drives before unplugging. This bug is reproducible even after turning on the system in case of all my external drives.
Comment 21 Łukasz Konieczny 2025-02-28 20:34:22 UTC
Now Dysk3 is unmounted and unplugged. All my drives have sticky bit set, so you can see, that now only Dysk4 is mounted.

[panlukasz@Darter-Pro ~]$ ls -l /mnt/
razem 0
drwxr-xr-x 2 root root  6 10-02 11:56 Dysk1
drwxr-xr-x 2 root root  6 09-28 21:02 Dysk2
drwxr-xr-x 2 root root  6 10-02 18:48 Dysk3
drwxrwxrwt 5 root root 54 12-31 18:16 Dysk4
drwxr-xr-x 2 root root  6 10-04 18:04 Dysk5
drwxr-xr-x 2 root root  6 09-29 09:33 Pendrive
[panlukasz@Darter-Pro ~]$ 

Moreover:

[panlukasz@Darter-Pro ~]$ lsblk
NAME                                          MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
sda                                             8:0    0   1,8T  0 disk  
└─sda1                                          8:1    0   1,8T  0 part  
  └─luks-833642a4-2935-4c41-bcc6-5c4e2f408496 254:1    0   1,8T  0 crypt /mnt/Dysk4
nvme0n1                                       259:0    0 931,5G  0 disk  
├─nvme0n1p1                                   259:1    0   512M  0 part  /boot
├─nvme0n1p2                                   259:2    0    80G  0 part  /
└─nvme0n1p3                                   259:3    0   851G  0 part  
  └─ainstnvme0n1p3                            254:0    0   851G  0 crypt /home
[panlukasz@Darter-Pro ~]$
Comment 22 Nate Graham 2025-05-19 19:45:42 UTC
Can you still reproduce the issue with Plasma 6.3.5 or later?

Thanks a lot!
Comment 23 Bogdan Onofriuchuk 2025-05-19 19:48:56 UTC
It is possible that this bug is fixed by https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/5286. But it is plasma 6.4
Comment 24 Łukasz Konieczny 2025-05-19 19:53:57 UTC
(In reply to Nate Graham from comment #22)
> Can you still reproduce the issue with Plasma 6.3.5 or later?
> 
> Thanks a lot!

I have changed distro from Arch to Fedora. Now I'm on Plasma 6.3.5, Frameworks 6.14.0. I can't reproduce the problem now, because automounting doesn't work at all despite the fact, that I have enabled automounting of all known devices after plugging in (as shown in the screenshot attached). I don't know why. Maybe Fedora disabled automounting, or I have done something wrong?
Comment 25 Łukasz Konieczny 2025-05-19 19:54:42 UTC
Created attachment 181536 [details]
System Settings automounting page
Comment 26 Bug Janitor Service 2025-06-03 03:47:51 UTC
🐛🧹 ⚠️ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!