blob: 6c9ecf106417c0a96ee2600b0cfe5ea8e49ad187 [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'o88372d52002-06-15 18:58:39 -040028The letters `ASacDdijsu' select the new attributes for the files:
29don't update atime (A), synchronous updates (S), synchronous directory
30updates (D), append only (a), compressed (c), no dump (d), immutable (i),
Theodore Ts'o15f90112002-11-01 01:53:52 -050031data journalling (j), secure deletion (s), top of directory hierarchy
32(T), no tail-merging (t), and undeletable (u).
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'o51f8f8d2002-11-08 20:02:21 -050051Only the superuser or a process pessessing the CAP_LINUX_IMMUTABLE
52capability 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'o51f8f8d2002-11-08 20:02:21 -050081to the file. Only the superuser or a process pessessing the
82CAP_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
87filesystem is mounted with the "data=journalled" 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
104the of the file merged with other files (for those filesystems which
105support tail-merging). This is necessary for applications such as LILO
106which read the filesystem directly, and who don't understand tail-merged
107files.
108.PP
Theodore Ts'o583ccdc1997-05-09 03:06:31 +0000109When a file with the `u' attribute set is deleted, its contents are saved.
Theodore Ts'of3db3561997-04-26 13:34:30 +0000110This allows the user to ask for its undeletion.
Theodore Ts'oa789d841998-03-30 01:20:55 +0000111.PP
Theodore Ts'o023d1112002-08-17 14:44:56 -0400112The 'X' attribute is used by the experimental compression patches to
113indicate that a raw contents of a compressed file can be accessed
114directly. It currently may not be set or reset using
115.BR chattr (1),
116although it can be displayed by
117.BR lsattr (1).
118.PP
119The 'Z' attribute is used by the experimental compression patches to
120indicate a compressed file is dirty. It may not be set or reset using
121.BR chattr (1),
122although it can be displayed by
123.BR lsattr (1).
124.PP
Theodore Ts'o3839e651997-04-26 13:21:57 +0000125.SH AUTHOR
126.B chattr
Theodore Ts'offe4cab2000-04-03 13:27:41 +0000127was written by Remy Card <Remy.Card@linux.org>.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000128.SH BUGS AND LIMITATIONS
Theodore Ts'offe4cab2000-04-03 13:27:41 +0000129As of Linux 2.2, the `c', 's', and `u' attribute are not honored
Theodore Ts'o9a718842000-12-31 13:48:12 +0000130by the kernel filesystem code. These attributes will be implemented
131in a future ext2 fs version.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000132.PP
Theodore Ts'o9a718842000-12-31 13:48:12 +0000133The `j' option is only useful if the filesystem is mounted as ext3.
Theodore Ts'o88372d52002-06-15 18:58:39 -0400134.PP
135The `D' option is only useful on Linux kernel 2.5.19 and later.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000136.SH AVAILABILITY
137.B chattr
Theodore Ts'o6d56d512001-05-12 15:46:21 +0000138is part of the e2fsprogs package and is available from
139http://e2fsprogs.sourceforge.net.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000140.SH SEE ALSO
141.BR lsattr (1)