On Sat, 26 Jun 2021, Bart Van Assche wrote: > On 6/25/21 5:54 PM, NeilBrown wrote: > > On Sat, 26 Jun 2021, Martin Steigerwald wrote: > >> And that Baloo needs an "invariant" for > >> a file. See comment #11 of that bug report: > > > > That is really hard to provide in general. Possibly the best approach > > is to use the statfs() systemcall to get the "f_fsid" field. This is > > 64bits. It is not supported uniformly well by all filesystems, but I > > think it is at least not worse than using the device number. For a lot > > of older filesystems it is just an encoding of the device number. > > > > For btrfs, xfs, ext4 it is much much better. > > How about combining the UUID of the partition with the file path? An > example from one of the VMs on my workstation: A btrfs filesystem can span multiple partitions, and those partitions can be added and removed dynamically. So you could migrated from one to another. f_fsid really is best for any modern filesystem. NeilBrown