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 | 51f8f8d | 2002-11-08 20:02:21 -0500 | [diff] [blame^] | 22 | The format of a symbolic mode is +-=[ASacDdIijsTtu]. |
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 | 88372d5 | 2002-06-15 18:58:39 -0400 | [diff] [blame] | 28 | The letters `ASacDdijsu' select the new attributes for the files: |
| 29 | don't update atime (A), synchronous updates (S), synchronous directory |
| 30 | updates (D), append only (a), compressed (c), no dump (d), immutable (i), |
Theodore Ts'o | 15f9011 | 2002-11-01 01:53:52 -0500 | [diff] [blame] | 31 | data journalling (j), secure deletion (s), top of directory hierarchy |
| 32 | (T), no tail-merging (t), and undeletable (u). |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 33 | .SH OPTIONS |
| 34 | .TP |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 35 | .B \-R |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 36 | Recursively change attributes of directories and their contents. |
Theodore Ts'o | a88fa0c | 1999-01-05 07:02:39 +0000 | [diff] [blame] | 37 | Symbolic links encountered during recursive directory traversals are |
| 38 | ignored. |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 39 | .TP |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 40 | .B \-V |
Theodore Ts'o | a88fa0c | 1999-01-05 07:02:39 +0000 | [diff] [blame] | 41 | Be verbose with chattr's output and print the program version. |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 42 | .TP |
Theodore Ts'o | caf8ce4 | 1999-10-21 19:56:34 +0000 | [diff] [blame] | 43 | .BI \-v " version" |
Theodore Ts'o | e1a0a3e | 2000-02-11 05:00:19 +0000 | [diff] [blame] | 44 | Set the file's version/generation number. |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 45 | .SH ATTRIBUTES |
Theodore Ts'o | 5cfd740 | 2002-06-28 10:47:24 -0400 | [diff] [blame] | 46 | When a file with the 'A' attribute set is accessed, its atime record is |
Theodore Ts'o | 583ccdc | 1997-05-09 03:06:31 +0000 | [diff] [blame] | 47 | 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] | 48 | systems. |
Theodore Ts'o | a789d84 | 1998-03-30 01:20:55 +0000 | [diff] [blame] | 49 | .PP |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 50 | A file with the `a' attribute set can only be open in append mode for writing. |
Theodore Ts'o | 51f8f8d | 2002-11-08 20:02:21 -0500 | [diff] [blame^] | 51 | Only the superuser or a process pessessing the CAP_LINUX_IMMUTABLE |
| 52 | capability can set or clear this attribute. |
Theodore Ts'o | a789d84 | 1998-03-30 01:20:55 +0000 | [diff] [blame] | 53 | .PP |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 54 | A file with the `c' attribute set is automatically compressed on the disk |
Theodore Ts'o | 51f8f8d | 2002-11-08 20:02:21 -0500 | [diff] [blame^] | 55 | by the kernel. A read from this file returns uncompressed data. A write to |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 56 | this file compresses data before storing them on the disk. |
Theodore Ts'o | a789d84 | 1998-03-30 01:20:55 +0000 | [diff] [blame] | 57 | .PP |
Theodore Ts'o | 023d111 | 2002-08-17 14:44:56 -0400 | [diff] [blame] | 58 | When a directory with the `D' attribute set is modified, |
| 59 | the changes are written synchronously on the disk; this is equivalent to |
| 60 | the `dirsync' mount option applied to a subset of the files. |
| 61 | .PP |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 62 | A file with the `d' attribute set is not candidate for backup when the |
| 63 | .BR dump (8) |
| 64 | program is run. |
Theodore Ts'o | a789d84 | 1998-03-30 01:20:55 +0000 | [diff] [blame] | 65 | .PP |
Theodore Ts'o | 023d111 | 2002-08-17 14:44:56 -0400 | [diff] [blame] | 66 | The 'E' attribute is used by the experimental compression patches to |
| 67 | indicate that a compressed file has a compression error. It may not be |
| 68 | set or reset using |
| 69 | .BR chattr (1), |
| 70 | although it can be displayed by |
| 71 | .BR lsattr (1). |
| 72 | .PP |
Theodore Ts'o | 51f8f8d | 2002-11-08 20:02:21 -0500 | [diff] [blame^] | 73 | The 'I' attribute is used by the htree code to indicate that a directory |
| 74 | is behind indexed using hashed trees. It may not be set or reset using |
| 75 | .BR chattr (1), |
| 76 | although it can be displayed by |
| 77 | .BR lsattr (1). |
| 78 | .PP |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 79 | A file with the `i' attribute cannot be modified: it cannot be deleted or |
| 80 | renamed, no link can be created to this file and no data can be written |
Theodore Ts'o | 51f8f8d | 2002-11-08 20:02:21 -0500 | [diff] [blame^] | 81 | to the file. Only the superuser or a process pessessing the |
| 82 | CAP_LINUX_IMMUTABLE capability can set or clear this attribute. |
Theodore Ts'o | a789d84 | 1998-03-30 01:20:55 +0000 | [diff] [blame] | 83 | .PP |
Theodore Ts'o | 9a71884 | 2000-12-31 13:48:12 +0000 | [diff] [blame] | 84 | A file with the `j' attribute has all of its data written to the ext3 |
| 85 | journal before being written to the file itself, if the filesystem is |
| 86 | mounted with the "data=ordered" or "data=writeback" options. When the |
| 87 | filesystem is mounted with the "data=journalled" option all file data |
Theodore Ts'o | 51f8f8d | 2002-11-08 20:02:21 -0500 | [diff] [blame^] | 88 | is already journalled and this attribute has no effect. |
| 89 | Only the superuser or a process possessing the CAP_SYS_RESOURCE |
| 90 | capability can set or clear this attribute. |
Theodore Ts'o | 9a71884 | 2000-12-31 13:48:12 +0000 | [diff] [blame] | 91 | .PP |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 92 | When a file with the `s' attribute set is deleted, its blocks are zeroed and |
| 93 | written back to the disk. |
Theodore Ts'o | a789d84 | 1998-03-30 01:20:55 +0000 | [diff] [blame] | 94 | .PP |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 95 | When a file with the `S' attribute set is modified, |
| 96 | the changes are written synchronously on the disk; this is equivalent to |
| 97 | the `sync' mount option applied to a subset of the files. |
Theodore Ts'o | a789d84 | 1998-03-30 01:20:55 +0000 | [diff] [blame] | 98 | .PP |
Theodore Ts'o | 15f9011 | 2002-11-01 01:53:52 -0500 | [diff] [blame] | 99 | A directory with the 'T' attribute will be deemed to be the top of |
| 100 | directory hierarchies for the purposes of the Orlov block allocator |
Theodore Ts'o | 51f8f8d | 2002-11-08 20:02:21 -0500 | [diff] [blame^] | 101 | (which is used in on systems with Linux 2.5.46 or later). |
Theodore Ts'o | 15f9011 | 2002-11-01 01:53:52 -0500 | [diff] [blame] | 102 | .PP |
Theodore Ts'o | b3f5b4c | 2001-11-05 19:22:02 -0500 | [diff] [blame] | 103 | A file with the 't' attribute will not have a partial block fragment at |
| 104 | the of the file merged with other files (for those filesystems which |
| 105 | support tail-merging). This is necessary for applications such as LILO |
| 106 | which read the filesystem directly, and who don't understand tail-merged |
| 107 | files. |
| 108 | .PP |
Theodore Ts'o | 583ccdc | 1997-05-09 03:06:31 +0000 | [diff] [blame] | 109 | 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] | 110 | This allows the user to ask for its undeletion. |
Theodore Ts'o | a789d84 | 1998-03-30 01:20:55 +0000 | [diff] [blame] | 111 | .PP |
Theodore Ts'o | 023d111 | 2002-08-17 14:44:56 -0400 | [diff] [blame] | 112 | The 'X' attribute is used by the experimental compression patches to |
| 113 | indicate that a raw contents of a compressed file can be accessed |
| 114 | directly. It currently may not be set or reset using |
| 115 | .BR chattr (1), |
| 116 | although it can be displayed by |
| 117 | .BR lsattr (1). |
| 118 | .PP |
| 119 | The 'Z' attribute is used by the experimental compression patches to |
| 120 | indicate a compressed file is dirty. It may not be set or reset using |
| 121 | .BR chattr (1), |
| 122 | although it can be displayed by |
| 123 | .BR lsattr (1). |
| 124 | .PP |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 125 | .SH AUTHOR |
| 126 | .B chattr |
Theodore Ts'o | ffe4cab | 2000-04-03 13:27:41 +0000 | [diff] [blame] | 127 | was written by Remy Card <Remy.Card@linux.org>. |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 128 | .SH BUGS AND LIMITATIONS |
Theodore Ts'o | ffe4cab | 2000-04-03 13:27:41 +0000 | [diff] [blame] | 129 | 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] | 130 | by the kernel filesystem code. These attributes will be implemented |
| 131 | in a future ext2 fs version. |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 132 | .PP |
Theodore Ts'o | 9a71884 | 2000-12-31 13:48:12 +0000 | [diff] [blame] | 133 | The `j' option is only useful if the filesystem is mounted as ext3. |
Theodore Ts'o | 88372d5 | 2002-06-15 18:58:39 -0400 | [diff] [blame] | 134 | .PP |
| 135 | The `D' option is only useful on Linux kernel 2.5.19 and later. |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 136 | .SH AVAILABILITY |
| 137 | .B chattr |
Theodore Ts'o | 6d56d51 | 2001-05-12 15:46:21 +0000 | [diff] [blame] | 138 | is part of the e2fsprogs package and is available from |
| 139 | http://e2fsprogs.sourceforge.net. |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 140 | .SH SEE ALSO |
| 141 | .BR lsattr (1) |