Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

It's often recommended to enable dir_index option on ext3 filesystems e.g. with

sudo tune2fs -O dir_index /dev/dm-1

However, existing directories on that filesystem are not converted to indexed format automatically.

Is there any way to tell if particular directory has been indexed?

share|improve this question

I'm not aware of a way to tell if a directory has been indexed, but you can ensure that they all get indexed by running this after setting the dir_index option:

e2fsck -D /dev/dm-1

From the e2fsck man page:

    -D     Optimize  directories  in filesystem.  This option causes e2fsck
           to try to optimize all directories, either by reindexing them if
           the  filesystem  supports directory indexing,  or by sorting and
           compressing directories for smaller directories, or for filesys-
           tems using traditional linear directories.
share|improve this answer
I should point out that you need to unmount the filesystem before running the e2fsck command... – Insyte Aug 19 '09 at 16:06

Your Answer


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.