Thanks for your quick response.

On Tue, Jul 19, 2022 at 2:46 PM Steinar H. Gunderson <se...@debian.org> wrote:
>
.....
>
> > 2. Delete /var/lib/plocate/plocate.db.  But perhaps at least an empty file 
> > with
> > the right permissions is required?  Then rerun updatedb.
>
> Yes, you should just rm /var/lib/plocate/plocate.db.
>
> /* Steinar */

I tried that, but I seem to be going backwards.  After updatedb the
database is almost empty:
<terminal>
root@barley:~# date; time updatedb
Tue 19 Jul 2022 05:09:17 PM PDT

real    0m0.259s
user    0m0.206s
sys    0m0.052s
root@barley:~# ls -l /var/lib/plocate/
total 8
-rw-r--r-- 1 root root    183 Nov 17  2021 CACHEDIR.TAG
-rw-r----- 1 root plocate 899 Jul 19 17:09 plocate.db
</terminal>

and even the files I could locate before have vanished from it.
I initially tried
systemctl start plocate-updatedb.service
with the same result.

Looking at the diagnostics below it seems that plocate has decided
that / is a bind mount, and so updatedb skips it and everything below.
The last line is
Skipping `/': bind mount
But I'm not sure of my interpretation.  For example, just above that
it says it is adding / and several other paths, but that perhaps means
adding it to the list of bind mounts.
Note that the final bind mount listed, for bacula.sql, is a single
file.  Maybe that caused trouble?

BTW, the same directory is available in 2 different spots: / and
/root/btr02/root.  /root/btr02 is a mountpoint; /root/btr02/root is
not, though it is a btrfs subvolume.

Also note that some other "top level" systems are mounted, e.g.,
/root/ubuntu, and so there are several directories that play the role
of '/' and several that are '/root' when the corresponding OS is
active.

Maybe if I added some of these duplicates, e.g., /root/btr02/root, to
the prunepaths list it would let the remaining one to be indexed?
That's a little brittle if I may be mounting and unmounting as I go;
some rule like "use the first" (not sure if the order is available) or
"use the one in fstab" might be more robust.

Ross

Diagnostics follow.

<terminal>
# updatedb --debug-pruning -v
Tue 19 Jul 2022 05:10:28 PM PDT
conf_block:
prune_bind_mounts\000
1\000
\000
prunefs\000
AFS\000
AUTOFS\000
BINFMT_MISC\000
CEPH\000
CGROUP\000
CGROUP2\000
CIFS\000
CODA\000
CONFIGFS\000
CURLFTPFS\000
DEBUGFS\000
DEVFS\000
DEVPTS\000
DEVTMPFS\000
ECRYPTFS\000
FTPFS\000
FUSE.CEPH\000
FUSE.GLUSTERFS\000
FUSE.GVFSD-FUSE\000
FUSE.MFS\000
FUSE.RCLONE\000
FUSE.ROZOFS\000
FUSE.SSHFS\000
FUSECTL\000
FUSESMB\000
HUGETLBFS\000
ISO9660\000
LUSTRE\000
LUSTRE_LITE\000
MFS\000
MQUEUE\000
NCPFS\000
NFS\000
NFS4\000
OCFS\000
OCFS2\000
PROC\000
PSTORE\000
RPC_PIPEFS\000
SECURITYFS\000
SHFS\000
SMBFS\000
SYSFS\000
TMPFS\000
TRACEFS\000
UDEV\000
UDF\000
USBFS\000
\000
prunenames\000
\000
prunepaths\000
/media\000
/tmp\000
/var/lib/ceph\000
/var/lib/os-prober\000
/var/spool\000
\000

-----------------------
Rebuilding bind_mount_paths:
 `/sys' (22 on 28) is `/' of `sysfs' (0:20), type `sysfs'
 `/proc' (23 on 28) is `/' of `proc' (0:21), type `proc'
 `/dev' (24 on 28) is `/' of `udev' (0:5), type `devtmpfs'
 `/dev/pts' (25 on 24) is `/' of `devpts' (0:22), type `devpts'
 `/run' (26 on 28) is `/' of `tmpfs' (0:23), type `tmpfs'
 `/' (28 on 1) is `/root' of `/dev/mapper/btr02_crypt' (0:24), type `btrfs'
 `/usr' (29 on 28) is `/usr' of `/dev/mapper/btr02_crypt' (0:24), type `btrfs'
 `/sys/kernel/security' (27 on 22) is `/' of `securityfs' (0:6), type
