You need to use "locate -d dbpathname". Did you try that?albe.mann wrote:How can I search the database when the indexed drive is offline?
Seach locate database for external drive while drive offline
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Re: Seach locate database for external drive while drive offline
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.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: Seach locate database for external drive while drive offline
I suppose I shouldn't doubt this, but I am curious how windows magic worksalbe.mann wrote:On Windows I used the locate clone Locate32 for quickly searching my external drives while they were off
How does it enable you to search a file that you cannot get to, the drive where the file is located is off-line ?
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)albe.mann wrote:And I have added this database file to LOCATE_PATH.
Unfortunately, locate only finds files when the indexed drive is online
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.
Re: Seach locate database for external drive while drive offline
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
--maybe you can configure updatedb
I checked your link, I didn't see any --existing switch
http://en.wikipedia.org/wiki/GNU_locate
slocate
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
- The usual location for updatedb is /var/lib/mlocate/mlocate.db
--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 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.
Re: Seach locate database for external drive while drive offline
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..
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..