Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

share|improve this question
    
May look as a strange question, but: How do you find the file's size? –  ulidtko Jan 28 '11 at 22:58
    
The database could be stored as a sparse file, and hence real disk usage may differ significantly from that reported by ls and du. –  ulidtko Jan 28 '11 at 23:07

4 Answers 4

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).

share|improve this answer

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).

share|improve this answer

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.

share|improve this answer
    
thanks, that worked. After running sudo updatedb it is now 620MB. edit: oops I read that wrong. 620MB would mean it didn't work (I thought I read KB on my file output). –  evencoil Jan 28 '11 at 15:17
    
How many files do you have? What is your disk size? –  Lekensteyn Jan 28 '11 at 20:57
1  
Is it really that big? Size in MB: 'du -m /var/lib/mlocate/mlocate.db' –  user8290 Jan 28 '11 at 21:12
    
Also both du and ls have an -h flag ` : -h, --human-readable` print sizes in human readable format (e.g., 1K 234M 2G) –  belacq Jan 28 '11 at 22:02
    
It is really that big...I do have a lot of very small files (related to some data work) across several hard drives, so maybe that is why. edit: I also keep many backups...Is there a way to exclude directories from the indexer? Probably indexing these backups is the big problem. –  evencoil Jan 30 '11 at 12:28

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.

share|improve this answer
    
is it really supposed to be that large? –  evencoil Jan 28 '11 at 14:04
    
It should not be that big. Most probably you have lots of files in your home directory. You can erase it and then let the update run again. –  user4124 Jan 28 '11 at 14:43
    
if I erase it will it be recreated automatically at some point? –  evencoil Jan 28 '11 at 15:20
    
it will be recreated when you run "updatedb" command –  binW Jan 28 '11 at 16:45
    
it seems to also be recreated as a daily task? –  evencoil Jan 30 '11 at 12:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.