Seach locate database for external drive while drive offline

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
lagagnon

Re: Seach locate database for external drive while drive offline

Post by lagagnon »

albe.mann wrote:How can I search the database when the indexed drive is offline?
You need to use "locate -d dbpathname". Did you try that?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
DrHu

Re: Seach locate database for external drive while drive offline

Post by DrHu »

albe.mann wrote:On Windows I used the locate clone Locate32 for quickly searching my external drives while they were off
I suppose I shouldn't doubt this, but I am curious how windows magic works
How does it enable you to search a file that you cannot get to, the drive where the file is located is off-line ?
albe.mann wrote:And I have added this database file to LOCATE_PATH.
Unfortunately, locate only finds files when the indexed drive is online
Makes perfect sense, how would you expect to be able to read a file from an external disk, if that disk is not available to you, that is it is off-line (not mounted)
http://linux.about.com/od/commands/l/blcmdl1_locate.htm

Possibilities..
Or you could try sending your locate data to a virtual file system
http://freshmeat.net/articles/virtual-f ... inary-file
http://www.cyberciti.biz/faq/explain-vi ... le-system/
--but I think even trying that will not work, I cannot find the magic coffee beans so far..
Last edited by DrHu on Tue Jul 21, 2009 5:39 pm, edited 1 time in total.
DrHu

Re: Seach locate database for external drive while drive offline

Post by DrHu »

You could also use something like tracker, Ubuntu..
http://www.herikstad.net/2009/04/slow-u ... acker.html
https://wiki.ubuntu.com/Tracker
http://www.manpages.spotlynx.com/gnu_li ... edb.conf.5

I don't think you understand; this was your command
  • sudo updatedb -o external.red.db -U /media/external%red
so where is the file you want to use located on your mounted file system
  • The usual location for updatedb is /var/lib/mlocate/mlocate.db
http://www.labtestproject.com/basic_lin ... db_command
--maybe you can configure updatedb

I checked your link, I didn't see any --existing switch
http://en.wikipedia.org/wiki/GNU_locate
slocate
  • GNU locate is a Unix utility to find files on filesystems. It searches through a prebuilt database of files generated by updatedb and compressed using incremental encoding. It is significantly faster than find, but requires the database to be updated regularly.
    It can also be used to index network filesystems.
mlocate
  • mlocate is a new locate implementation. The ‘m’ stands for “merging”: updatedb reuses the existing database to avoid rereading most of the file system, which makes updatedb faster and does not trash the system caches as much.
Last edited by DrHu on Tue Jul 21, 2009 6:18 pm, edited 3 times in total.
DrHu

Re: Seach locate database for external drive while drive offline

Post by DrHu »

OK, I see it now..your link

It might have to do with which locate command is running, which configuration, and if there are any other options
--you might have to pick one or the other and see what can be done (locate or mlocate)

I don't know if it is locate or updatedb that is the problem
--how they function..
If the default location of updatedb is still being used, even after your command line, in which case it should be simple to just overwrite the /var/lib/mlocate/mlocate.db file, and see if that operation succeeds for an unmounted drive..
Locked

Return to “Software & Applications”