Why is /var/lib/mlocate.db almost 800 MB?

Can I do something about it? I'm running out of disk space.

4

4 Answers

On one of my systems that acts as a backup server, mlocate.db hit 9GB. The solution was to exclude the backup directories from locate, since I had no need to search them.

I did this by adding the backup directory to PRUNEPATHS in /etc/updatedb.conf.

Running sudo updatedb then reduced it to 1.6MB (and saves a huge amount of time indexing all of those files).

2

If you have lots and lots of files on your machine, you may want to consider pruning some paths from the database. You can do this in /etc/updatedb.conf under PRUNEPATHS. You can also prune file systems (like nfs, if you so desire).

800MB sounds pretty much. My /var/lib/mlocate/mlocate.db is about 8MB only (fresh install on 10.04 release date). You can safely delete it, if you run sudo updatedb, it'll be recreated.

5

Its a database of all files in your root directory. It is used by locate utility. if you delete this file locate will no longer work.

6

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like