Just annotations of little "how to's", so I know I can find how to do something I've already done when I need to do it again, in case I don't remember anymore, which is not unlikely. Hopefully they can be useful to others, but I can't guarantee that it will work, or that it won't even make things worse.
It may be useful to have separate mlocate databases for removable drives
Firstly because by default "/media" is pruned. But if you'd only remove it from there, then you'd end risking dumbly updating and erasing or rewriting stuff depending on which removable drive is plugged/mounted there.
A separate database can be created with commands along the lines of:
Apparently mlocate ignores the LOCATE_PATH environment variable, which could, apparently, allow for both files to be searched at once with the "locate" command without parameters specifying each database. Maybe it's some other thing I have going wrong, though.
Whatever is the reason why, it can be mimicked with bash aliases adding the default and additional databases:
Besides mlocate, there's also plocate, which seems to be still a bit unsuitable to use with multiple databases. As far as I've understood, it uses mlocate's database, creates a smaller one for itself, which allows it to work faster. But I'm not sure it's ready to create additional of such faster databases for the separate drives. At least it's no a "transparent" experience where you don't need to do anything, I guess.
Maybe it can be done, but mlocate alone is fast already, and would end up requiring less disk space, since plocate uses builds its own databases from mlocate's. Perhaps it could be set-up so it would remove the mlocate one every time, but then the updates themselves would take longer, as it would also need to recreate a new one from scratch to update its own.
A separate database can be created with commands along the lines of:
Code:
sudo updatedb --localpaths=/media/removable1 --output=/var/lib/mlocate/removable1.db
Whatever is the reason why, it can be mimicked with bash aliases adding the default and additional databases:
Code:
alias locate='locate -i -d /var/lib/mlocate/mlocate.db:/var/lib/mlocate/removable1.db'
Maybe it can be done, but mlocate alone is fast already, and would end up requiring less disk space, since plocate uses builds its own databases from mlocate's. Perhaps it could be set-up so it would remove the mlocate one every time, but then the updates themselves would take longer, as it would also need to recreate a new one from scratch to update its own.
Total Comments 0