9

I noticed the e attribute on several files/directories on Linux machines installed on ext4 filesystems.

[kelly@p2820887.pubip.serverbeach.com ~]$ lsattr -d /bin
-------------e- /bin

According to chattr(1):

The ’e’ attribute indicates that the file is using extents for mapping the blocks on disk. It may not be removed using chattr(1).

In what way is this different, and more importantly, in what way is this detail significant -- specifically why is this detail important enough to be reported as a file attribute? Under what circumstances should I ever change my behavior based on the knowledge that this file "is using extents for mapping the blocks on disk"? Presumably this is something I need to know, otherwise it wouldn't be made so obvious, right?

13

I think the extent flag is exposed as an attribute mainly so that you can set it with chattr, which will cause the ext4 driver to reallocate the file using extents instead of block lists. If you've converted an existing ext3 filesystem to ext4 (by using tune2fs to enable the new feature flags), you'll probably want to convert the existing files to use extents, and this is the way to do it.

Newly-created files on an ext4 filesystem always use extents (as far as I know), so if your filesystem was created as ext4 (as opposed to converted from ext3), everything should have the extent attribute already so you don't need to worry about it.

See this article for more information.

  • KVPM v0.9.9 -> write filesystem -> additional ext4 options -> use extents. There is looks like it would create the fs w/o extents, by what you said, it should be already marked/checked or disabled (unchangeable), quite confusing, could be a kvpm interface bug? but now I believe it means that there are default options, and trying to set such flags just let us change these defaults, it is just not showing us what are the defaults! probably... – Aquarius Power Apr 30 at 1:27
  • 1
    @AquariusPower, this question is about the extents flag on an individual file, but the option you see in KVPM is for whether the new filesystem should support extents at all. If you turn that off, all files will be allocated with block lists and won't have the "e" attribute. If you later run tune2fs -O extent on the filesystem to enable extents, new files will have the "e" attribute, but pre-existing ones won't until you chattr +e the file. – Wyzard --Stop Harming Monica-- Jul 4 at 17:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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