Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 1 | .\" -*- nroff -*- |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 2 | .TH CHATTR 1 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@" |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 3 | .SH NAME |
| 4 | chattr \- change file attributes on a Linux second extended file system |
| 5 | .SH SYNOPSIS |
| 6 | .B chattr |
| 7 | [ |
| 8 | .B \-RV |
| 9 | ] |
| 10 | [ |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 11 | .B \-v |
| 12 | .I version |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 13 | ] |
| 14 | [ |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 15 | .I mode |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 16 | ] |
| 17 | .I files... |
| 18 | .SH DESCRIPTION |
| 19 | .B chattr |
Theodore Ts'o | 583ccdc | 1997-05-09 03:06:31 +0000 | [diff] [blame] | 20 | changes the file attributes on a Linux second extended file system. |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 21 | .PP |
Theodore Ts'o | 2ecc6fe | 1997-04-29 17:57:00 +0000 | [diff] [blame] | 22 | The format of a symbolic mode is +-=[ASacdisu]. |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 23 | .PP |
| 24 | The operator `+' causes the selected attributes to be added to the |
| 25 | existing 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'o | 9a71884 | 2000-12-31 13:48:12 +0000 | [diff] [blame] | 28 | The letters `ASacdijsu' select the new attributes for the files: |
Theodore Ts'o | 2ecc6fe | 1997-04-29 17:57:00 +0000 | [diff] [blame] | 29 | don't update atime (A), synchronous updates (S), append only (a), |
Theodore Ts'o | 9a71884 | 2000-12-31 13:48:12 +0000 | [diff] [blame] | 30 | compressed (c), no dump (d), immutable (i), data journalling (j), |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 31 | secure deletion (s), and undeletable (u). |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 32 | .SH OPTIONS |
| 33 | .TP |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 34 | .B \-R |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 35 | Recursively change attributes of directories and their contents. |
Theodore Ts'o | a88fa0c | 1999-01-05 07:02:39 +0000 | [diff] [blame] | 36 | Symbolic links encountered during recursive directory traversals are |
| 37 | ignored. |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 38 | .TP |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 39 | .B \-V |
Theodore Ts'o | a88fa0c | 1999-01-05 07:02:39 +0000 | [diff] [blame] | 40 | Be verbose with chattr's output and print the program version. |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 41 | .TP |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 42 | .BI \-v " version" |
Theodore Ts'o | e1a0a3e | 2000-02-11 05:00:19 +0000 | [diff] [blame] | 43 | Set the file's version/generation number. |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 44 | .SH ATTRIBUTES |
Theodore Ts'o | 2ecc6fe | 1997-04-29 17:57:00 +0000 | [diff] [blame] | 45 | When a file with the 'A' attribute set is modified, its atime record is |
Theodore Ts'o | 583ccdc | 1997-05-09 03:06:31 +0000 | [diff] [blame] | 46 | not modified. This avoids a certain amount of disk I/O for laptop |
Theodore Ts'o | 2ecc6fe | 1997-04-29 17:57:00 +0000 | [diff] [blame] | 47 | systems. |
Theodore Ts'o | a789d84 | 1998-03-30 01:20:55 +0000 | [diff] [blame] | 48 | .PP |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 49 | A file with the `a' attribute set can only be open in append mode for writing. |
Theodore Ts'o | a789d84 | 1998-03-30 01:20:55 +0000 | [diff] [blame] | 50 | Only the superuser can set or clear this attribute. |
| 51 | .PP |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 52 | A file with the `c' attribute set is automatically compressed on the disk |
| 53 | by the kernel. A read from this file returns uncompressed data. A write to |
| 54 | this file compresses data before storing them on the disk. |
Theodore Ts'o | a789d84 | 1998-03-30 01:20:55 +0000 | [diff] [blame] | 55 | .PP |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 56 | A file with the `d' attribute set is not candidate for backup when the |
| 57 | .BR dump (8) |
| 58 | program is run. |
Theodore Ts'o | a789d84 | 1998-03-30 01:20:55 +0000 | [diff] [blame] | 59 | .PP |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 60 | A file with the `i' attribute cannot be modified: it cannot be deleted or |
| 61 | renamed, no link can be created to this file and no data can be written |
| 62 | to the file. Only the superuser can set or clear this attribute. |
Theodore Ts'o | a789d84 | 1998-03-30 01:20:55 +0000 | [diff] [blame] | 63 | .PP |
Theodore Ts'o | 9a71884 | 2000-12-31 13:48:12 +0000 | [diff] [blame] | 64 | A file with the `j' attribute has all of its data written to the ext3 |
| 65 | journal before being written to the file itself, if the filesystem is |
| 66 | mounted with the "data=ordered" or "data=writeback" options. When the |
| 67 | filesystem is mounted with the "data=journalled" option all file data |
| 68 | is already journalled and this attribute has no effect. |
| 69 | .PP |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 70 | When a file with the `s' attribute set is deleted, its blocks are zeroed and |
| 71 | written back to the disk. |
Theodore Ts'o | a789d84 | 1998-03-30 01:20:55 +0000 | [diff] [blame] | 72 | .PP |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 73 | When a file with the `S' attribute set is modified, |
| 74 | the changes are written synchronously on the disk; this is equivalent to |
| 75 | the `sync' mount option applied to a subset of the files. |
Theodore Ts'o | a789d84 | 1998-03-30 01:20:55 +0000 | [diff] [blame] | 76 | .PP |
Theodore Ts'o | 583ccdc | 1997-05-09 03:06:31 +0000 | [diff] [blame] | 77 | When a file with the `u' attribute set is deleted, its contents are saved. |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 78 | This allows the user to ask for its undeletion. |
Theodore Ts'o | a789d84 | 1998-03-30 01:20:55 +0000 | [diff] [blame] | 79 | .PP |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 80 | .SH AUTHOR |
| 81 | .B chattr |
Theodore Ts'o | ffe4cab | 2000-04-03 13:27:41 +0000 | [diff] [blame] | 82 | was written by Remy Card <Remy.Card@linux.org>. |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 83 | .SH BUGS AND LIMITATIONS |
Theodore Ts'o | ffe4cab | 2000-04-03 13:27:41 +0000 | [diff] [blame] | 84 | As of Linux 2.2, the `c', 's', and `u' attribute are not honored |
Theodore Ts'o | 9a71884 | 2000-12-31 13:48:12 +0000 | [diff] [blame] | 85 | by the kernel filesystem code. These attributes will be implemented |
| 86 | in a future ext2 fs version. |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 87 | .PP |
Theodore Ts'o | 9a71884 | 2000-12-31 13:48:12 +0000 | [diff] [blame] | 88 | The `j' option is only useful if the filesystem is mounted as ext3. |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 89 | .SH AVAILABILITY |
| 90 | .B chattr |
Theodore Ts'o | 6d56d51 | 2001-05-12 15:46:21 +0000 | [diff] [blame] | 91 | is part of the e2fsprogs package and is available from |
| 92 | http://e2fsprogs.sourceforge.net. |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 93 | .SH SEE ALSO |
| 94 | .BR lsattr (1) |