updatedb incompatible with btrfs subvolumes

Bug #1968190 reported by Julian Andres Klode
48
This bug affects 7 people
Affects Status Importance Assigned to Milestone
plocate (Debian)
Fix Released
Unknown
plocate (Ubuntu)
Won't Fix
Undecided
Unassigned
Jammy
Won't Fix
Undecided
Unassigned

Bug Description

I ran sudo updatedb, seeing locate did not find anything. It basically exited immediately.

strace log attached, no output with updatedb -v either

ProblemType: Bug
DistroRelease: Ubuntu 22.04
Package: plocate 1.1.15-1ubuntu2
ProcVersionSignature: Ubuntu 5.15.0-25.25-generic 5.15.30
Uname: Linux 5.15.0-25-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.11-0ubuntu80
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: GNOME
Date: Thu Apr 7 17:37:38 2022
InstallationDate: Installed on 2018-03-14 (1484 days ago)
InstallationMedia: Ubuntu 18.04 LTS "Bionic Beaver" - Alpha amd64 (20180313)
RebootRequiredPkgs: Error: path contained symlinks.
SourcePackage: plocate
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Julian Andres Klode (juliank) wrote :
Revision history for this message
Julian Andres Klode (juliank) wrote :
description: updated
Revision history for this message
Julian Andres Klode (juliank) wrote : Re: updatedb incompatible with btrfs

This seems to fail because PRUNE_BIND_MOUNTS="yes", and it seems to treat the btrfs / volume, which has a bunch of subvolumes mounted at a bunch of paths as a bind mounted file system

summary: - updatedb does not really do anything other than stat /
+ updatedb incompatible with btrfs
Revision history for this message
Julian Andres Klode (juliank) wrote :

To make this cleaner these are the fstab entries:

/dev/mapper/ubuntu--vg-root / btrfs defaults,compress=zstd,subvol=@ 0 1
/dev/mapper/ubuntu--vg-root /var/cache/squid-deb-proxy btrfs defaults,subvol=@squid 0 2
/dev/mapper/ubuntu--vg-root /var/log btrfs defaults,subvol=@log 0 2
/dev/mapper/ubuntu--vg-root /var/cache/apt/archives btrfs defaults,subvol=@apt 0 2
/dev/mapper/ubuntu--vg-root /mnt btrfs defaults 0 2

summary: - updatedb incompatible with btrfs
+ updatedb incompatible with btrfs subvolumes
Changed in plocate (Ubuntu):
status: New → Triaged
Changed in plocate (Ubuntu Jammy):
milestone: none → ubuntu-22.04.1
tags: added: fr-2256
tags: removed: rls-jj-incoming
Revision history for this message
Gannet (ken20001) wrote :

There is 22.04.1 released. But still not working. 'updatedb' and, for example, 'locate fstab' gives nothing.

Changed in plocate (Ubuntu Jammy):
milestone: ubuntu-22.04.1 → jammy-updates
Changed in plocate (Ubuntu):
milestone: ubuntu-22.04.1 → none
Revision history for this message
Julian Andres Klode (juliank) wrote :

Upstream does not want to fix this

Changed in plocate (Debian):
status: Unknown → Fix Released
Revision history for this message
Gannet (ken20001) wrote :

Any updates? Still not fixed in Mantic.

Changed in plocate (Ubuntu Jammy):
status: Triaged → Won't Fix
Changed in plocate (Ubuntu):
status: Triaged → Won't Fix
Revision history for this message
Gannet (ken20001) wrote :

Why???

Revision history for this message
Julian Andres Klode (juliank) wrote :

Please see the discussion in the Debian bug tracker but essentially this doesn't happen in all occasions, it depends on where what is mounted, and when it happens you can configure it to not prune bind mounts (which btrfs subvolumes pretend to be) and solve the issue.

So anyway upstream refused to fix the behaviour to work here, I wish they didn't but they did.

Revision history for this message
tomas j li (tomas13) wrote :

I had that broken on 22.04 as well
Just checked now - it's already working. 23.04, plocate version 1.1.18, btrfs on xanmod 6.5.5 kernel

Revision history for this message
Gannet (ken20001) wrote :

I am on 23.10 already and it is not working:

sudo updatedb --> nothing

locate fstab --> nothing

$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>

# swap was on /dev/sda2 during installation
UUID=7e115b53-56a4-444f-bd93-6ad4f15c4a61 none swap sw 0 0

# / was on /dev/sde2 during installation
UUID=d87288b4-dbdd-4448-8088-4ebb6ed6cf33 / btrfs defaults,noatime,discard=async,subvol=@ 0 1

# /home was on /dev/sde2 during installation
UUID=d87288b4-dbdd-4448-8088-4ebb6ed6cf33 /home btrfs defaults,noatime,discard=async,subvol=@home 0 2

# pool main
UUID=d87288b4-dbdd-4448-8088-4ebb6ed6cf33 /mnt/pool/main btrfs defaults,noatime,discard=async 0 2

# pool for libvirtimages
UUID=a392aeed-4ab8-41bb-b91d-70777f962945 /mnt/pool/virt btrfs defaults,noatime,compress=zstd,autodefrag 0 2

# @libvirtimages
UUID=a392aeed-4ab8-41bb-b91d-70777f962945 /var/lib/libvirt/images btrfs defaults,noatime,compress=zstd,autodefrag,subvol=@images 0 2

# homeHDD's pool
UUID=23461a7c-4fde-4c45-afb0-154942d05110 /mnt/pool/homehdd btrfs defaults,noatime,compress=zstd,autodefrag 0 2

# HDD
UUID=23461a7c-4fde-4c45-afb0-154942d05110 /mnt/hdd btrfs defaults,noatime,compress=zstd,autodefrag,subvol=@homeHDD 0 2

What should I do to make it work???

Revision history for this message
tomas j li (tomas13) wrote :

I have changed plocate and kernel versions. The btrfs driver is built into the kernel - that's probably it.
What are your plocate and kernel versions?

Revision history for this message
Gannet (ken20001) wrote :

$ LC_ALL=C aptitude show plocate
Package: plocate
Version: 1.1.19-2ubuntu1

$ uname -a
Linux p5q3 6.5.0-9-generic #9-Ubuntu SMP PREEMPT_DYNAMIC Sat Oct 7 01:35:40 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.