blob: 1cab6189b528fbcca8717d92ed73dd7d95aa5239 [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'o2ecc6fe1997-04-29 17:57:00 +000022The format of a symbolic mode is +-=[ASacdisu].
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'o583ccdc1997-05-09 03:06:31 +000077When a file with the `u' attribute set is deleted, its contents are saved.
Theodore Ts'of3db3561997-04-26 13:34:30 +000078This allows the user to ask for its undeletion.
Theodore Ts'oa789d841998-03-30 01:20:55 +000079.PP
Theodore Ts'o3839e651997-04-26 13:21:57 +000080.SH AUTHOR
81.B chattr
Theodore Ts'offe4cab2000-04-03 13:27:41 +000082was written by Remy Card <Remy.Card@linux.org>.
Theodore Ts'o3839e651997-04-26 13:21:57 +000083.SH BUGS AND LIMITATIONS
Theodore Ts'offe4cab2000-04-03 13:27:41 +000084As of Linux 2.2, the `c', 's', and `u' attribute are not honored
Theodore Ts'o9a718842000-12-31 13:48:12 +000085by the kernel filesystem code. These attributes will be implemented
86in a future ext2 fs version.
Theodore Ts'o3839e651997-04-26 13:21:57 +000087.PP
Theodore Ts'o9a718842000-12-31 13:48:12 +000088The `j' option is only useful if the filesystem is mounted as ext3.
Theodore Ts'o3839e651997-04-26 13:21:57 +000089.SH AVAILABILITY
90.B chattr
Theodore Ts'oa789d841998-03-30 01:20:55 +000091is part of the e2fsprogs package and is available for anonymous
92ftp from tsx-11.mit.edu in /pub/linux/packages/ext2fs.
Theodore Ts'o3839e651997-04-26 13:21:57 +000093.SH SEE ALSO
94.BR lsattr (1)