]> git.ipfire.org Git - thirdparty/e2fsprogs.git/blob - misc/chattr.1.in
Fixed chattr man page to clarify description of the 't' (no tail)
[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 `ASacDdijsu' select the new attributes for the files:
29 don't update atime (A), synchronous updates (S), synchronous directory
30 updates (D), append only (a), compressed (c), no dump (d), immutable (i),
31 data journalling (j), secure deletion (s), top of directory hierarchy
32 (T), no tail-merging (t), and undeletable (u).
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.
57 .PP
58 When a directory with the `D' attribute set is modified,
59 the changes are written synchronously on the disk; this is equivalent to
60 the `dirsync' mount option applied to a subset of the files.
61 .PP
62 A file with the `d' attribute set is not candidate for backup when the
63 .BR dump (8)
64 program is run.
65 .PP
66 The 'E' attribute is used by the experimental compression patches to
67 indicate that a compressed file has a compression error. It may not be
68 set or reset using
69 .BR chattr (1),
70 although it can be displayed by
71 .BR lsattr (1).
72 .PP
73 The 'I' attribute is used by the htree code to indicate that a directory
74 is behind indexed using hashed trees. It may not be set or reset using
75 .BR chattr (1),
76 although it can be displayed by
77 .BR lsattr (1).
78 .PP
79 A file with the `i' attribute cannot be modified: it cannot be deleted or
80 renamed, no link can be created to this file and no data can be written
81 to the file. Only the superuser or a process possessing the
82 CAP_LINUX_IMMUTABLE capability can set or clear this attribute.
83 .PP
84 A file with the `j' attribute has all of its data written to the ext3
85 journal before being written to the file itself, if the filesystem is
86 mounted with the "data=ordered" or "data=writeback" options. When the
87 filesystem is mounted with the "data=journal" option all file data
88 is already journalled and this attribute has no effect.
89 Only the superuser or a process possessing the CAP_SYS_RESOURCE
90 capability can set or clear this attribute.
91 .PP
92 When a file with the `s' attribute set is deleted, its blocks are zeroed and
93 written back to the disk.
94 .PP
95 When a file with the `S' attribute set is modified,
96 the changes are written synchronously on the disk; this is equivalent to
97 the `sync' mount option applied to a subset of the files.
98 .PP
99 A directory with the 'T' attribute will be deemed to be the top of
100 directory hierarchies for the purposes of the Orlov block allocator
101 (which is used in on systems with Linux 2.5.46 or later).
102 .PP
103 A file with the 't' attribute will not have a partial block fragment at
104 the end of the file merged with other files (for those filesystems which
105 support tail-merging). This is necessary for applications such as LILO
106 which read the filesystem directly, and which don't understand tail-merged
107 files. Note: As of this writing, the ext2 or ext3 filesystems do not
108 (yet, except in very experimental patches) support tail-merging.
109 .PP
110 When a file with the `u' attribute set is deleted, its contents are saved.
111 This allows the user to ask for its undeletion.
112 .PP
113 The 'X' attribute is used by the experimental compression patches to
114 indicate that a raw contents of a compressed file can be accessed
115 directly. It currently may not be set or reset using
116 .BR chattr (1),
117 although it can be displayed by
118 .BR lsattr (1).
119 .PP
120 The 'Z' attribute is used by the experimental compression patches to
121 indicate a compressed file is dirty. It 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 .SH AUTHOR
127 .B chattr
128 was written by Remy Card <Remy.Card@linux.org>.
129 .SH BUGS AND LIMITATIONS
130 As of Linux 2.2, the `c', 's', and `u' attribute are not honored
131 by the kernel filesystem code. These attributes will be implemented
132 in a future ext2 fs version.
133 .PP
134 The `j' option is only useful if the filesystem is mounted as ext3.
135 .PP
136 The `D' option is only useful on Linux kernel 2.5.19 and later.
137 .SH AVAILABILITY
138 .B chattr
139 is part of the e2fsprogs package and is available from
140 http://e2fsprogs.sourceforge.net.
141 .SH SEE ALSO
142 .BR lsattr (1)