blob: e5ea58e06179943671bced800cb7e1d0ba098f6e [file] [log] [blame]
Theodore Ts'o3839e651997-04-26 13:21:57 +00001.\" -*- nroff -*-
Theodore Ts'o74becf31997-04-26 14:37:06 +00002.TH CHATTR 1 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
Theodore Ts'o3839e651997-04-26 13:21:57 +00003.SH NAME
4chattr \- change file attributes on a Linux second extended file system
5.SH SYNOPSIS
6.B chattr
7[
8.B \-RV
9]
10[
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000011.B \-v
12.I version
Theodore Ts'o3839e651997-04-26 13:21:57 +000013]
14[
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000015.I mode
Theodore Ts'o3839e651997-04-26 13:21:57 +000016]
17.I files...
18.SH DESCRIPTION
19.B chattr
Theodore Ts'o583ccdc1997-05-09 03:06:31 +000020changes the file attributes on a Linux second extended file system.
Theodore Ts'o3839e651997-04-26 13:21:57 +000021.PP
Theodore Ts'o51f8f8d2002-11-08 20:02:21 -050022The format of a symbolic mode is +-=[ASacDdIijsTtu].
Theodore Ts'o3839e651997-04-26 13:21:57 +000023.PP
24The operator `+' causes the selected attributes to be added to the
25existing attributes of the files; `-' causes them to be removed; and
26`=' causes them to be the only attributes that the files have.
27.PP
Theodore Ts'o2e5a1b92004-01-31 20:27:36 -050028The letters `acdijsuADST' select the new attributes for the files:
29append only (a), compressed (c), no dump (d), immutable (i),
30data journalling (j), secure deletion (s), no tail-merging (t),
31undeletable (u), no atime updates (A), synchronous directory updates (D),
32synchronous updates (S), and top of directory hierarchy (T).
Theodore Ts'o3839e651997-04-26 13:21:57 +000033.SH OPTIONS
34.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000035.B \-R
Theodore Ts'o3839e651997-04-26 13:21:57 +000036Recursively change attributes of directories and their contents.
Theodore Ts'oa88fa0c1999-01-05 07:02:39 +000037Symbolic links encountered during recursive directory traversals are
38ignored.
Theodore Ts'o3839e651997-04-26 13:21:57 +000039.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000040.B \-V
Theodore Ts'oa88fa0c1999-01-05 07:02:39 +000041Be verbose with chattr's output and print the program version.
Theodore Ts'o3839e651997-04-26 13:21:57 +000042.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000043.BI \-v " version"
Theodore Ts'oe1a0a3e2000-02-11 05:00:19 +000044Set the file's version/generation number.
Theodore Ts'of3db3561997-04-26 13:34:30 +000045.SH ATTRIBUTES
Theodore Ts'o5cfd7402002-06-28 10:47:24 -040046When a file with the 'A' attribute set is accessed, its atime record is
Theodore Ts'o583ccdc1997-05-09 03:06:31 +000047not modified. This avoids a certain amount of disk I/O for laptop
Theodore Ts'o2ecc6fe1997-04-29 17:57:00 +000048systems.
Theodore Ts'oa789d841998-03-30 01:20:55 +000049.PP
Theodore Ts'of3db3561997-04-26 13:34:30 +000050A file with the `a' attribute set can only be open in append mode for writing.
Theodore Ts'o77be4d22003-03-06 12:39:55 -050051Only the superuser or a process possessing the CAP_LINUX_IMMUTABLE
Theodore Ts'o51f8f8d2002-11-08 20:02:21 -050052capability can set or clear this attribute.
Theodore Ts'oa789d841998-03-30 01:20:55 +000053.PP
Theodore Ts'of3db3561997-04-26 13:34:30 +000054A file with the `c' attribute set is automatically compressed on the disk
Theodore Ts'o51f8f8d2002-11-08 20:02:21 -050055by the kernel. A read from this file returns uncompressed data. A write to
Theodore Ts'of3db3561997-04-26 13:34:30 +000056this file compresses data before storing them on the disk.
Theodore Ts'oa789d841998-03-30 01:20:55 +000057.PP
Theodore Ts'o023d1112002-08-17 14:44:56 -040058When a directory with the `D' attribute set is modified,
59the changes are written synchronously on the disk; this is equivalent to
60the `dirsync' mount option applied to a subset of the files.
61.PP
Theodore Ts'of3db3561997-04-26 13:34:30 +000062A file with the `d' attribute set is not candidate for backup when the
63.BR dump (8)
64program is run.
Theodore Ts'oa789d841998-03-30 01:20:55 +000065.PP
Theodore Ts'o023d1112002-08-17 14:44:56 -040066The 'E' attribute is used by the experimental compression patches to
67indicate that a compressed file has a compression error. It may not be
68set or reset using
69.BR chattr (1),
70although it can be displayed by
71.BR lsattr (1).
72.PP
Theodore Ts'o51f8f8d2002-11-08 20:02:21 -050073The 'I' attribute is used by the htree code to indicate that a directory
74is behind indexed using hashed trees. It may not be set or reset using
75.BR chattr (1),
76although it can be displayed by
77.BR lsattr (1).
78.PP
Theodore Ts'of3db3561997-04-26 13:34:30 +000079A file with the `i' attribute cannot be modified: it cannot be deleted or
80renamed, no link can be created to this file and no data can be written
Theodore Ts'o77be4d22003-03-06 12:39:55 -050081to the file. Only the superuser or a process possessing the
Theodore Ts'o51f8f8d2002-11-08 20:02:21 -050082CAP_LINUX_IMMUTABLE capability can set or clear this attribute.
Theodore Ts'oa789d841998-03-30 01:20:55 +000083.PP
Theodore Ts'o9a718842000-12-31 13:48:12 +000084A file with the `j' attribute has all of its data written to the ext3
85journal before being written to the file itself, if the filesystem is
86mounted with the "data=ordered" or "data=writeback" options. When the
Theodore Ts'o77be4d22003-03-06 12:39:55 -050087filesystem is mounted with the "data=journal" option all file data
Theodore Ts'o51f8f8d2002-11-08 20:02:21 -050088is already journalled and this attribute has no effect.
89Only the superuser or a process possessing the CAP_SYS_RESOURCE
90capability can set or clear this attribute.
Theodore Ts'o9a718842000-12-31 13:48:12 +000091.PP
Theodore Ts'of3db3561997-04-26 13:34:30 +000092When a file with the `s' attribute set is deleted, its blocks are zeroed and
93written back to the disk.
Theodore Ts'oa789d841998-03-30 01:20:55 +000094.PP
Theodore Ts'of3db3561997-04-26 13:34:30 +000095When a file with the `S' attribute set is modified,
96the changes are written synchronously on the disk; this is equivalent to
97the `sync' mount option applied to a subset of the files.
Theodore Ts'oa789d841998-03-30 01:20:55 +000098.PP
Theodore Ts'o15f90112002-11-01 01:53:52 -050099A directory with the 'T' attribute will be deemed to be the top of
100directory hierarchies for the purposes of the Orlov block allocator
Theodore Ts'o51f8f8d2002-11-08 20:02:21 -0500101(which is used in on systems with Linux 2.5.46 or later).
Theodore Ts'o15f90112002-11-01 01:53:52 -0500102.PP
Theodore Ts'ob3f5b4c2001-11-05 19:22:02 -0500103A file with the 't' attribute will not have a partial block fragment at
Theodore Ts'ofc05eb02003-03-25 23:02:34 -0500104the end of the file merged with other files (for those filesystems which
Theodore Ts'ob3f5b4c2001-11-05 19:22:02 -0500105support tail-merging). This is necessary for applications such as LILO
Theodore Ts'ofc05eb02003-03-25 23:02:34 -0500106which read the filesystem directly, and which don't understand tail-merged
107files. Note: As of this writing, the ext2 or ext3 filesystems do not
108(yet, except in very experimental patches) support tail-merging.
Theodore Ts'ob3f5b4c2001-11-05 19:22:02 -0500109.PP
Theodore Ts'o583ccdc1997-05-09 03:06:31 +0000110When a file with the `u' attribute set is deleted, its contents are saved.
Theodore Ts'of3db3561997-04-26 13:34:30 +0000111This allows the user to ask for its undeletion.
Theodore Ts'oa789d841998-03-30 01:20:55 +0000112.PP
Theodore Ts'o023d1112002-08-17 14:44:56 -0400113The 'X' attribute is used by the experimental compression patches to
114indicate that a raw contents of a compressed file can be accessed
115directly. It currently may not be set or reset using
116.BR chattr (1),
117although it can be displayed by
118.BR lsattr (1).
119.PP
120The 'Z' attribute is used by the experimental compression patches to
121indicate a compressed file is dirty. It may not be set or reset using
122.BR chattr (1),
123although it can be displayed by
124.BR lsattr (1).
125.PP
Theodore Ts'o3839e651997-04-26 13:21:57 +0000126.SH AUTHOR
127.B chattr
Theodore Ts'o2e5a1b92004-01-31 20:27:36 -0500128was written by Remy Card <Remy.Card@linux.org>. It is currently being
129maintained by Theodore Ts'o <tytso@alum.mit.edu>.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000130.SH BUGS AND LIMITATIONS
Theodore Ts'ocf119022003-12-26 14:03:20 -0500131The `c', 's', and `u' attributes are not honored
132by the ext2 and ext3 filesystems as implemented in the current mainline
133Linux kernels. These attributes may be implemented
134in future versions ext2 and ext3.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000135.PP
Theodore Ts'o9a718842000-12-31 13:48:12 +0000136The `j' option is only useful if the filesystem is mounted as ext3.
Theodore Ts'o88372d52002-06-15 18:58:39 -0400137.PP
138The `D' option is only useful on Linux kernel 2.5.19 and later.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000139.SH AVAILABILITY
140.B chattr
Theodore Ts'o6d56d512001-05-12 15:46:21 +0000141is part of the e2fsprogs package and is available from
142http://e2fsprogs.sourceforge.net.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000143.SH SEE ALSO
144.BR lsattr (1)