blob: 1e17bd89d63ce0a94d00fd0dd9cff7e5d520f029 [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'o15f90112002-11-01 01:53:52 -050022The format of a symbolic mode is +-=[ASacDdisTtu].
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'oa789d841998-03-30 01:20:55 +000051Only the superuser can set or clear this attribute.
52.PP
Theodore Ts'of3db3561997-04-26 13:34:30 +000053A file with the `c' attribute set is automatically compressed on the disk
54by the kernel. A read from this file returns uncompressed data. A write to
55this file compresses data before storing them on the disk.
Theodore Ts'oa789d841998-03-30 01:20:55 +000056.PP
Theodore Ts'o023d1112002-08-17 14:44:56 -040057When a directory with the `D' attribute set is modified,
58the changes are written synchronously on the disk; this is equivalent to
59the `dirsync' mount option applied to a subset of the files.
60.PP
Theodore Ts'of3db3561997-04-26 13:34:30 +000061A file with the `d' attribute set is not candidate for backup when the
62.BR dump (8)
63program is run.
Theodore Ts'oa789d841998-03-30 01:20:55 +000064.PP
Theodore Ts'o023d1112002-08-17 14:44:56 -040065The 'E' attribute is used by the experimental compression patches to
66indicate that a compressed file has a compression error. It may not be
67set or reset using
68.BR chattr (1),
69although it can be displayed by
70.BR lsattr (1).
71.PP
Theodore Ts'of3db3561997-04-26 13:34:30 +000072A file with the `i' attribute cannot be modified: it cannot be deleted or
73renamed, no link can be created to this file and no data can be written
74to the file. Only the superuser can set or clear this attribute.
Theodore Ts'oa789d841998-03-30 01:20:55 +000075.PP
Theodore Ts'o9a718842000-12-31 13:48:12 +000076A file with the `j' attribute has all of its data written to the ext3
77journal before being written to the file itself, if the filesystem is
78mounted with the "data=ordered" or "data=writeback" options. When the
79filesystem is mounted with the "data=journalled" option all file data
80is already journalled and this attribute has no effect.
81.PP
Theodore Ts'of3db3561997-04-26 13:34:30 +000082When a file with the `s' attribute set is deleted, its blocks are zeroed and
83written back to the disk.
Theodore Ts'oa789d841998-03-30 01:20:55 +000084.PP
Theodore Ts'of3db3561997-04-26 13:34:30 +000085When a file with the `S' attribute set is modified,
86the changes are written synchronously on the disk; this is equivalent to
87the `sync' mount option applied to a subset of the files.
Theodore Ts'oa789d841998-03-30 01:20:55 +000088.PP
Theodore Ts'o15f90112002-11-01 01:53:52 -050089A directory with the 'T' attribute will be deemed to be the top of
90directory hierarchies for the purposes of the Orlov block allocator
91(which is used in newer kernels).
92.PP
Theodore Ts'ob3f5b4c2001-11-05 19:22:02 -050093A file with the 't' attribute will not have a partial block fragment at
94the of the file merged with other files (for those filesystems which
95support tail-merging). This is necessary for applications such as LILO
96which read the filesystem directly, and who don't understand tail-merged
97files.
98.PP
Theodore Ts'o583ccdc1997-05-09 03:06:31 +000099When a file with the `u' attribute set is deleted, its contents are saved.
Theodore Ts'of3db3561997-04-26 13:34:30 +0000100This allows the user to ask for its undeletion.
Theodore Ts'oa789d841998-03-30 01:20:55 +0000101.PP
Theodore Ts'o023d1112002-08-17 14:44:56 -0400102The 'X' attribute is used by the experimental compression patches to
103indicate that a raw contents of a compressed file can be accessed
104directly. It currently may not be set or reset using
105.BR chattr (1),
106although it can be displayed by
107.BR lsattr (1).
108.PP
109The 'Z' attribute is used by the experimental compression patches to
110indicate a compressed file is dirty. It may not be set or reset using
111.BR chattr (1),
112although it can be displayed by
113.BR lsattr (1).
114.PP
Theodore Ts'o3839e651997-04-26 13:21:57 +0000115.SH AUTHOR
116.B chattr
Theodore Ts'offe4cab2000-04-03 13:27:41 +0000117was written by Remy Card <Remy.Card@linux.org>.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000118.SH BUGS AND LIMITATIONS
Theodore Ts'offe4cab2000-04-03 13:27:41 +0000119As of Linux 2.2, the `c', 's', and `u' attribute are not honored
Theodore Ts'o9a718842000-12-31 13:48:12 +0000120by the kernel filesystem code. These attributes will be implemented
121in a future ext2 fs version.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000122.PP
Theodore Ts'o9a718842000-12-31 13:48:12 +0000123The `j' option is only useful if the filesystem is mounted as ext3.
Theodore Ts'o88372d52002-06-15 18:58:39 -0400124.PP
125The `D' option is only useful on Linux kernel 2.5.19 and later.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000126.SH AVAILABILITY
127.B chattr
Theodore Ts'o6d56d512001-05-12 15:46:21 +0000128is part of the e2fsprogs package and is available from
129http://e2fsprogs.sourceforge.net.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000130.SH SEE ALSO
131.BR lsattr (1)