Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm wondering what the output of lsattr means.It prints so oddly as follows,when I have tried: lsattr /usr.

$ lsattr /usr
-----------------e- /usr/local
-----------------e- /usr/src
-----------------e- /usr/games
--------------I--e- /usr/include
--------------I--e- /usr/share
--------------I--e- /usr/lib
-----------------e- /usr/lib32
--------------I--e- /usr/bin
--------------I--e- /usr/sbin

I've read the man page of chattr and lsattr but still have no idea.

share|improve this question
1  
You're seeing e on a ext3 volume? Really? –  Ignacio Vazquez-Abrams Feb 21 '12 at 11:05
add comment

2 Answers

From the man page of chattr The ’e’ attribute indicates that the file is using extents for mapping the blocks on disk. It may not be removed using chattr.

An extent is a contiguous area of storage in a computer file system, reserved for a file. When a process creates a file, file-system management software allocates a whole extent. When writing to the file again, possibly after doing other write operations, the data continues where the previous write left off. This reduces or eliminates file fragmentation and possibly file scattering too.

An extent-based file system (i.e., one that addresses storage via extents rather than in single blocks) need not require limiting each file to a single, contiguous extent.

The following systems support extents:

ASM - Automatic Storage Management - Oracle's database-oriented filesystem.
BFS - BeOS, Zeta and Haiku operating systems.
Btrfs - GPL'd extent based file storage (16PiB/264 max file size).
Ext4 - Linux filesystem (when the configuration enables extents — the default in Linux since version 2.6.23).
Files-11 - Digital Equipment Corporation (subsequently Hewlett-Packard) OpenVMS filesystem.
HFS and HFS Plus - Hierarchical File System - Apple Macintosh filesystems.
HPFS - High Performance File Syzstem - OS/2 and eComStation.
JFS - Journaled File System - Used by AIX, OS/2/eComStation and Linux operating systems.
Microsoft SQL Server - Versions 2000-2008 supports extents of up to 64KB [1].
Multi-Programming Executive - Filesystem by Hewlett-Packard.
NTFS - Microsoft's latest-generation file system [1]
Reiser4 - Linux filesystem (in "extents" mode).
SINTRAN III - File system used by early computer company Norsk Data.
UDF - Universal Disk Format - Standard for optical media.
VERITAS File System - Enabled via the pre-allocation API and CLI.
XFS - SGI's second generation file system.[2]

from the wikipedia

chattr and lsattr utilities on Linux and the attributes they manipulate are specific to the Second Extended Filesystem family (ext2, ext3), and are available as part of the e2fsprogs package. They don't work on files residing on other filesystems, e.g. ReiserFS, FAT.

(j) data journalling (t) no tail-merging (e) uses extends for mapping blocks on disk

Normally In the extents filesystem, regular files and directory files are stored as a sequence of extents, contiguous sequences of blocks on a disk. The directory entry for a file keeps track of the file's extents. If the filesystem needs more than one extent to hold a file, it uses a linked list of extent blocks to store information about the extents.

share|improve this answer
add comment

The man page for chattr contains all the info you need to understand the lsattr output.

excerpt

    The letters `acdeijstuACDST' select the new attributes for the files: 
    append only (a), compressed (c), no dump (d), extent format (e),  
    immutable (i),  data  journalling  (j),  secure deletion (s), no 
    tail-merging (t), undeletable (u), no atime updates (A), no copy on 
    write (C), synchronous directory updates (D), synchronous updates (S), 
    and top of directory hierarchy (T).

    The following attributes are read-only, and may be listed by lsattr(1) 
    but not modified by chattr: huge file (h), compression error (E), 
    indexed directory (I), compression raw access (X), and compressed dirty 
    file (Z).

If you take a look at the descriptions' of the tags further down in that same man page:

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

    The 'I' attribute is used by the htree code to indicate that a directory 
    is being indexed using hashed trees.  It may not be set or  reset  using
    chattr(1), although it can be displayed by lsattr(1).
share|improve this answer
add comment

Your Answer

 
discard

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.