Whamcloud - gitweb
misc: fix typos in chattr's man page
[tools/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 file system
5 .SH SYNOPSIS
6 .B chattr
7 [
8 .B \-RVf
9 ]
10 [
11 .B \-v
12 .I version
13 ]
14 [
15 .B \-p
16 .I project
17 ]
18 [
19 .I mode
20 ]
21 .I files...
22 .SH DESCRIPTION
23 .B chattr
24 changes the file attributes on a Linux file system.
25 .PP
26 The format of a symbolic mode is +-=[aAcCdDeFijPsStTu].
27 .PP
28 The operator '+' causes the selected attributes to be added to the
29 existing attributes of the files; '-' causes them to be removed; and '='
30 causes them to be the only attributes that the files have.
31 .PP
32 The letters 'aAcCdDeFijPsStTu' select the new attributes for the files:
33 append only (a),
34 no atime updates (A),
35 compressed (c),
36 no copy on write (C),
37 no dump (d),
38 synchronous directory updates (D),
39 extent format (e),
40 case-insensitive directory lookups (F),
41 immutable (i),
42 data journalling (j),
43 project hierarchy (P),
44 secure deletion (s),
45 synchronous updates (S),
46 no tail-merging (t),
47 top of directory hierarchy (T),
48 and undeletable (u).
49 .PP
50 The following attributes are read-only, and may be listed by
51 .BR lsattr (1)
52 but not modified by chattr:
53 encrypted (E),
54 indexed directory (I),
55 inline data (N),
56 and verity (V).
57 .PP
58 Not all flags are supported or utilized by all filesystems; refer to
59 filesystem-specific man pages such as
60 .BR btrfs (5),
61 .BR ext4 (5),
62 and
63 .BR xfs (5)
64 for more filesystem-specific details.
65 .SH OPTIONS
66 .TP
67 .B \-R
68 Recursively change attributes of directories and their contents.
69 .TP
70 .B \-V
71 Be verbose with chattr's output and print the program version.
72 .TP
73 .B \-f
74 Suppress most error messages.
75 .TP
76 .BI \-v " version"
77 Set the file's version/generation number.
78 .TP
79 .BI \-p " project"
80 Set the file's project number.
81 .SH ATTRIBUTES
82 .TP
83 .B a
84 A file with the 'a' attribute set can only be opened in append mode for
85 writing.  Only the superuser or a process possessing the
86 CAP_LINUX_IMMUTABLE capability can set or clear this attribute.
87 .TP
88 .B A
89 When a file with the 'A' attribute set is accessed, its atime record is
90 not modified.  This avoids a certain amount of disk I/O for laptop
91 systems.
92 .TP
93 .B c
94 A file with the 'c' attribute set is automatically compressed on the disk
95 by the kernel.  A read from this file returns uncompressed data.  A write to
96 this file compresses data before storing them on the disk.  Note: please
97 make sure to read the bugs and limitations section at the end of this
98 document.
99 .TP
100 .B C
101 A file with the 'C' attribute set will not be subject to copy-on-write
102 updates.  This flag is only supported on file systems which perform
103 copy-on-write.  (Note: For btrfs, the 'C' flag should be
104 set on new or empty files.  If it is set on a file which already has
105 data blocks, it is undefined when the blocks assigned to the file will
106 be fully stable.  If the 'C' flag is set on a directory, it will have no
107 effect on the directory, but new files created in that directory will
108 have the No_COW attribute set.)
109 .TP
110 .B d
111 A file with the 'd' attribute set is not a candidate for backup when the
112 .BR dump (8)
113 program is run.
114 .TP
115 .B D
116 When a directory with the 'D' attribute set is modified,
117 the changes are written synchronously to the disk; this is equivalent to
118 the 'dirsync' mount option applied to a subset of the files.
119 .TP
120 .B e
121 The 'e' attribute indicates that the file is using extents for mapping
122 the blocks on disk.  It may not be removed using
123 .BR chattr (1).
124 .TP
125 .B E
126 A file, directory, or symlink with the 'E' attribute set is encrypted by the
127 filesystem.  This attribute may not be set or cleared using
128 .BR chattr (1),
129 although it can be displayed by
130 .BR lsattr (1).
131 .TP
132 .B F
133 A directory with the 'F' attribute set indicates that all the path
134 lookups inside that directory are made in a case-insensitive fashion.
135 This attribute can only be changed in empty directories on file systems
136 with the casefold feature enabled.
137 .TP
138 .B i
139 A file with the 'i' attribute cannot be modified: it cannot be deleted or
140 renamed, no link can be created to this file, most of the file's
141 metadata can not be modified, and the file can not be opened in write mode.
142 Only the superuser or a process possessing the CAP_LINUX_IMMUTABLE
143 capability can set or clear this attribute.
144 .TP
145 .B I
146 The 'I' attribute is used by the htree code to indicate that a directory
147 is being indexed using hashed trees.  It may not be set or cleared using
148 .BR chattr (1),
149 although it can be displayed by
150 .BR lsattr (1).
151 .TP
152 .B j
153 A file with the 'j' attribute has all of its data written to the ext3 or
154 ext4 journal before being written to the file itself, if the file system
155 is mounted with the "data=ordered" or "data=writeback" options and the
156 file system has a journal.  When the filesystem is mounted with the
157 "data=journal" option all file data is already journalled and this
158 attribute has no effect.  Only the superuser or a process possessing the
159 CAP_SYS_RESOURCE capability can set or clear this attribute.
160 .TP
161 .B N
162 A file with the 'N' attribute set indicates that the file has data
163 stored inline, within the inode itself. It may not be set or cleared
164 using
165 .BR chattr (1),
166 although it can be displayed by
167 .BR lsattr (1).
168 .TP
169 .B P
170 A directory with the 'P' attribute set will enforce a hierarchical
171 structure for project id's.  This means that files and directories created
172 in the directory will inherit the project id of the directory, rename
173 operations are constrained so when a file or directory is moved into
174 another directory, that the project ids must match.  In addition, a
175 hard link to file can only be created when the project id for the file
176 and the destination directory match.
177 .TP
178 .B s
179 When a file with the 's' attribute set is deleted, its blocks are zeroed
180 and written back to the disk.  Note: please make sure to read the bugs
181 and limitations section at the end of this document.
182 .TP
183 .B S
184 When a file with the 'S' attribute set is modified,
185 the changes are written synchronously to the disk; this is equivalent to
186 the 'sync' mount option applied to a subset of the files.
187 .TP
188 .B t
189 A file with the 't' attribute will not have a partial block fragment at
190 the end of the file merged with other files (for those filesystems which
191 support tail-merging).  This is necessary for applications such as LILO
192 which read the filesystem directly, and which don't understand tail-merged
193 files.  Note: As of this writing, the ext2, ext3, and ext4 filesystems do
194 not support tail-merging.
195 .TP
196 .B T
197 A directory with the 'T' attribute will be deemed to be the top of
198 directory hierarchies for the purposes of the Orlov block allocator.
199 This is a hint to the block allocator used by ext3 and ext4 that the
200 subdirectories under this directory are not related, and thus should be
201 spread apart for allocation purposes.   For example it is a very good
202 idea to set the 'T' attribute on the /home directory, so that /home/john
203 and /home/mary are placed into separate block groups.  For directories
204 where this attribute is not set, the Orlov block allocator will try to
205 group subdirectories closer together where possible.
206 .TP
207 .B u
208 When a file with the 'u' attribute set is deleted, its contents are
209 saved.  This allows the user to ask for its undeletion.  Note: please
210 make sure to read the bugs and limitations section at the end of this
211 document.
212 .TP
213 .B V
214 A file with the 'V' attribute set has fs-verity enabled.  It cannot be
215 written to, and the filesystem will automatically verify all data read
216 from it against a cryptographic hash that covers the entire file's
217 contents, e.g. via a Merkle tree.  This makes it possible to efficiently
218 authenticate the file.  This attribute may not be set or cleared using
219 .BR chattr (1),
220 although it can be displayed by
221 .BR lsattr (1).
222 .PP
223 .SH AUTHOR
224 .B chattr
225 was written by Remy Card <Remy.Card@linux.org>.  It is currently being
226 maintained by Theodore Ts'o <tytso@alum.mit.edu>.
227 .SH BUGS AND LIMITATIONS
228 The 'c', 's',  and 'u' attributes are not honored
229 by the ext2, ext3, and ext4 filesystems as implemented in the current
230 mainline Linux kernels.
231 Setting 'a' and 'i' attributes will not affect the ability to write
232 to already existing file descriptors.
233 .PP
234 The 'j' option is only useful for ext3 and ext4 file systems.
235 .PP
236 The 'D' option is only useful on Linux kernel 2.5.19 and later.
237 .SH AVAILABILITY
238 .B chattr
239 is part of the e2fsprogs package and is available from
240 http://e2fsprogs.sourceforge.net.
241 .SH SEE ALSO
242 .BR lsattr (1),
243 .BR btrfs (5),
244 .BR ext4 (5),
245 .BR xfs (5).