I have a few directories mounted from a samba share server (my lan storage) and I would like to run updatedb on them. I use to successfully run such command to do that:

updatedb -l 0 -o ~/.myDbFile.db -U /mnt/myCustomDirectory/

under /mnt/myCustomDirectory/ there are, individual mounted samba shares, such as:


and so on.

After a fresh installation of the latest linux Mint 19.2 (same as Ubuntu 18.04), the .myDbFile.db is empty and nothing gets indexed.

If instead I run the command on a single share, the dbFile gets indexed:

updatedb -l 0 -o ~/.myDbFile_Music.db -U /mnt/myCustomDirectory/Music

Any idea why the first command does not work recursive into the single folders?

  • 1
    Maybe because smbfs is in the PRUNEFS list, but by specifying a file below the mount point you skip over that check? Mar 15, 2020 at 18:14

1 Answer 1


Here is the solution I figured out in the end.

For updatedb, I loop over the single directories mounted and create a specific db file:

alias updatedb_lanserver='cd /mnt/myCustomDirectory; for folder in *; do updatedb -l 0 -o ~/.lan_server_$folder.db -U $folder; done'

To search all these db files at once I created a bash function:

locate_lanserver() { for dbfile in ~/.lan_server*.db; do locate -d $dbfile -i $1; done }

now I can simply use the function to search something:

locate_lanserver text_to_be_searched
  • editing /etc/updatedb.conf would probably be the simpler and faster solution
    – xeruf
    May 16, 2022 at 16:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .