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