Bug 505852 - Mounting a removable disk (BTFS / EXT4) systematically forces a very long scan, leading to a timeout
Summary: Mounting a removable disk (BTFS / EXT4) systematically forces a very long sca...
Status: CONFIRMED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Disks & Devices widget (other bugs)
Version First Reported In: 6.4.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: efficiency-and-performance, regression
Depends on:
Blocks:
 
Reported: 2025-06-20 15:27 UTC by Sigmund
Modified: 2025-11-10 08:45 UTC (History)
17 users (show)

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


Attachments
It is slow. (179.99 KB, video/mp4)
2025-06-20 15:27 UTC, Sigmund
Details
Logs of devicenotifier. (37.73 KB, text/plain)
2025-06-21 11:34 UTC, Sigmund
Details
workaround (134.72 KB, image/png)
2025-06-23 09:39 UTC, Vence
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sigmund 2025-06-20 15:27:46 UTC
Created attachment 182428 [details]
It is slow.

SUMMARY
It is slow while I mount the removable disk(btrfs) in plasma 6.4.  Maybe a bug. 

STEPS TO REPRODUCE
1. Mount a removable disk
2. It checks it every time.

OBSERVED RESULT
It checks it every time.

EXPECTED RESULT
Hope it can be mounted as fast as before.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.4.0
KDE Frameworks Version: 6.15.0
Qt Version: 6.9.1
Kernel Version: 6.15.2-zen1-1-zen (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION
Comment 1 Yujiro Hanma 2025-06-20 15:45:38 UTC
It seems it's due to the new feature of checking disks for errors by default. For me it either outright fails or has an error message like 

An error occurred while accessing 'LinuxDisk', the system responded: An unspecified error has occurred: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

After trying twice, it ultimately succeeds, despite the errors.
Comment 2 Bogdan Onofriuchuk 2025-06-21 11:24:13 UTC
Can you collect the logs please, because I don't have any disks. 
1. In terminal execute: QT_LOGGING_RULES="org.kde.applets.devicenotifier=true" plasmawindowed org.kde.plasma.devicenotifier &> log.txt
2. Reproduce the bug
3. stop the process in terminal
4. attach the file log.txt here
Comment 3 Sigmund 2025-06-21 11:34:07 UTC
Created attachment 182481 [details]
Logs of devicenotifier.

Add logs.
Comment 4 Bogdan Onofriuchuk 2025-06-21 12:24:28 UTC
Looks like this is expected behavior. Before mounting it checks the device for errors. The slowness of checking is proportional to the disk size and read speed. You have a 2Tb drive so that why it is so slow. The solution here would be to make the check operation optional.
Comment 5 Sigmund 2025-06-22 10:08:11 UTC
(In reply to Bogdan Onofriuchuk from comment #4)
> Looks like this is expected behavior. Before mounting it checks the device
> for errors. The slowness of checking is proportional to the disk size and
> read speed. You have a 2Tb drive so that why it is so slow. The solution
> here would be to make the check operation optional.

Thanks. 

Hope it can be an optional choice.
Comment 6 Vence 2025-06-23 07:25:39 UTC
(In reply to Sigmund from comment #5)
> (In reply to Bogdan Onofriuchuk from comment #4)
> > Looks like this is expected behavior. Before mounting it checks the device
> > for errors. The slowness of checking is proportional to the disk size and
> > read speed. You have a 2Tb drive so that why it is so slow. The solution
> > here would be to make the check operation optional.
> 
> Thanks. 
> 
> Hope it can be an optional choice.

Is it possible to disable the this check? 

But how
Comment 7 Vence 2025-06-23 09:35:45 UTC
A workaround is suggested. 
Open System settings -- > Connected devices --> Disks & Cameras --> Device actions", add new action by the button "Add", give it any non-existing name and then enter the data as shown in the screenshot attached.
Use new action instead of "Mount" to mount the removable disk.
Comment 8 Vence 2025-06-23 09:39:40 UTC
Created attachment 182549 [details]
workaround

Sorry, no screenshot is attached in my previous comment
A workaround is suggested. 
Open System settings -- > Connected devices --> Disks & Cameras --> Device actions", add new action by the button "Add", give it any non-existing name and then enter the data as shown in the screenshot attached.
Use new action instead of "Mount" to mount the removable disk.
Comment 9 Mahendra Tallur 2025-06-23 17:52:51 UTC
Hi ! Same issue since the 6.4 upgrade, with an USB harddrive with ext 4 partitions. 
Actually, I have waited several minutes to no avail and had to reboot :-/

Is it really the expected behaviour ?

For some reason, the check does not occur when mounting the partition through Dolphin. (pfew !)
Comment 10 Mahendra Tallur 2025-06-23 17:56:11 UTC
BTW, may I suggest the bug report name is changed accordingly, to something like :

"Mounting a removable hadrrive (BTFS / EXT4) systematically forces a very long scan, leading to a timeout".

I really wonder if that is the expected behaviour...
Comment 11 Martin Schnitkemper 2025-06-24 12:05:48 UTC
I can confirm this behavior. Mounting a fully loaded 4TB external hard drive now takes four minutes, during that time I can hear the drive activity. After about a minute, I get a message saying I'm not authorized to mount the device. After the four minutes, I see in the log that the device has been mounted. This is new since version 6.4; before, mounting the device was done instantly, and when I mount the device on the console as root, it's done immediately.
Comment 12 Bug Janitor Service 2025-06-24 16:29:42 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/5624
Comment 13 Grósz Dániel 2025-07-01 10:18:45 UTC
Happens here too, with an almost full, 2 TB BTRFS hard disk. The extreme slowness is new. The btrfsck check takes 20 minutes. Mounting was somewhat slow earlier too (maybe half a minute); Idk if it's the plasma shell's behavior that changed, or perhaps the default operation of btrfsck became much slower, or perhaps Solid via udisks now reports that it can check the drive, while previously it couldn't.

Also note that btrfsck doesn't even repair anything by default, its repair functionality is considered unsafe, while AFAIK btrfs automatically repairs errors that can be safely repaired when mounting, so btrfsck should be unnecessary.

Perhaps a reasonable behavior would be to try mounting first, and only fsck (with no timeout) if mounting fails with an error that indicates that the file system is damaged, and then try to mount again. Even then, ideally only run fsck if the file system has an fsck tool that can safely repair some kinds of errors, otherwise just report that the file system is damaged (Idk if there's a way to get this information from udisks).
Comment 14 Bogdan Onofriuchuk 2025-07-14 19:01:04 UTC
Git commit a30f314d9fe646080f314f2070489ec897467c43 by Bohdan Onofriichuk.
Committed on 14/07/2025 at 18:14.
Pushed by littlesweet into branch 'master'.

applets/devicenotifier: don't do check in mount action

Don't do check in the mount action. Create another action for check. Also
change the name of the mount action to just "mount" if check was done.

M  +1    -0    applets/devicenotifier/CMakeLists.txt
A  +82   -0    applets/devicenotifier/actions/checkaction.cpp     [License: GPL(v2.0+)]
C  +5    -9    applets/devicenotifier/actions/checkaction.h [from: applets/devicenotifier/actions/mountaction.h - 059% similarity]
M  +8    -19   applets/devicenotifier/actions/mountaction.cpp
M  +0    -1    applets/devicenotifier/actions/mountaction.h
M  +10   -1    applets/devicenotifier/actionscontrol.cpp
M  +5    -2    applets/devicenotifier/devicemessagemonitor_p.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/a30f314d9fe646080f314f2070489ec897467c43
Comment 15 Christian Hartmann 2025-07-23 11:27:48 UTC
(In reply to Martin Schnitkemper from comment #11)
> I can confirm this behavior. Mounting a fully loaded 4TB external hard drive
> now takes four minutes, during that time I can hear the drive activity.
> After about a minute, I get a message saying I'm not authorized to mount the
> device. After the four minutes, I see in the log that the device has been
> mounted. This is new since version 6.4; before, mounting the device was done
> instantly, and when I mount the device on the console as root, it's done
> immediately.

Same here, but with a 4 TB drive on USB 2 it takes up to two hours.

Has the default action "Mount and Open" changed lately to "*Always* do a check first 
and mount after" behavior?  

Does it ignore a 'clean' flag in partitions super block (if something like this exists)?

more observations: https://discuss.kde.org/t/mounting-external-usb-disks-now-checks-before-mounting/37439/2
Comment 16 Christian Hartmann 2025-07-23 14:00:09 UTC
(In reply to Mahendra Tallur from comment #9)
 
> For some reason, the check does not occur when mounting the partition
> through Dolphin. (pfew !)

Can confirm this. It is only the Widget,  that checks before mounting.  Dolphin mounts immediately without any complaints, a clean unmounted disk, whereas the default action triggers checking.  I miss seeing the point in doing so, when the drive is clean - without errors.
Comment 17 Dennis Schridde 2025-10-25 13:06:16 UTC
I am on KDE Plasma 6.5.0 and I am still experiencing this issue, even though https://invent.kde.org/plasma/plasma-workspace/-/commit/a30f314d9fe646080f314f2070489ec897467c43 is supposedly included in Plasma 6.5.0. I clicked "Mount and Open", the default action presented by the systray applet, and `btrfsck` is running for about an hour now and the filesystem still is not mounted in Dolphin.

Operating System: NixOS 25.11
KDE Plasma Version: 6.5.0
KDE Frameworks Version: 6.19.0
Qt Version: 6.10.0
Kernel Version: 6.17.4 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 9 6900HS with Radeon Graphics
Memory: 32 GiB of RAM (30,6 GiB usable)
Graphics Processor 1: AMD Radeon 680M
Graphics Processor 2: AMD Radeon RX 6800S
Manufacturer: ASUSTeK COMPUTER INC.
Product Name: ROG Zephyrus G14 GA402RK_GA402RK
System Version: 1.0
Comment 18 Vence 2025-10-25 13:40:37 UTC
(In reply to Dennis Schridde from comment #17)
> I clicked "Mount and Open"
Click "Mount without verifying" instead.
Comment 19 Petr Bartos 2025-11-09 19:43:52 UTC
Hi,
could you please reconsider the final solution? Having default option "Mount and Open" which automatically triggers the check is not very intuitive, as someone who does not know about this can be surprised not to be able to do anything for long minutes or even tens of minutes for larger (and slower) external disks, and if you need to just "quickly copy something and leave" and by mistake click default action, it is very annoying.
Not to mention there is missing "mount and open without scanning" so you are not able to mount and open and skip check with just single click (you need to open submenu, mount without check and then open), which is also a bit awkward.
Or at least please allow us to disable the automatic check in settings :-)
Comment 20 Roke Julian Lockhart Beedell 2025-11-09 20:30:54 UTC
Not sure you should have unilaterally reopened the ticket. Are you generally allowed to?
Comment 21 Petr Bartos 2025-11-09 20:58:27 UTC
(In reply to Roke Julian Lockhart Beedell from comment #20)
> Not sure you should have unilaterally reopened the ticket. Are you generally
> allowed to?

Well, yes i've tried to reopen, as i did not know whether additional comment on closed issue will get any attention, and imho in terms of original problem it is not really fixed for the reasons i've posted. If i did something wrong, i do apologize (though i'd guess i'd not have permissions, if regular user should not be allowed to reopen?)
Comment 22 TraceyC 2025-11-09 23:44:25 UTC
(In reply to Petr Bartos from comment #21)
> (In reply to Roke Julian Lockhart Beedell from comment #20)
> > Not sure you should have unilaterally reopened the ticket. Are you generally
> > allowed to?

Yes, people are allowed to reopen bugs for a variety of reasons. If it wasn't allowed, the option wouldn't be in Bugzilla.

> Well, yes i've tried to reopen, as i did not know whether additional comment
> on closed issue will get any attention

All of the people subscribed to a bug will get emails from it, regardless of the open / close state.

. and imho in terms of original
> problem it is not really fixed for the reasons i've posted. If i did
> something wrong, i do apologize 

From what I understand, the fix that was merged was to separate the mount and check actions in 
https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/5624

I see what you're saying about the UI not allowing the user to easily and intuitively mount a disk without running the verification check. I understand that from the user's point of view, the original problem is still a problem.
Comment 23 Grósz Dániel 2025-11-10 03:31:53 UTC
Is there even a filesystem in common use today where there's any benefit to checking before attempting to mount? In my experience, a filesystem is either clean and it's fine to just mount it; or it was unmounted uncleanly but it will be automatically fixed on mount; or mount will fail but won't damage the filesystem further, and *then* you run fsck. Even then, it depends on the filesystem whether a batch-mode fsck will actually repair anything; with btrfs, it won't. Am I wrong about any of this (in particular, that attempting to mount an unclean filesystem generally won't damage it further)?
Comment 24 Christian Hartmann 2025-11-10 07:40:00 UTC
(In reply to Grósz Dániel from comment #23)
> in my experience, a filesystem is
> either clean and it's fine to just mount it; or it was unmounted uncleanly

this! 

what is the benefit of a forced fs check on a clean filesystem? or what i'm missing?
Comment 25 Mahendra Tallur 2025-11-10 08:07:26 UTC
Hi ! I may be mistaken, but it seems the fix is applied differently depending on the distribution :

- on my KDE Neon, the default action is still to verify & mount
- on my Manjaro KDE (Arch based), since the fix has been applied, the default action is to mount without checking

Indeed, I cannot expect the "regular" users to manually select "mount without checking". If not, it triggers a several minutes check with a big external hard drive.

Thanks a lot, everyone <3
Cheers !
Comment 26 Petr Bartos 2025-11-10 08:45:17 UTC
(In reply to Mahendra Tallur from comment #25)
> Hi ! I may be mistaken, but it seems the fix is applied differently
> depending on the distribution :
> 
> - on my KDE Neon, the default action is still to verify & mount
> - on my Manjaro KDE (Arch based), since the fix has been applied, the
> default action is to mount without checking
> 
> Indeed, I cannot expect the "regular" users to manually select "mount
> without checking". If not, it triggers a several minutes check with a big
> external hard drive.
> 
> Thanks a lot, everyone <3
> Cheers !

I am on Fedora 42 with Plasma 6.5.2. I definitely see the new menu options from the merge request. Not sure if the default action is defined somewhere else (which is not yet updated), but even in the videos and comments in the merge request it seems that the default action is still expected to do the check and there was only added additional option to skip it.