Locate:can not open '/var/lib/mlocate/mlocate.db ': Specified database file not found __ database

Source: Internet
Author: User

When you use the Locate command to find a file, it appears:

Locate:can not open '/var/lib/mlocate/mlocate.db ': The specified database file was not found

Using #updatedb, you can solve the problem.

Locate instructions and find search file function similar, but locate is through the update program to the hard disk of all the files and directory data first set up an index database, in the execution of LOACTE directly find the index, query speed will be faster, index database is generally operated by the operating system, However, you can also directly release the update force system to immediately modify the index database. However, the first time you perform an update and then use locate to find a file often fails, you will need to perform slocate-u this command (or execute the UPDATEDB directive with the same effect) to update the Slocate database, which will be updated in the/usr/ Sbin generates slocate execution files, and then locate to the database to find the data.

Then the question comes up, and the result is:

# UpdateDB
UPDATEDB:SRC/UPDATEDB.C:595:SCAN_CWD: Assertion "Name_size > 1" failed.

Online Search This problem, only ask, did not answer, so have to solve their own.

Using UpdateDB's "-V" option, it was found that "a bizarre file in the/sys/module/nousb/parameters/directory caused UpdateDB to quit, and this bizarre file is shown in the list as follows:
ls/sys/module/nousb/parameters/-lah
Total 0
Drwxr-xr-x 2 root root 0 2008-04-24
Drwxr-xr-x 2 root root 0 2008-04-24.
Drwxr-xr-x 3 root root 0, 2008-04-24.

It was the first file and nothing was shown. There is no way to delete, restart detection file system also no errors, Halo.

Finally looked at the UpdateDB document, modified its configuration file, Modify updatedb.conf, put the directory containing this file into the prunepaths, do not let Updatedab scan the directory, and then rerun UpdateDB This command, successfully completed, to solve the problem.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.