`securityfs'
 `/dev/shm' (30 on 24) is `/' of `tmpfs' (0:28), type `tmpfs'
 `/run/lock' (31 on 26) is `/' of `tmpfs' (0:29), type `tmpfs'
 `/sys/fs/cgroup' (32 on 22) is `/' of `cgroup2' (0:30), type `cgroup2'
 `/sys/fs/pstore' (33 on 22) is `/' of `pstore' (0:31), type `pstore'
 `/sys/firmware/efi/efivars' (34 on 22) is `/' of `efivarfs' (0:32),
type `efivarfs'
 `/sys/fs/bpf' (35 on 22) is `/' of `none' (0:33), type `bpf'
 `/proc/sys/fs/binfmt_misc' (36 on 23) is `/' of `systemd-1' (0:34),
type `autofs'
 `/dev/mqueue' (37 on 24) is `/' of `mqueue' (0:19), type `mqueue'
 `/sys/kernel/debug' (38 on 22) is `/' of `debugfs' (0:7), type `debugfs'
 `/dev/hugepages' (39 on 24) is `/' of `hugetlbfs' (0:35), type `hugetlbfs'
 `/sys/kernel/tracing' (40 on 22) is `/' of `tracefs' (0:11), type `tracefs'
 `/sys/fs/fuse/connections' (41 on 22) is `/' of `fusectl' (0:36),
type `fusectl'
 `/sys/kernel/config' (42 on 22) is `/' of `configfs' (0:37), type `configfs'
 `/root/btr02' (91 on 28) is `/' of `/dev/mapper/btr02_crypt' (0:24),
type `btrfs'
 `/boot' (90 on 28) is `/' of `/dev/sdh3' (8:115), type `ext2'
 `/root/ubuntu' (96 on 28) is `/' of `/dev/nvme0n1p3' (259:3), type `ext4'
 `/root/ubuntu/boot/efi' (99 on 96) is `/' of `/dev/nvme0n1p2'
(259:2), type `vfat'
 `/root/installer' (102 on 28) is `/' of `/dev/loop0' (7:0), type `iso9660'
 `/home' (105 on 28) is `/' of `/dev/mapper/vgb2-home' (253:14), type `ext4'
 `/var' (108 on 28) is `/' of `/dev/mapper/vgb2-var' (253:15), type `ext4'
 `/var/local/old-bacula' (112 on 108) is `/backup2' of
`/dev/mapper/btr02_crypt' (0:24), type `btrfs'
 `/proc/sys/fs/binfmt_misc' (111 on 36) is `/' of `binfmt_misc'
(0:40), type `binfmt_misc'
 `/run/user/1000' (735 on 26) is `/' of `tmpfs' (0:47), type `tmpfs'
 `/run/user/1000/doc' (757 on 735) is `/' of `portal' (0:48), type `fuse.portal'
 `/root/old' (524 on 28) is `/' of `/dev/mapper/old_var' (253:17), type `ext4'
 `/var/lib/postgresql/bacula.sql' (550 on 108) is
`/restore/var/lib/bacula/bacula.sql' of `/dev/mapper/btr02_crypt'
(0:24), type `btrfs'
Matching bind_mount_paths:
 => adding `/' (root `/root' is a child of `/', mounted on `/root/btr02')
 => adding `/usr' (root `/usr' is a child of `/', mounted on `/root/btr02')
 => adding `/var/local/old-bacula' (root `/backup2' is a child of `/',
mounted on `/root/btr02')
 => adding `/var/lib/postgresql/bacula.sql' (root
`/restore/var/lib/bacula/bacula.sql' is a child of `/', mounted on
`/root/btr02')
...done
Skipping `/': bind mount

</terminal>

Reply via email to