The Haiku/BeOS Tip Server
Tips and tricks for Haiku/BeOS users

Rebuild file system indices

Contributed by: Stephen van Egmond
This tip is valid for: Both BeOS and Haiku

The BeOS file system maintains a number of indices of the content of your most-used attributes in order to make queries lightning fast. While extremely rare, it is possible for an index to become corrupted. For example, you might find that a query for new mail shows that you have one unread message, even when that message is nowhere to be found. The answer to this situation is to remove and then re-build the index in question. In the example above, you would open a Terminal and type:

rmindex MAIL:status
mkindex MAIL:status

Note, however, that this merely re-establishes the existence of the index — it does not automatically add all applicaple data on your system to the index. Any new mail coming in will have its status attribute written to the index, but the status attribute of your existing messages will not. To remedy this, simply copy (don’t move) your mail folder to a new location and then replace the original folder with the copied version. An easy way to copy the whole folder is to select it and tap Alt+D (for Duplicate). The act of copying the files to a new location causes the filesystem to index the attributes being written.

Posted in Miscellaneous

(comments are closed).