Handling of removable drives and mounted shares
Open, NormalPublic

Description

Preliminary findings:

  • For mounted samba shares the inodes vary unless unix extensions are enabled
  • For external harddrives the deviceid varies with the order in which they are plugged in

Variable deviceids and inodes confuse baloo and result in "strange" duplications

michaelh created this task.Feb 1 2018, 10:37 PM
michaelh updated the task description. (Show Details)
michaelh updated the task description. (Show Details)Feb 2 2018, 7:58 AM
michaelh triaged this task as Normal priority.Feb 4 2018, 7:49 AM
michaelh updated the task description. (Show Details)Feb 4 2018, 10:17 AM

Here is way to corrupt your db:

Take 2 pendrives A and B
Plug them in in this order: A > B

Assuming they are mounted inside /run/media/otto/

$ find /run/media/otto/5714-D674 -exec balooctl index {} \;

(files are indexed)

$ find /run/media/otto/5714-D674 -exec balooshow {} \;

(index information is printed)

$ stat -c "%D %n" /run/media/otto/*
831 /run/media/otto/5714-D674
820 /run/media/otto/CDFD-AE5C

Unmount and unplug the drives
Plug them in again in this order: B > A

$ stat -c "%D %n" /run/media/otto/*
821 /run/media/otto/5714-D674
830 /run/media/otto/CDFD-AE5C

Drive A now has a different device id. As consequence:

$ find /run/media/otto/5714-D674 -exec balooshow {} \;
No index information found
No index information found
No index information found
No index information found
No index information found
No index information found
...
bruns added a subscriber: bruns.Mar 31 2018, 1:27 AM

For removable drives (or, more specifically, anything outside the users home directory):

  • store in a separate database
  • store the database either
    • toplevel on the filesystem, as a hidden directory -or-
    • as a separate database in the usual baloo db location, i.e. ~/.local/share/baloo

The or should be user configurable (with default and per drive), and could be integrated with e.g. the automounter (which already has to identify external drives uniquely)

bruns added a comment.Mar 31 2018, 1:29 AM

For network shares:
Samba allows remote searching using a server-side index. "Just" integrate with that.

michaelh updated the task description. (Show Details)Mar 31 2018, 2:58 PM
andreasgr added a comment.EditedFeb 11 2019, 12:22 PM

I experience the same behavior with BTRFS subvolumes mounted by systemd mount units.
Not on every boot, but after a seemingly random number of boots the device id changed and Baloo indexes the subvolume all over again.