]> git.ipfire.org Git - thirdparty/e2fsprogs.git/blob - misc/chattr.1.in
Merge branch 'maint' into next
[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 \-RVf
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 .TP
38 .B \-V
39 Be verbose with chattr's output and print the program version.
40 .TP
41 .B \-f
42 Suppress most error messages.
43 .TP
44 .BI \-v " version"
45 Set the file's version/generation number.
46 .SH ATTRIBUTES
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
49 systems.
50 .PP
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.
54 .PP
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
59 document.
60 .PP
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.
64 .PP
65 A file with the `d' attribute set is not candidate for backup when the
66 .BR dump (8)
67 program is run.
68 .PP
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
71 set or reset using
72 .BR chattr (1),
73 although it can be displayed by
74 .BR lsattr (1).
75 .PP
76 The 'I' attribute is used by the htree code to indicate that a directory
77 is being indexed using hashed trees. It may not be set or reset using
78 .BR chattr (1),
79 although it can be displayed by
80 .BR lsattr (1).
81 .PP
82 A file with the `i' attribute cannot be modified: it cannot be deleted or
83 renamed, no link can be created to this file and no data can be written
84 to the file. Only the superuser or a process possessing the
85 CAP_LINUX_IMMUTABLE capability can set or clear this attribute.
86 .PP
87 A file with the `j' attribute has all of its data written to the ext3
88 journal before being written to the file itself, if the filesystem is
89 mounted with the "data=ordered" or "data=writeback" options. When the
90 filesystem is mounted with the "data=journal" option all file data
91 is already journalled and this attribute has no effect.
92 Only the superuser or a process possessing the CAP_SYS_RESOURCE
93 capability can set or clear this attribute.
94 .PP
95 When a file with the `s' attribute set is deleted, its blocks are zeroed
96 and written back to the disk. Note: please make sure to read the bugs
97 and limitations section at the end of this document.
98 .PP
99 When a file with the `S' attribute set is modified,
100 the changes are written synchronously on the disk; this is equivalent to
101 the `sync' mount option applied to a subset of the files.
102 .PP
103 A directory with the 'T' attribute will be deemed to be the top of
104 directory hierarchies for the purposes of the Orlov block allocator
105 (which is used in on systems with Linux 2.5.46 or later).
106 .PP
107 A file with the 't' attribute will not have a partial block fragment at
108 the end of the file merged with other files (for those filesystems which
109 support tail-merging). This is necessary for applications such as LILO
110 which read the filesystem directly, and which don't understand tail-merged
111 files. Note: As of this writing, the ext2 or ext3 filesystems do not
112 (yet, except in very experimental patches) support tail-merging.
113 .PP
114 When a file with the `u' attribute set is deleted, its contents are
115 saved. This allows the user to ask for its undeletion. Note: please
116 make sure to read the bugs and limitations section at the end of this
117 document.
118 .PP
119 The 'X' attribute is used by the experimental compression patches to
120 indicate that a raw contents of a compressed file can be accessed
121 directly. It currently may not be set or reset using
122 .BR chattr (1),
123 although it can be displayed by
124 .BR lsattr (1).
125 .PP
126 The 'Z' attribute is used by the experimental compression patches to
127 indicate a compressed file is dirty. It may not be set or reset using
128 .BR chattr (1),
129 although it can be displayed by
130 .BR lsattr (1).
131 .PP
132 .SH AUTHOR
133 .B chattr
134 was written by Remy Card <Remy.Card@linux.org>. It is currently being
135 maintained by Theodore Ts'o <tytso@alum.mit.edu>.
136 .SH BUGS AND LIMITATIONS
137 The `c', 's', and `u' attributes are not honored
138 by the ext2 and ext3 filesystems as implemented in the current mainline
139 Linux kernels. These attributes may be implemented
140 in future versions of the ext2 and ext3 filesystems.
141 .PP
142 The `j' option is only useful if the filesystem is mounted as ext3.
143 .PP
144 The `D' option is only useful on Linux kernel 2.5.19 and later.
145 .SH AVAILABILITY
146 .B chattr
147 is part of the e2fsprogs package and is available from
148 http://e2fsprogs.sourceforge.net.
149 .SH SEE ALSO
150 .BR lsattr (1)