]> git.ipfire.org Git - thirdparty/e2fsprogs.git/blob - misc/chattr.1.in
Clarify chattr man page to make sure people realize limitations in the kernel
[thirdparty/e2fsprogs.git] / misc / chattr.1.in
1 .\" -*- nroff -*-
2 .TH CHATTR 1 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
3 .SH NAME
4 chattr \- change file attributes on a Linux second extended file system
5 .SH SYNOPSIS
6 .B chattr
7 [
8 .B \-RV
9 ]
10 [
11 .B \-v
12 .I version
13 ]
14 [
15 .I mode
16 ]
17 .I files...
18 .SH DESCRIPTION
19 .B chattr
20 changes the file attributes on a Linux second extended file system.
21 .PP
22 The format of a symbolic mode is +-=[ASacDdIijsTtu].
23 .PP
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.
27 .PP
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).
33 .SH OPTIONS
34 .TP
35 .B \-R
36 Recursively change attributes of directories and their contents.
37 Symbolic links encountered during recursive directory traversals are
38 ignored.
39 .TP
40 .B \-V
41 Be verbose with chattr's output and print the program version.
42 .TP
43 .BI \-v " version"
44 Set the file's version/generation number.
45 .SH ATTRIBUTES
46 When a file with the 'A' attribute set is accessed, its atime record is
47 not modified. This avoids a certain amount of disk I/O for laptop
48 systems.
49 .PP
50 A file with the `a' attribute set can only be open in append mode for writing.
51 Only the superuser or a process possessing the CAP_LINUX_IMMUTABLE
52 capability can set or clear this attribute.
53 .PP
54 A file with the `c' attribute set is automatically compressed on the disk
55 by the kernel. A read from this file returns uncompressed data. A write to
56 this file compresses data before storing them on the disk. Note: please
57 make sure to read the bugs and limitations section at the end of this
58 document.
59 .PP
60 When a directory with the `D' attribute set is modified,
61 the changes are written synchronously on the disk; this is equivalent to
62 the `dirsync' mount option applied to a subset of the files.
63 .PP
64 A file with the `d' attribute set is not candidate for backup when the
65 .BR dump (8)
66 program is run.
67 .PP
68 The 'E' attribute is used by the experimental compression patches to
69 indicate that a compressed file has a compression error. It may not be
70 set or reset using
71 .BR chattr (1),
72 although it can be displayed by
73 .BR lsattr (1).
74 .PP
75 The 'I' attribute is used by the htree code to indicate that a directory
76 is behind indexed using hashed trees. It may not be set or reset using
77 .BR chattr (1),
78 although it can be displayed by
79 .BR lsattr (1).
80 .PP
81 A file with the `i' attribute cannot be modified: it cannot be deleted or
82 renamed, no link can be created to this file and no data can be written
83 to the file. Only the superuser or a process possessing the
84 CAP_LINUX_IMMUTABLE capability can set or clear this attribute.
85 .PP
86 A file with the `j' attribute has all of its data written to the ext3
87 journal before being written to the file itself, if the filesystem is
88 mounted with the "data=ordered" or "data=writeback" options. When the
89 filesystem is mounted with the "data=journal" option all file data
90 is already journalled and this attribute has no effect.
91 Only the superuser or a process possessing the CAP_SYS_RESOURCE
92 capability can set or clear this attribute.
93 .PP
94 When a file with the `s' attribute set is deleted, its blocks are zeroed
95 and written back to the disk. Note: please make sure to read the bugs
96 and limitations section at the end of this document.
97 .PP
98 When a file with the `S' attribute set is modified,
99 the changes are written synchronously on the disk; this is equivalent to
100 the `sync' mount option applied to a subset of the files.
101 .PP
102 A directory with the 'T' attribute will be deemed to be the top of
103 directory hierarchies for the purposes of the Orlov block allocator
104 (which is used in on systems with Linux 2.5.46 or later).
105 .PP
106 A file with the 't' attribute will not have a partial block fragment at
107 the end of the file merged with other files (for those filesystems which
108 support tail-merging). This is necessary for applications such as LILO
109 which read the filesystem directly, and which don't understand tail-merged
110 files. Note: As of this writing, the ext2 or ext3 filesystems do not
111 (yet, except in very experimental patches) support tail-merging.
112 .PP
113 When a file with the `u' attribute set is deleted, its contents are
114 saved. This allows the user to ask for its undeletion. Note: please
115 make sure to read the bugs and limitations section at the end of this
116 document.
117 .PP
118 The 'X' attribute is used by the experimental compression patches to
119 indicate that a raw contents of a compressed file can be accessed
120 directly. It currently may not be set or reset using
121 .BR chattr (1),
122 although it can be displayed by
123 .BR lsattr (1).
124 .PP
125 The 'Z' attribute is used by the experimental compression patches to
126 indicate a compressed file is dirty. It may not be set or reset using
127 .BR chattr (1),
128 although it can be displayed by
129 .BR lsattr (1).
130 .PP
131 .SH AUTHOR
132 .B chattr
133 was written by Remy Card <Remy.Card@linux.org>. It is currently being
134 maintained by Theodore Ts'o <tytso@alum.mit.edu>.
135 .SH BUGS AND LIMITATIONS
136 The `c', 's', and `u' attributes are not honored
137 by the ext2 and ext3 filesystems as implemented in the current mainline
138 Linux kernels. These attributes may be implemented
139 in future versions of the ext2 and ext3 filesystems.
140 .PP
141 The `j' option is only useful if the filesystem is mounted as ext3.
142 .PP
143 The `D' option is only useful on Linux kernel 2.5.19 and later.
144 .SH AVAILABILITY
145 .B chattr
146 is part of the e2fsprogs package and is available from
147 http://e2fsprogs.sourceforge.net.
148 .SH SEE ALSO
149 .BR lsattr (1)