blob: 82f054bbb936178e77b1710226aec572c9940288 [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'ob3f5b4c2001-11-05 19:22:02 -050022The format of a symbolic mode is +-=[ASacdistu].
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'o9a718842000-12-31 13:48:12 +000028The letters `ASacdijsu' select the new attributes for the files:
Theodore Ts'o2ecc6fe1997-04-29 17:57:00 +000029don't update atime (A), synchronous updates (S), append only (a),
Theodore Ts'o9a718842000-12-31 13:48:12 +000030compressed (c), no dump (d), immutable (i), data journalling (j),
Theodore Ts'of3db3561997-04-26 13:34:30 +000031secure 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'o2ecc6fe1997-04-29 17:57:00 +000045When a file with the 'A' attribute set is modified, 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'ob3f5b4c2001-11-05 19:22:02 -050077A file with the 't' attribute will not have a partial block fragment at
78the of the file merged with other files (for those filesystems which
79support tail-merging). This is necessary for applications such as LILO
80which read the filesystem directly, and who don't understand tail-merged
81files.
82.PP
Theodore Ts'o583ccdc1997-05-09 03:06:31 +000083When a file with the `u' attribute set is deleted, its contents are saved.
Theodore Ts'of3db3561997-04-26 13:34:30 +000084This allows the user to ask for its undeletion.
Theodore Ts'oa789d841998-03-30 01:20:55 +000085.PP
Theodore Ts'o3839e651997-04-26 13:21:57 +000086.SH AUTHOR
87.B chattr
Theodore Ts'offe4cab2000-04-03 13:27:41 +000088was written by Remy Card <Remy.Card@linux.org>.
Theodore Ts'o3839e651997-04-26 13:21:57 +000089.SH BUGS AND LIMITATIONS
Theodore Ts'offe4cab2000-04-03 13:27:41 +000090As of Linux 2.2, the `c', 's', and `u' attribute are not honored
Theodore Ts'o9a718842000-12-31 13:48:12 +000091by the kernel filesystem code. These attributes will be implemented
92in a future ext2 fs version.
Theodore Ts'o3839e651997-04-26 13:21:57 +000093.PP
Theodore Ts'o9a718842000-12-31 13:48:12 +000094The `j' option is only useful if the filesystem is mounted as ext3.
Theodore Ts'o3839e651997-04-26 13:21:57 +000095.SH AVAILABILITY
96.B chattr
Theodore Ts'o6d56d512001-05-12 15:46:21 +000097is part of the e2fsprogs package and is available from
98http://e2fsprogs.sourceforge.net.
Theodore Ts'o3839e651997-04-26 13:21:57 +000099.SH SEE ALSO
100.BR lsattr (1)