2 .TH CHATTR 1 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
4 chattr \- change file attributes on a Linux second extended file system
20 changes the file attributes on a Linux second extended file system.
22 The format of a symbolic mode is +-=[ASacDdeIijsTtu].
24 The operator `+' causes the selected attributes to be added to the
25 existing attributes of the files; `-' causes them to be removed; and
26 `=' causes them to be the only attributes that the files have.
28 The letters `acdijsuADST' select the new attributes for the files:
29 append only (a), compressed (c), no dump (d), immutable (i),
30 data journalling (j), secure deletion (s), no tail-merging (t),
31 undeletable (u), no atime updates (A), synchronous directory updates (D),
32 synchronous updates (S), and top of directory hierarchy (T).
36 Recursively change attributes of directories and their contents.
39 Be verbose with chattr's output and print the program version.
42 Suppress most error messages.
45 Set the file's version/generation number.
47 When a file with the 'A' attribute set is accessed, its atime record is
48 not modified. This avoids a certain amount of disk I/O for laptop
51 A file with the `a' attribute set can only be open in append mode for writing.
52 Only the superuser or a process possessing the CAP_LINUX_IMMUTABLE
53 capability can set or clear this attribute.
55 A file with the `c' attribute set is automatically compressed on the disk
56 by the kernel. A read from this file returns uncompressed data. A write to
57 this file compresses data before storing them on the disk. Note: please
58 make sure to read the bugs and limitations section at the end of this
61 When a directory with the `D' attribute set is modified,
62 the changes are written synchronously on the disk; this is equivalent to
63 the `dirsync' mount option applied to a subset of the files.
65 A file with the `d' attribute set is not candidate for backup when the
69 The 'E' attribute is used by the experimental compression patches to
70 indicate that a compressed file has a compression error. It may not be
73 although it can be displayed by
76 The 'e' attribute indicates that the file is using extents for mapping
77 the blocks on disk. It may not be removed using
80 The 'I' attribute is used by the htree code to indicate that a directory
81 is being indexed using hashed trees. It may not be set or reset using
83 although it can be displayed by
86 The 'H' attribute indicates the file is storing its blocks in units of the
87 filesystem blocksize instead of in units of sectors, and means that the file
88 is (or at one time was) larger than 2TB. It may not be set or reset using
90 although it can be displayed by
93 A file with the `i' attribute cannot be modified: it cannot be deleted or
94 renamed, no link can be created to this file and no data can be written
95 to the file. Only the superuser or a process possessing the
96 CAP_LINUX_IMMUTABLE capability can set or clear this attribute.
98 A file with the `j' attribute has all of its data written to the ext3
99 journal before being written to the file itself, if the filesystem is
100 mounted with the "data=ordered" or "data=writeback" options. When the
101 filesystem is mounted with the "data=journal" option all file data
102 is already journalled and this attribute has no effect.
103 Only the superuser or a process possessing the CAP_SYS_RESOURCE
104 capability can set or clear this attribute.
106 When a file with the `s' attribute set is deleted, its blocks are zeroed
107 and written back to the disk. Note: please make sure to read the bugs
108 and limitations section at the end of this document.
110 When a file with the `S' attribute set is modified,
111 the changes are written synchronously on the disk; this is equivalent to
112 the `sync' mount option applied to a subset of the files.
114 A directory with the 'T' attribute will be deemed to be the top of
115 directory hierarchies for the purposes of the Orlov block allocator.
116 This is a hint to the block allocator used by ext3 and ext4 that the
117 subdirectories under this directory are not related, and thus should be
118 spread apart for allocation purposes. For example it is a very good
119 idea to set the 'T' attribute on the /home directory, so that /home/john
120 and /home/mary are placed into separate block groups. For directories
121 where this attribute is not set, the Orlov block allocator will try to
122 group subdirectories closer together where posible.
124 A file with the 't' attribute will not have a partial block fragment at
125 the end of the file merged with other files (for those filesystems which
126 support tail-merging). This is necessary for applications such as LILO
127 which read the filesystem directly, and which don't understand tail-merged
128 files. Note: As of this writing, the ext2 or ext3 filesystems do not
129 (yet, except in very experimental patches) support tail-merging.
131 When a file with the `u' attribute set is deleted, its contents are
132 saved. This allows the user to ask for its undeletion. Note: please
133 make sure to read the bugs and limitations section at the end of this
136 The 'X' attribute is used by the experimental compression patches to
137 indicate that a raw contents of a compressed file can be accessed
138 directly. It currently may not be set or reset using
140 although it can be displayed by
143 The 'Z' attribute is used by the experimental compression patches to
144 indicate a compressed file is dirty. It may not be set or reset using
146 although it can be displayed by
151 was written by Remy Card <Remy.Card@linux.org>. It is currently being
152 maintained by Theodore Ts'o <tytso@alum.mit.edu>.
153 .SH BUGS AND LIMITATIONS
154 The `c', 's', and `u' attributes are not honored
155 by the ext2 and ext3 filesystems as implemented in the current mainline
156 Linux kernels. These attributes may be implemented
157 in future versions of the ext2 and ext3 filesystems.
159 The `j' option is only useful if the filesystem is mounted as ext3.
161 The `D' option is only useful on Linux kernel 2.5.19 and later.
164 is part of the e2fsprogs package and is available from
165 http://e2fsprogs.sourceforge.net.