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 | 2e5a1b9 | 2004-01-31 20:27:36 -0500 | [diff] [blame] | 28 | The letters `acdijsuADST' select the new attributes for the files: |
| 29 | append only (a), compressed (c), no dump (d), immutable (i), |
| 30 | data journalling (j), secure deletion (s), no tail-merging (t), |
| 31 | undeletable (u), no atime updates (A), synchronous directory updates (D), |
| 32 | synchronous updates (S), and top of directory hierarchy (T). |
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 | 77be4d2 | 2003-03-06 12:39:55 -0500 | [diff] [blame] | 51 | Only the superuser or a process possessing the CAP_LINUX_IMMUTABLE |
Theodore Ts'o | 51f8f8d | 2002-11-08 20:02:21 -0500 | [diff] [blame] | 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 | 1aa3d56 | 2005-12-31 01:04:40 -0500 | [diff] [blame] | 56 | this file compresses data before storing them on the disk. Note: please |
| 57 | make sure to read the bugs and limitations section at the end of this |
| 58 | document. |
Theodore Ts'o | a789d84 | 1998-03-30 01:20:55 +0000 | [diff] [blame] | 59 | .PP |
Theodore Ts'o | 023d111 | 2002-08-17 14:44:56 -0400 | [diff] [blame] | 60 | When a directory with the `D' attribute set is modified, |
| 61 | the changes are written synchronously on the disk; this is equivalent to |
| 62 | the `dirsync' mount option applied to a subset of the files. |
| 63 | .PP |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 64 | A file with the `d' attribute set is not candidate for backup when the |
| 65 | .BR dump (8) |
| 66 | program is run. |
Theodore Ts'o | a789d84 | 1998-03-30 01:20:55 +0000 | [diff] [blame] | 67 | .PP |
Theodore Ts'o | 023d111 | 2002-08-17 14:44:56 -0400 | [diff] [blame] | 68 | The 'E' attribute is used by the experimental compression patches to |
| 69 | indicate that a compressed file has a compression error. It may not be |
| 70 | set or reset using |
| 71 | .BR chattr (1), |
| 72 | although it can be displayed by |
| 73 | .BR lsattr (1). |
| 74 | .PP |
Theodore Ts'o | 51f8f8d | 2002-11-08 20:02:21 -0500 | [diff] [blame] | 75 | The 'I' attribute is used by the htree code to indicate that a directory |
Theodore Ts'o | e71be1c | 2006-07-15 21:55:33 -0400 | [diff] [blame] | 76 | is being indexed using hashed trees. It may not be set or reset using |
Theodore Ts'o | 51f8f8d | 2002-11-08 20:02:21 -0500 | [diff] [blame] | 77 | .BR chattr (1), |
| 78 | although it can be displayed by |
| 79 | .BR lsattr (1). |
| 80 | .PP |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 81 | A file with the `i' attribute cannot be modified: it cannot be deleted or |
| 82 | renamed, no link can be created to this file and no data can be written |
Theodore Ts'o | 77be4d2 | 2003-03-06 12:39:55 -0500 | [diff] [blame] | 83 | to the file. Only the superuser or a process possessing the |
Theodore Ts'o | 51f8f8d | 2002-11-08 20:02:21 -0500 | [diff] [blame] | 84 | CAP_LINUX_IMMUTABLE capability can set or clear this attribute. |
Theodore Ts'o | a789d84 | 1998-03-30 01:20:55 +0000 | [diff] [blame] | 85 | .PP |
Theodore Ts'o | 9a71884 | 2000-12-31 13:48:12 +0000 | [diff] [blame] | 86 | A file with the `j' attribute has all of its data written to the ext3 |
| 87 | journal before being written to the file itself, if the filesystem is |
| 88 | mounted with the "data=ordered" or "data=writeback" options. When the |
Theodore Ts'o | 77be4d2 | 2003-03-06 12:39:55 -0500 | [diff] [blame] | 89 | filesystem is mounted with the "data=journal" option all file data |
Theodore Ts'o | 51f8f8d | 2002-11-08 20:02:21 -0500 | [diff] [blame] | 90 | is already journalled and this attribute has no effect. |
| 91 | Only the superuser or a process possessing the CAP_SYS_RESOURCE |
| 92 | capability can set or clear this attribute. |
Theodore Ts'o | 9a71884 | 2000-12-31 13:48:12 +0000 | [diff] [blame] | 93 | .PP |
Theodore Ts'o | 1aa3d56 | 2005-12-31 01:04:40 -0500 | [diff] [blame] | 94 | When a file with the `s' attribute set is deleted, its blocks are zeroed |
| 95 | and written back to the disk. Note: please make sure to read the bugs |
| 96 | and limitations section at the end of this document. |
Theodore Ts'o | a789d84 | 1998-03-30 01:20:55 +0000 | [diff] [blame] | 97 | .PP |
Theodore Ts'o | f3db356 | 1997-04-26 13:34:30 +0000 | [diff] [blame] | 98 | When a file with the `S' attribute set is modified, |
| 99 | the changes are written synchronously on the disk; this is equivalent to |
| 100 | the `sync' mount option applied to a subset of the files. |
Theodore Ts'o | a789d84 | 1998-03-30 01:20:55 +0000 | [diff] [blame] | 101 | .PP |
Theodore Ts'o | 15f9011 | 2002-11-01 01:53:52 -0500 | [diff] [blame] | 102 | A directory with the 'T' attribute will be deemed to be the top of |
| 103 | directory hierarchies for the purposes of the Orlov block allocator |
Theodore Ts'o | 51f8f8d | 2002-11-08 20:02:21 -0500 | [diff] [blame] | 104 | (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] | 105 | .PP |
Theodore Ts'o | b3f5b4c | 2001-11-05 19:22:02 -0500 | [diff] [blame] | 106 | A file with the 't' attribute will not have a partial block fragment at |
Theodore Ts'o | fc05eb0 | 2003-03-25 23:02:34 -0500 | [diff] [blame] | 107 | the end of the file merged with other files (for those filesystems which |
Theodore Ts'o | b3f5b4c | 2001-11-05 19:22:02 -0500 | [diff] [blame] | 108 | support tail-merging). This is necessary for applications such as LILO |
Theodore Ts'o | fc05eb0 | 2003-03-25 23:02:34 -0500 | [diff] [blame] | 109 | which read the filesystem directly, and which don't understand tail-merged |
| 110 | files. Note: As of this writing, the ext2 or ext3 filesystems do not |
| 111 | (yet, except in very experimental patches) support tail-merging. |
Theodore Ts'o | b3f5b4c | 2001-11-05 19:22:02 -0500 | [diff] [blame] | 112 | .PP |
Theodore Ts'o | 1aa3d56 | 2005-12-31 01:04:40 -0500 | [diff] [blame] | 113 | When a file with the `u' attribute set is deleted, its contents are |
| 114 | saved. This allows the user to ask for its undeletion. Note: please |
| 115 | make sure to read the bugs and limitations section at the end of this |
| 116 | document. |
Theodore Ts'o | a789d84 | 1998-03-30 01:20:55 +0000 | [diff] [blame] | 117 | .PP |
Theodore Ts'o | 023d111 | 2002-08-17 14:44:56 -0400 | [diff] [blame] | 118 | The 'X' attribute is used by the experimental compression patches to |
| 119 | indicate that a raw contents of a compressed file can be accessed |
| 120 | directly. It currently may not be set or reset using |
| 121 | .BR chattr (1), |
| 122 | although it can be displayed by |
| 123 | .BR lsattr (1). |
| 124 | .PP |
| 125 | The 'Z' attribute is used by the experimental compression patches to |
| 126 | indicate a compressed file is dirty. It may not be set or reset using |
| 127 | .BR chattr (1), |
| 128 | although it can be displayed by |
| 129 | .BR lsattr (1). |
| 130 | .PP |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 131 | .SH AUTHOR |
| 132 | .B chattr |
Theodore Ts'o | 2e5a1b9 | 2004-01-31 20:27:36 -0500 | [diff] [blame] | 133 | was written by Remy Card <Remy.Card@linux.org>. It is currently being |
| 134 | maintained by Theodore Ts'o <tytso@alum.mit.edu>. |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 135 | .SH BUGS AND LIMITATIONS |
Theodore Ts'o | cf11902 | 2003-12-26 14:03:20 -0500 | [diff] [blame] | 136 | The `c', 's', and `u' attributes are not honored |
| 137 | by the ext2 and ext3 filesystems as implemented in the current mainline |
| 138 | Linux kernels. These attributes may be implemented |
Theodore Ts'o | 1aa3d56 | 2005-12-31 01:04:40 -0500 | [diff] [blame] | 139 | in future versions of the ext2 and ext3 filesystems. |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 140 | .PP |
Theodore Ts'o | 9a71884 | 2000-12-31 13:48:12 +0000 | [diff] [blame] | 141 | 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] | 142 | .PP |
| 143 | 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] | 144 | .SH AVAILABILITY |
| 145 | .B chattr |
Theodore Ts'o | 6d56d51 | 2001-05-12 15:46:21 +0000 | [diff] [blame] | 146 | is part of the e2fsprogs package and is available from |
| 147 | http://e2fsprogs.sourceforge.net. |
Theodore Ts'o | 3839e65 | 1997-04-26 13:21:57 +0000 | [diff] [blame] | 148 | .SH SEE ALSO |
| 149 | .BR lsattr (1) |