Btrfsck runs at every mount call for external drive

I have two external 4TB spin disk drives used for backups. For a few weeks now I cannot mount those from the plasma applet. Turns out that the mount call triggers btrfsck on the disks. Which takes forever and blocks the actual mount. If I kill the fsck process the drives get instantly mounted. Running a bunch of checks on them yields not problems with the fs.

No idea where to start debugging this. I suspect something was changed in udisks that triggers the btrfsck on mount. But global udisks conf is empty. Also I am not sure, if udisks could be configured to not check. Or udev for that matter. Any hints or ideas would be much appreciated.

I do not see where udisksd would invoke fsck by itself. It exports Check and Repair methods over D-Bus though, so applications using UDisks may use them. You could try monitoring D-Bus what happens. E.g.

busctl --system monitor

systemd does file system checks. Show the journal by running:

journalctl -u 'systemd-fsck*'

great advice, thanks. So, there is a bunch of messages with dbus. From what I see, there is udisks, systemd, and polkit involved. There is some enum stuff with GetAll, Get, CanCheck, and finally Check, resulting in and udisks job

‣ Type=signal  Endian=l  Flags=1  Version=1 Cookie=270  Timestamp="Tue 2025-07-15 10:54:28.537831 UTC"
  Sender=:1.33  Path=/org/freedesktop/UDisks2  Interface=org.freedesktop.DBus.ObjectManager  Member=InterfacesAdded
  UniqueName=:1.33
  MESSAGE "oa{sa{sv}}" {
          OBJECT_PATH "/org/freedesktop/UDisks2/jobs/0";
          ARRAY "{sa{sv}}" {
                  DICT_ENTRY "sa{sv}" {
                          STRING "org.freedesktop.UDisks2.Job";
                          ARRAY "{sv}" {
                                  DICT_ENTRY "sv" {
                                          STRING "Operation";
                                          VARIANT "s" {
                                                  STRING "filesystem-check";
                                          };
                                  };

on a side note, there are messages from polkit saying that fsck requires root perms. Which would explain the eventual message in the plasma applet stating “you do not have permission to access that drive”. But fsck runs in the background and will eventually finish after a few minutes and then the drive does get mounted and is accessible to user.

As for systemd-fsck, its logs do not seem to have the external drives. It lists only the internal ones AFAICS

So, let me try to figure out who is sending the “Check” to udisks…

You probably need to give more details. Briefly looking at either devicenotifier or solid sources I still do not see how they can invoke Check or Repair when doing plain Mount.

I think it is that plasma thingy. When I use plain udisksctl to mount the drive, no btrfscheck process pops up. Also, found this when I searched for info on mounts via plasma

https://bugs.kde.org/show_bug.cgi?id=505852
https://www.mail-archive.com/kde-bugs-dist@kde.org/msg1072597.html

Alright, a possible fix to plasma devicenotifier mount behaviour was merged to kde master. Until that hits tumbleweed, the workaround is to use plain udisksctl as user to mount the external drives. Which is essentially what devicenotifier does but without the added filesystem check.

# user mount sdb1
udisksctl mount -b /dev/sdb1

Thanks arvidjaar and karlmistelberger for pointing me in the right direction.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.