Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 101034 - [2007.0] mkfs.ext2: -O dir_index would override default options
Summary: [2007.0] mkfs.ext2: -O dir_index would override default options
Status: RESOLVED FIXED
Alias: None
Product: [OLD] Docs on www.gentoo.org
Classification: Unclassified
Component: Installation Handbook (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Docs Team
URL: http://www.gentoo.org/doc/en/handbook...
Whiteboard:
Keywords:
Depends on:
Blocks: 170536
  Show dependency tree
 
Reported: 2005-08-01 15:34 UTC by Wiktor Wandachowicz
Modified: 2007-03-14 10:10 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wiktor Wandachowicz 2005-08-01 15:34:46 UTC
I'm using currently with great success an ext3 root partition in favor of
reiserfs/xfs/jfs/reiser4. I tried all of them in the aforementioned order, but
finally I came back to ext3 filesystem. Why? Because there are two things:
* ext3 is a tried, mostly error-free filesystem,
* it has a very nice dir_index option, comparable with (or maybe better than?)
  reiserXX implementations,

I have to admit that after looking in current Handbook I'm very positively
surprised that the default proposal is to go with ext2 => /bootand ext3 => /
partitions. That's a nice change, compared to default "mkreiserfs" I remember
when I first was installing Gentoo. But enough background for now, let's go to
the real enhancement request.

A handbook in the chapter 4, point "4.d. Creating Filesystems" mentions that
ext3 filesystem "has an additional hashed b-tree indexing option that enables
high performance in almost all situations". However, there's no example of how
to get the mentioned "high performance". And it's quite simple!

Basically there's a "dir_index" ext3's option, which creates hashed b-trees for
long directories, which speeds up reading their contents.


Reproducible: Always
Steps to Reproduce:
1. Go to the "4.d. Creating Filesystems" section in Handbook:
http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=4#doc_chap4 
   to see an original command:
   # mke2fs -j /dev/hda3
2. Go to the "Some ext3 Filesystem Tips" topic in the forums:
http://forums.gentoo.org/viewtopic-t-305871.html
   to see quite a good discussion of the dir_index option.

Actual Results:  
A. When creating a new ext3 filesystem, all that's needed to get the
   aforementioned "high performance" is to do:
   # mke2fs -j -O dir_index /dev/hda3
B. For existing ext3 filesystem it's possible to turn the "dir_index" option,
   by executing:
   # tune2fs -O dir_index /dev/hda3
   # e2fsck -D /dev/hda3


Expected Results:  
Please add an example in the handbook of how to use "dir_index" option for ext3
filesystem. This way more [new] Gentoo users may want to use this from the very
beginning.

And last but not th least: IMHO, the "emerge --sync" completes faster for me on
ext3 filesystem compared to reiserfs/reiser4 on the same partition!
Comment 1 Sven Vermeulen (RETIRED) gentoo-dev 2005-08-02 01:04:51 UTC
Thanks. I've added this information to the handbook but not in the real example
yet (only in the explanation). I need more information from the architectures to
know if dir_index is recommended by them as a good default (as it is with SPARC)
or not.
Comment 2 Wiktor Wandachowicz 2005-08-02 04:02:39 UTC
Thank you very much! :-) That fits there very well indeed, and probably may be
enough.

Just one more tiny proposal form my side. The -O in the text you've kindly added
can be easily misinterpreted as -0 by someone. That's why I reopened the bug. To
prevent such mistakes please add a small clarification, as such:

"You can enable this indexing by adding -O dir_index to the mke2fs command
(using a capital -O, not zero: -0)."

Thanks again for a very quick response!

Comment 3 Sven Vermeulen (RETIRED) gentoo-dev 2005-08-02 04:48:18 UTC
Missing between O and 0 happens in a lot of cases, not only here. I don't think
it is needed to clarify this even more now; lots of people just copy/paste or
take care when they see something like this.

Also, the mke2fs command will tell the user that -0 is no valid option. I'd
rather not update the handbook for this.
Comment 4 Jan Kundrát (RETIRED) gentoo-dev 2006-08-16 17:56:15 UTC
Specifying the "-O foo" option will override the default settings from /etc/mke2fs.conf. As of sys-fs/e2fsprogs-1.39 (current x86 stable), the defaults are "sparse_super,filetype,resize_inode,dir_index". So, if you follow the advice from the Handbook, you'll get "dir_index" only which is *not* good. 

Could be worth marking as a blocker for 2006.1 to limit the number of people with suboptimal settings :).
Comment 5 Jan Kundrát (RETIRED) gentoo-dev 2006-08-16 18:11:02 UTC
I'd do it myself but I'm sort of AF[gentoo]K till mid September so this is probably the best way...
Comment 6 nm (RETIRED) gentoo-dev 2006-08-29 10:51:07 UTC
All fixed in the upcoming 2006.1 handbooks; release is soon, no point in updating the old 2006.0 handbooks. :)
Comment 7 nm (RETIRED) gentoo-dev 2006-08-29 10:52:09 UTC
Oops, forgot to mark RESO FIXED per above.
Comment 8 Xavier Neys (RETIRED) gentoo-dev 2007-02-16 13:49:11 UTC
(In reply to comment #4)
> Specifying the "-O foo" option will override the default settings from
> /etc/mke2fs.conf. As of sys-fs/e2fsprogs-1.39 (current x86 stable)

2006.1 uses 1.38. A bit of checking wouldn't hurt :)


dir_index will most likely be on by default for 2007.0 (>=sys-fs/e2fsprogs-1.39)
Comment 9 nm (RETIRED) gentoo-dev 2007-02-21 21:33:14 UTC
(In reply to comment #8)
> dir_index will most likely be on by default for 2007.0
> (>=sys-fs/e2fsprogs-1.39)

Indeed, it will be, so we'll need to take that out for the handbook again. :p
Comment 10 nm (RETIRED) gentoo-dev 2007-03-14 07:32:25 UTC
Fixed in the 2007.0 drafts. In CVS.
Comment 11 Xavier Neys (RETIRED) gentoo-dev 2007-03-14 10:10:20 UTC
For the record, adding -O dir_index until 1.38 was a good idea.
As of 1.39, it does not make any difference.
dir_index is on by default and adding it to the command line does not override anything.

[14 10:44:44] <leio> so, good information :)
[14 10:50:13] <leio> neysx: but apparently not true
[14 10:50:26] <leio> the filesystem was formatted as follows:
[14 10:50:32] <leio> mke2fs -j -O dir_index,resize_inode -v /dev/hda2
[14 10:50:41] <leio> dumpe2fs gives the following as features:
[14 10:50:46] <leio> Filesystem features:      has_journal resize_inode dir_index filetype needs_recovery sparse_super large_file
[14 10:51:02] <leio> is -O overriding the defaults a new thing in 1.39 too?
[14 11:00:03] <neysx> so I have been told, haven't checked it really overrides all, but dir_index is now on by default
[14 11:00:06] <neysx> gimme a minute
[14 11:01:47] <neysx> mke2fs -j /dev/sdc1
[14 11:01:50] <neysx> Filesystem features:      has_journal resize_inode dir_index filetype sparse_super large_file
[14 11:02:34] <neysx> mke2fs -j -O dir_index /dev/sdc1
[14 11:02:36] <neysx> Filesystem features:      has_journal resize_inode dir_index filetype sparse_super large_file
[14 11:02:49] <neysx> pfft, does not make a difference