blob: 590cca06cfede9029117f9ef98934d74adf4bd8e [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'o88372d52002-06-15 18:58:39 -040022The format of a symbolic mode is +-=[ASacDdistu].
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),
31data journalling (j), secure deletion (s), and undeletable (u).
Theodore Ts'o3839e651997-04-26 13:21:57 +000032.SH OPTIONS
33.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000034.B \-R
Theodore Ts'o3839e651997-04-26 13:21:57 +000035Recursively change attributes of directories and their contents.
Theodore Ts'oa88fa0c1999-01-05 07:02:39 +000036Symbolic links encountered during recursive directory traversals are
37ignored.
Theodore Ts'o3839e651997-04-26 13:21:57 +000038.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000039.B \-V
Theodore Ts'oa88fa0c1999-01-05 07:02:39 +000040Be verbose with chattr's output and print the program version.
Theodore Ts'o3839e651997-04-26 13:21:57 +000041.TP
Theodore Ts'ocaf8ce41999-10-21 19:56:34 +000042.BI \-v " version"
Theodore Ts'oe1a0a3e2000-02-11 05:00:19 +000043Set the file's version/generation number.
Theodore Ts'of3db3561997-04-26 13:34:30 +000044.SH ATTRIBUTES
Theodore Ts'o5cfd7402002-06-28 10:47:24 -040045When a file with the 'A' attribute set is accessed, its atime record is
Theodore Ts'o583ccdc1997-05-09 03:06:31 +000046not modified. This avoids a certain amount of disk I/O for laptop
Theodore Ts'o2ecc6fe1997-04-29 17:57:00 +000047systems.
Theodore Ts'oa789d841998-03-30 01:20:55 +000048.PP
Theodore Ts'of3db3561997-04-26 13:34:30 +000049A file with the `a' attribute set can only be open in append mode for writing.
Theodore Ts'oa789d841998-03-30 01:20:55 +000050Only the superuser can set or clear this attribute.
51.PP
Theodore Ts'of3db3561997-04-26 13:34:30 +000052A file with the `c' attribute set is automatically compressed on the disk
53by the kernel. A read from this file returns uncompressed data. A write to
54this file compresses data before storing them on the disk.
Theodore Ts'oa789d841998-03-30 01:20:55 +000055.PP
Theodore Ts'of3db3561997-04-26 13:34:30 +000056A file with the `d' attribute set is not candidate for backup when the
57.BR dump (8)
58program is run.
Theodore Ts'oa789d841998-03-30 01:20:55 +000059.PP
Theodore Ts'of3db3561997-04-26 13:34:30 +000060A file with the `i' attribute cannot be modified: it cannot be deleted or
61renamed, no link can be created to this file and no data can be written
62to the file. Only the superuser can set or clear this attribute.
Theodore Ts'oa789d841998-03-30 01:20:55 +000063.PP
Theodore Ts'o9a718842000-12-31 13:48:12 +000064A file with the `j' attribute has all of its data written to the ext3
65journal before being written to the file itself, if the filesystem is
66mounted with the "data=ordered" or "data=writeback" options. When the
67filesystem is mounted with the "data=journalled" option all file data
68is already journalled and this attribute has no effect.
69.PP
Theodore Ts'of3db3561997-04-26 13:34:30 +000070When a file with the `s' attribute set is deleted, its blocks are zeroed and
71written back to the disk.
Theodore Ts'oa789d841998-03-30 01:20:55 +000072.PP
Theodore Ts'of3db3561997-04-26 13:34:30 +000073When a file with the `S' attribute set is modified,
74the changes are written synchronously on the disk; this is equivalent to
75the `sync' mount option applied to a subset of the files.
Theodore Ts'oa789d841998-03-30 01:20:55 +000076.PP
Theodore Ts'o88372d52002-06-15 18:58:39 -040077When a directory with the `D' attribute set is modified,
78the changes are written synchronously on the disk; this is equivalent to
79the `dirsync' mount option applied to a subset of the files.
80.PP
Theodore Ts'ob3f5b4c2001-11-05 19:22:02 -050081A file with the 't' attribute will not have a partial block fragment at
82the of the file merged with other files (for those filesystems which
83support tail-merging). This is necessary for applications such as LILO
84which read the filesystem directly, and who don't understand tail-merged
85files.
86.PP
Theodore Ts'o583ccdc1997-05-09 03:06:31 +000087When a file with the `u' attribute set is deleted, its contents are saved.
Theodore Ts'of3db3561997-04-26 13:34:30 +000088This allows the user to ask for its undeletion.
Theodore Ts'oa789d841998-03-30 01:20:55 +000089.PP
Theodore Ts'o3839e651997-04-26 13:21:57 +000090.SH AUTHOR
91.B chattr
Theodore Ts'offe4cab2000-04-03 13:27:41 +000092was written by Remy Card <Remy.Card@linux.org>.
Theodore Ts'o3839e651997-04-26 13:21:57 +000093.SH BUGS AND LIMITATIONS
Theodore Ts'offe4cab2000-04-03 13:27:41 +000094As of Linux 2.2, the `c', 's', and `u' attribute are not honored
Theodore Ts'o9a718842000-12-31 13:48:12 +000095by the kernel filesystem code. These attributes will be implemented
96in a future ext2 fs version.
Theodore Ts'o3839e651997-04-26 13:21:57 +000097.PP
Theodore Ts'o9a718842000-12-31 13:48:12 +000098The `j' option is only useful if the filesystem is mounted as ext3.
Theodore Ts'o88372d52002-06-15 18:58:39 -040099.PP
100The `D' option is only useful on Linux kernel 2.5.19 and later.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000101.SH AVAILABILITY
102.B chattr
Theodore Ts'o6d56d512001-05-12 15:46:21 +0000103is part of the e2fsprogs package and is available from
104http://e2fsprogs.sourceforge.net.
Theodore Ts'o3839e651997-04-26 13:21:57 +0000105.SH SEE ALSO
106.BR lsattr (1)