Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | |
| 2 | The SGI XFS Filesystem |
| 3 | ====================== |
| 4 | |
| 5 | XFS is a high performance journaling filesystem which originated |
| 6 | on the SGI IRIX platform. It is completely multi-threaded, can |
| 7 | support large files and large filesystems, extended attributes, |
| 8 | variable block sizes, is extent based, and makes extensive use of |
| 9 | Btrees (directories, extents, free space) to aid both performance |
| 10 | and scalability. |
| 11 | |
| 12 | Refer to the documentation at http://oss.sgi.com/projects/xfs/ |
| 13 | for further details. This implementation is on-disk compatible |
| 14 | with the IRIX version of XFS. |
| 15 | |
| 16 | |
| 17 | Mount Options |
| 18 | ============= |
| 19 | |
| 20 | When mounting an XFS filesystem, the following options are accepted. |
| 21 | |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 22 | allocsize=size |
| 23 | Sets the buffered I/O end-of-file preallocation size when |
| 24 | doing delayed allocation writeout (default size is 64KiB). |
| 25 | Valid values for this option are page size (typically 4KiB) |
| 26 | through to 1GiB, inclusive, in power-of-2 increments. |
| 27 | |
| 28 | attr2/noattr2 |
| 29 | The options enable/disable (default is disabled for backward |
| 30 | compatibility on-disk) an "opportunistic" improvement to be |
| 31 | made in the way inline extended attributes are stored on-disk. |
| 32 | When the new form is used for the first time (by setting or |
| 33 | removing extended attributes) the on-disk superblock feature |
| 34 | bit field will be updated to reflect this format being in use. |
| 35 | |
| 36 | barrier |
| 37 | Enables the use of block layer write barriers for writes into |
| 38 | the journal and unwritten extent conversion. This allows for |
| 39 | drive level write caching to be enabled, for devices that |
| 40 | support write barriers. |
| 41 | |
| 42 | dmapi |
| 43 | Enable the DMAPI (Data Management API) event callouts. |
| 44 | Use with the "mtpt" option. |
| 45 | |
| 46 | grpid/bsdgroups and nogrpid/sysvgroups |
| 47 | These options define what group ID a newly created file gets. |
| 48 | When grpid is set, it takes the group ID of the directory in |
| 49 | which it is created; otherwise (the default) it takes the fsgid |
| 50 | of the current process, unless the directory has the setgid bit |
| 51 | set, in which case it takes the gid from the parent directory, |
| 52 | and also gets the setgid bit set if it is a directory itself. |
| 53 | |
| 54 | ihashsize=value |
| 55 | Sets the number of hash buckets available for hashing the |
| 56 | in-memory inodes of the specified mount point. If a value |
| 57 | of zero is used, the value selected by the default algorithm |
| 58 | will be displayed in /proc/mounts. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | |
| 60 | ikeep/noikeep |
| 61 | When inode clusters are emptied of inodes, keep them around |
| 62 | on the disk (ikeep) - this is the traditional XFS behaviour |
| 63 | and is still the default for now. Using the noikeep option, |
| 64 | inode clusters are returned to the free space pool. |
| 65 | |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 66 | inode64 |
| 67 | Indicates that XFS is allowed to create inodes at any location |
| 68 | in the filesystem, including those which will result in inode |
| 69 | numbers occupying more than 32 bits of significance. This is |
| 70 | provided for backwards compatibility, but causes problems for |
| 71 | backup applications that cannot handle large inode numbers. |
| 72 | |
| 73 | largeio/nolargeio |
| 74 | If "nolargeio" is specified, the optimal I/O reported in |
| 75 | st_blksize by stat(2) will be as small as possible to allow user |
| 76 | applications to avoid inefficient read/modify/write I/O. |
| 77 | If "largeio" specified, a filesystem that has a "swidth" specified |
| 78 | will return the "swidth" value (in bytes) in st_blksize. If the |
| 79 | filesystem does not have a "swidth" specified but does specify |
| 80 | an "allocsize" then "allocsize" (in bytes) will be returned |
| 81 | instead. |
| 82 | If neither of these two options are specified, then filesystem |
| 83 | will behave as if "nolargeio" was specified. |
| 84 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 85 | logbufs=value |
| 86 | Set the number of in-memory log buffers. Valid numbers range |
| 87 | from 2-8 inclusive. |
| 88 | The default value is 8 buffers for filesystems with a |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 89 | blocksize of 64KiB, 4 buffers for filesystems with a blocksize |
| 90 | of 32KiB, 3 buffers for filesystems with a blocksize of 16KiB |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 91 | and 2 buffers for all other configurations. Increasing the |
| 92 | number of buffers may increase performance on some workloads |
| 93 | at the cost of the memory used for the additional log buffers |
| 94 | and their associated control structures. |
| 95 | |
| 96 | logbsize=value |
| 97 | Set the size of each in-memory log buffer. |
| 98 | Size may be specified in bytes, or in kilobytes with a "k" suffix. |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 99 | Valid sizes for version 1 and version 2 logs are 16384 (16k) and |
| 100 | 32768 (32k). Valid sizes for version 2 logs also include |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 101 | 65536 (64k), 131072 (128k) and 262144 (256k). |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 102 | The default value for machines with more than 32MiB of memory |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 103 | is 32768, machines with less memory use 16384 by default. |
| 104 | |
| 105 | logdev=device and rtdev=device |
| 106 | Use an external log (metadata journal) and/or real-time device. |
| 107 | An XFS filesystem has up to three parts: a data section, a log |
| 108 | section, and a real-time section. The real-time section is |
| 109 | optional, and the log section can be separate from the data |
| 110 | section or contained within it. |
| 111 | |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 112 | mtpt=mountpoint |
| 113 | Use with the "dmapi" option. The value specified here will be |
| 114 | included in the DMAPI mount event, and should be the path of |
| 115 | the actual mountpoint that is used. |
| 116 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 117 | noalign |
| 118 | Data allocations will not be aligned at stripe unit boundaries. |
| 119 | |
| 120 | noatime |
| 121 | Access timestamps are not updated when a file is read. |
| 122 | |
| 123 | norecovery |
| 124 | The filesystem will be mounted without running log recovery. |
| 125 | If the filesystem was not cleanly unmounted, it is likely to |
| 126 | be inconsistent when mounted in "norecovery" mode. |
| 127 | Some files or directories may not be accessible because of this. |
| 128 | Filesystems mounted "norecovery" must be mounted read-only or |
| 129 | the mount will fail. |
| 130 | |
| 131 | nouuid |
| 132 | Don't check for double mounted file systems using the file system uuid. |
| 133 | This is useful to mount LVM snapshot volumes. |
| 134 | |
| 135 | osyncisosync |
| 136 | Make O_SYNC writes implement true O_SYNC. WITHOUT this option, |
| 137 | Linux XFS behaves as if an "osyncisdsync" option is used, |
| 138 | which will make writes to files opened with the O_SYNC flag set |
| 139 | behave as if the O_DSYNC flag had been used instead. |
| 140 | This can result in better performance without compromising |
| 141 | data safety. |
| 142 | However if this option is not in effect, timestamp updates from |
| 143 | O_SYNC writes can be lost if the system crashes. |
| 144 | If timestamp updates are critical, use the osyncisosync option. |
| 145 | |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 146 | uquota/usrquota/uqnoenforce/quota |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 147 | User disk quota accounting enabled, and limits (optionally) |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 148 | enforced. Refer to xfs_quota(8) for further details. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 149 | |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 150 | gquota/grpquota/gqnoenforce |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 151 | Group disk quota accounting enabled and limits (optionally) |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 152 | enforced. Refer to xfs_quota(8) for further details. |
| 153 | |
| 154 | pquota/prjquota/pqnoenforce |
| 155 | Project disk quota accounting enabled and limits (optionally) |
| 156 | enforced. Refer to xfs_quota(8) for further details. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 157 | |
| 158 | sunit=value and swidth=value |
| 159 | Used to specify the stripe unit and width for a RAID device or |
| 160 | a stripe volume. "value" must be specified in 512-byte block |
| 161 | units. |
| 162 | If this option is not specified and the filesystem was made on |
| 163 | a stripe volume or the stripe width or unit were specified for |
| 164 | the RAID device at mkfs time, then the mount system call will |
| 165 | restore the value from the superblock. For filesystems that |
| 166 | are made directly on RAID devices, these options can be used |
| 167 | to override the information in the superblock if the underlying |
| 168 | disk layout changes after the filesystem has been created. |
| 169 | The "swidth" option is required if the "sunit" option has been |
| 170 | specified, and must be a multiple of the "sunit" value. |
| 171 | |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 172 | swalloc |
| 173 | Data allocations will be rounded up to stripe width boundaries |
| 174 | when the current end of file is being extended and the file |
| 175 | size is larger than the stripe width size. |
| 176 | |
| 177 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 178 | sysctls |
| 179 | ======= |
| 180 | |
| 181 | The following sysctls are available for the XFS filesystem: |
| 182 | |
| 183 | fs.xfs.stats_clear (Min: 0 Default: 0 Max: 1) |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 184 | Setting this to "1" clears accumulated XFS statistics |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 185 | in /proc/fs/xfs/stat. It then immediately resets to "0". |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 186 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 187 | fs.xfs.xfssyncd_centisecs (Min: 100 Default: 3000 Max: 720000) |
| 188 | The interval at which the xfssyncd thread flushes metadata |
| 189 | out to disk. This thread will flush log activity out, and |
| 190 | do some processing on unlinked inodes. |
| 191 | |
| 192 | fs.xfs.xfsbufd_centisecs (Min: 50 Default: 100 Max: 3000) |
| 193 | The interval at which xfsbufd scans the dirty metadata buffers list. |
| 194 | |
| 195 | fs.xfs.age_buffer_centisecs (Min: 100 Default: 1500 Max: 720000) |
| 196 | The age at which xfsbufd flushes dirty metadata buffers to disk. |
| 197 | |
| 198 | fs.xfs.error_level (Min: 0 Default: 3 Max: 11) |
| 199 | A volume knob for error reporting when internal errors occur. |
| 200 | This will generate detailed messages & backtraces for filesystem |
| 201 | shutdowns, for example. Current threshold values are: |
| 202 | |
| 203 | XFS_ERRLEVEL_OFF: 0 |
| 204 | XFS_ERRLEVEL_LOW: 1 |
| 205 | XFS_ERRLEVEL_HIGH: 5 |
| 206 | |
| 207 | fs.xfs.panic_mask (Min: 0 Default: 0 Max: 127) |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 208 | Causes certain error conditions to call BUG(). Value is a bitmask; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 209 | AND together the tags which represent errors which should cause panics: |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 210 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 211 | XFS_NO_PTAG 0 |
| 212 | XFS_PTAG_IFLUSH 0x00000001 |
| 213 | XFS_PTAG_LOGRES 0x00000002 |
| 214 | XFS_PTAG_AILDELETE 0x00000004 |
| 215 | XFS_PTAG_ERROR_REPORT 0x00000008 |
| 216 | XFS_PTAG_SHUTDOWN_CORRUPT 0x00000010 |
| 217 | XFS_PTAG_SHUTDOWN_IOERROR 0x00000020 |
| 218 | XFS_PTAG_SHUTDOWN_LOGERROR 0x00000040 |
| 219 | |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 220 | This option is intended for debugging only. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 221 | |
| 222 | fs.xfs.irix_symlink_mode (Min: 0 Default: 0 Max: 1) |
| 223 | Controls whether symlinks are created with mode 0777 (default) |
| 224 | or whether their mode is affected by the umask (irix mode). |
| 225 | |
| 226 | fs.xfs.irix_sgid_inherit (Min: 0 Default: 0 Max: 1) |
| 227 | Controls files created in SGID directories. |
| 228 | If the group ID of the new file does not match the effective group |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 229 | ID or one of the supplementary group IDs of the parent dir, the |
| 230 | ISGID bit is cleared if the irix_sgid_inherit compatibility sysctl |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 231 | is set. |
| 232 | |
| 233 | fs.xfs.restrict_chown (Min: 0 Default: 1 Max: 1) |
| 234 | Controls whether unprivileged users can use chown to "give away" |
| 235 | a file to another user. |
| 236 | |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 237 | fs.xfs.inherit_sync (Min: 0 Default: 1 Max: 1) |
| 238 | Setting this to "1" will cause the "sync" flag set |
| 239 | by the xfs_io(8) chattr command on a directory to be |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 240 | inherited by files in that directory. |
| 241 | |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 242 | fs.xfs.inherit_nodump (Min: 0 Default: 1 Max: 1) |
| 243 | Setting this to "1" will cause the "nodump" flag set |
| 244 | by the xfs_io(8) chattr command on a directory to be |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 245 | inherited by files in that directory. |
| 246 | |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 247 | fs.xfs.inherit_noatime (Min: 0 Default: 1 Max: 1) |
| 248 | Setting this to "1" will cause the "noatime" flag set |
| 249 | by the xfs_io(8) chattr command on a directory to be |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 250 | inherited by files in that directory. |
Nathan Scott | fc97bbf | 2005-11-03 13:46:43 +1100 | [diff] [blame] | 251 | |
| 252 | fs.xfs.inherit_nosymlinks (Min: 0 Default: 1 Max: 1) |
| 253 | Setting this to "1" will cause the "nosymlinks" flag set |
| 254 | by the xfs_io(8) chattr command on a directory to be |
| 255 | inherited by files in that directory. |
| 256 | |
| 257 | fs.xfs.rotorstep (Min: 1 Default: 1 Max: 256) |
| 258 | In "inode32" allocation mode, this option determines how many |
| 259 | files the allocator attempts to allocate in the same allocation |
| 260 | group before moving to the next allocation group. The intent |
| 261 | is to control the rate at which the allocator moves between |
| 262 | allocation groups when allocating extents for new files. |