← Documents Documentation/admin-guide/xfs.rst GitHub 원문 ↗

Linux 6.18.37 · Administration

The SGI XFS Filesystem

XFS mount option, sysctl, error retry 정책, workqueue tuning과 zoned filesystem attribute를 설명합니다.

Source pathDocumentation/admin-guide/xfs.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약과 해설

xfs.rst:1-551

XFS는 extent와 Btree를 기반으로 큰 file·filesystem을 확장성 있게 처리합니다. 운영 시에는 mount option의 정렬·quota·journal·recovery 의미와, sysfs error handler의 retry 종료 조건을 정확히 구분해야 합니다.

운영 영역핵심 주의점
Mount`discard`보다 `fstrim` 권장, `norecovery`는 read-only 필수
FormatV4는 deprecated이며 2030년 9월 제거 예정
Error여러 retry 조건 중 먼저 만료된 조건이 error를 전달
Workqueue내부 tuning interface로 API/ABI 보장 없음
Zonedopen zone 한도와 GC 여유 공간의 trade-off 관리

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 ======================
4 The SGI XFS Filesystem
5 ======================
6
7 XFS is a high performance journaling filesystem which originated
8 on the SGI IRIX platform. It is completely multi-threaded, can
9 support large files and large filesystems, extended attributes,
10 variable block sizes, is extent based, and makes extensive use of
11 Btrees (directories, extents, free space) to aid both performance
12 and scalability.
13
14 Refer to the documentation at https://xfs.wiki.kernel.org/
15 for further details. This implementation is on-disk compatible
16 with the IRIX version of XFS.
17
18
19 Mount Options
20 =============
21
22 When mounting an XFS filesystem, the following options are accepted.
23
24 allocsize=size
25 Sets the buffered I/O end-of-file preallocation size when
26 doing delayed allocation writeout (default size is 64KiB).
27 Valid values for this option are page size (typically 4KiB)
28 through to 1GiB, inclusive, in power-of-2 increments.
29
30 The default behaviour is for dynamic end-of-file
31 preallocation size, which uses a set of heuristics to
32 optimise the preallocation size based on the current
33 allocation patterns within the file and the access patterns
34 to the file. Specifying a fixed ``allocsize`` value turns off
35 the dynamic behaviour.
36
37 discard or nodiscard (default)
38 Enable/disable the issuing of commands to let the block
39 device reclaim space freed by the filesystem. This is
40 useful for SSD devices, thinly provisioned LUNs and virtual
41 machine images, but may have a performance impact.
42
43 Note: It is currently recommended that you use the ``fstrim``
44 application to ``discard`` unused blocks rather than the ``discard``
45 mount option because the performance impact of this option
46 is quite severe.
47
48 grpid/bsdgroups or nogrpid/sysvgroups (default)
49 These options define what group ID a newly created file
50 gets. When ``grpid`` is set, it takes the group ID of the
51 directory in which it is created; otherwise it takes the
52 ``fsgid`` of the current process, unless the directory has the
53 ``setgid`` bit set, in which case it takes the ``gid`` from the
54 parent directory, and also gets the ``setgid`` bit set if it is
55 a directory itself.
56
57 filestreams
58 Make the data allocator use the filestreams allocation mode
59 across the entire filesystem rather than just on directories
60 configured to use it.
61
62 inode32 or inode64 (default)
63 When ``inode32`` is specified, it indicates that XFS limits
64 inode creation to locations which will not result in inode
65 numbers with more than 32 bits of significance.
66
67 When ``inode64`` is specified, it indicates that XFS is allowed
68 to create inodes at any location in the filesystem,
69 including those which will result in inode numbers occupying
70 more than 32 bits of significance.
71
72 ``inode32`` is provided for backwards compatibility with older
73 systems and applications, since 64 bits inode numbers might
74 cause problems for some applications that cannot handle
75 large inode numbers. If applications are in use which do
76 not handle inode numbers bigger than 32 bits, the ``inode32``
77 option should be specified.
78
79 largeio or nolargeio (default)
80 If ``nolargeio`` is specified, the optimal I/O reported in
81 ``st_blksize`` by **stat(2)** will be as small as possible to allow
82 user applications to avoid inefficient read/modify/write
83 I/O. This is typically the page size of the machine, as
84 this is the granularity of the page cache.
85
86 If ``largeio`` is specified, a filesystem that was created with a
87 ``swidth`` specified will return the ``swidth`` value (in bytes)
88 in ``st_blksize``. If the filesystem does not have a ``swidth``
89 specified but does specify an ``allocsize`` then ``allocsize``
90 (in bytes) will be returned instead. Otherwise the behaviour
91 is the same as if ``nolargeio`` was specified.
92
93 logbufs=value
94 Set the number of in-memory log buffers. Valid numbers
95 range from 2-8 inclusive.
96
97 The default value is 8 buffers.
98
99 If the memory cost of 8 log buffers is too high on small
100 systems, then it may be reduced at some cost to performance
101 on metadata intensive workloads. The ``logbsize`` option below
102 controls the size of each buffer and so is also relevant to
103 this case.
104
105 lifetime (default) or nolifetime
106 Enable data placement based on write life time hints provided
107 by the user. This turns on co-allocation of data of similar
108 life times when statistically favorable to reduce garbage
109 collection cost.
110
111 These options are only available for zoned rt file systems.
112
113 logbsize=value
114 Set the size of each in-memory log buffer. The size may be
115 specified in bytes, or in kilobytes with a "k" suffix.
116 Valid sizes for version 1 and version 2 logs are 16384 (16k)
117 and 32768 (32k). Valid sizes for version 2 logs also
118 include 65536 (64k), 131072 (128k) and 262144 (256k). The
119 logbsize must be an integer multiple of the log
120 stripe unit configured at **mkfs(8)** time.
121
122 The default value for version 1 logs is 32768, while the
123 default value for version 2 logs is MAX(32768, log_sunit).
124
125 logdev=device and rtdev=device
126 Use an external log (metadata journal) and/or real-time device.
127 An XFS filesystem has up to three parts: a data section, a log
128 section, and a real-time section. The real-time section is
129 optional, and the log section can be separate from the data
130 section or contained within it.
131
132 max_atomic_write=value
133 Set the maximum size of an atomic write. The size may be
134 specified in bytes, in kilobytes with a "k" suffix, in megabytes
135 with a "m" suffix, or in gigabytes with a "g" suffix. The size
136 cannot be larger than the maximum write size, larger than the
137 size of any allocation group, or larger than the size of a
138 remapping operation that the log can complete atomically.
139
140 The default value is to set the maximum I/O completion size
141 to allow each CPU to handle one at a time.
142
143 max_open_zones=value
144 Specify the max number of zones to keep open for writing on a
145 zoned rt device. Many open zones aids file data separation
146 but may impact performance on HDDs.
147
148 If ``max_open_zones`` is not specified, the value is determined
149 by the capabilities and the size of the zoned rt device.
150
151 noalign
152 Data allocations will not be aligned at stripe unit
153 boundaries. This is only relevant to filesystems created
154 with non-zero data alignment parameters (``sunit``, ``swidth``) by
155 **mkfs(8)**.
156
157 norecovery
158 The filesystem will be mounted without running log recovery.
159 If the filesystem was not cleanly unmounted, it is likely to
160 be inconsistent when mounted in ``norecovery`` mode.
161 Some files or directories may not be accessible because of this.
162 Filesystems mounted ``norecovery`` must be mounted read-only or
163 the mount will fail.
164
165 nouuid
166 Don't check for double mounted file systems using the file
167 system ``uuid``. This is useful to mount LVM snapshot volumes,
168 and often used in combination with ``norecovery`` for mounting
169 read-only snapshots.
170
171 noquota
172 Forcibly turns off all quota accounting and enforcement
173 within the filesystem.
174
175 uquota/usrquota/uqnoenforce/quota
176 User disk quota accounting enabled, and limits (optionally)
177 enforced. Refer to **xfs_quota(8)** for further details.
178
179 gquota/grpquota/gqnoenforce
180 Group disk quota accounting enabled and limits (optionally)
181 enforced. Refer to **xfs_quota(8)** for further details.
182
183 pquota/prjquota/pqnoenforce
184 Project disk quota accounting enabled and limits (optionally)
185 enforced. Refer to **xfs_quota(8)** for further details.
186
187 sunit=value and swidth=value
188 Used to specify the stripe unit and width for a RAID device
189 or a stripe volume. "value" must be specified in 512-byte
190 block units. These options are only relevant to filesystems
191 that were created with non-zero data alignment parameters.
192
193 The ``sunit`` and ``swidth`` parameters specified must be compatible
194 with the existing filesystem alignment characteristics. In
195 general, that means the only valid changes to ``sunit`` are
196 increasing it by a power-of-2 multiple. Valid ``swidth`` values
197 are any integer multiple of a valid ``sunit`` value.
198
199 Typically the only time these mount options are necessary if
200 after an underlying RAID device has had its geometry
201 modified, such as adding a new disk to a RAID5 lun and
202 reshaping it.
203
204 swalloc
205 Data allocations will be rounded up to stripe width boundaries
206 when the current end of file is being extended and the file
207 size is larger than the stripe width size.
208
209 wsync
210 When specified, all filesystem namespace operations are
211 executed synchronously. This ensures that when the namespace
212 operation (create, unlink, etc) completes, the change to the
213 namespace is on stable storage. This is useful in HA setups
214 where failover must not result in clients seeing
215 inconsistent namespace presentation during or after a
216 failover event.
217
218 Deprecation of V4 Format
219 ========================
220
221 The V4 filesystem format lacks certain features that are supported by
222 the V5 format, such as metadata checksumming, strengthened metadata
223 verification, and the ability to store timestamps past the year 2038.
224 Because of this, the V4 format is deprecated. All users should upgrade
225 by backing up their files, reformatting, and restoring from the backup.
226
227 Administrators and users can detect a V4 filesystem by running xfs_info
228 against a filesystem mountpoint and checking for a string containing
229 "crc=". If no such string is found, please upgrade xfsprogs to the
230 latest version and try again.
231
232 The deprecation will take place in two parts. Support for mounting V4
233 filesystems can now be disabled at kernel build time via Kconfig option.
234 These options were changed to default to no in September 2025. In
235 September 2030, support will be removed from the codebase entirely.
236
237 Note: Distributors may choose to withdraw V4 format support earlier than
238 the dates listed above.
239
240 Deprecated Mount Options
241 ========================
242
243 ============================ ================
244 Name Removal Schedule
245 ============================ ================
246 Mounting with V4 filesystem September 2030
247 Mounting ascii-ci filesystem September 2030
248 ============================ ================
249
250
251 Removed Mount Options
252 =====================
253
254 =========================== =======
255 Name Removed
256 =========================== =======
257 delaylog/nodelaylog v4.0
258 ihashsize v4.0
259 irixsgid v4.0
260 osyncisdsync/osyncisosync v4.0
261 barrier v4.19
262 nobarrier v4.19
263 ikeep/noikeep v6.18
264 attr2/noattr2 v6.18
265 =========================== =======
266
267 sysctls
268 =======
269
270 The following sysctls are available for the XFS filesystem:
271
272 fs.xfs.stats_clear (Min: 0 Default: 0 Max: 1)
273 Setting this to "1" clears accumulated XFS statistics
274 in /proc/fs/xfs/stat. It then immediately resets to "0".
275
276 fs.xfs.xfssyncd_centisecs (Min: 100 Default: 3000 Max: 720000)
277 The interval at which the filesystem flushes metadata
278 out to disk and runs internal cache cleanup routines.
279
280 fs.xfs.filestream_centisecs (Min: 1 Default: 3000 Max: 360000)
281 The interval at which the filesystem ages filestreams cache
282 references and returns timed-out AGs back to the free stream
283 pool.
284
285 fs.xfs.speculative_prealloc_lifetime
286 (Units: seconds Min: 1 Default: 300 Max: 86400)
287 The interval at which the background scanning for inodes
288 with unused speculative preallocation runs. The scan
289 removes unused preallocation from clean inodes and releases
290 the unused space back to the free pool.
291
292 fs.xfs.error_level (Min: 0 Default: 3 Max: 11)
293 A volume knob for error reporting when internal errors occur.
294 This will generate detailed messages & backtraces for filesystem
295 shutdowns, for example. Current threshold values are:
296
297 XFS_ERRLEVEL_OFF: 0
298 XFS_ERRLEVEL_LOW: 1
299 XFS_ERRLEVEL_HIGH: 5
300
301 fs.xfs.panic_mask (Min: 0 Default: 0 Max: 511)
302 Causes certain error conditions to call BUG(). Value is a bitmask;
303 OR together the tags which represent errors which should cause panics:
304
305 XFS_NO_PTAG 0
306 XFS_PTAG_IFLUSH 0x00000001
307 XFS_PTAG_LOGRES 0x00000002
308 XFS_PTAG_AILDELETE 0x00000004
309 XFS_PTAG_ERROR_REPORT 0x00000008
310 XFS_PTAG_SHUTDOWN_CORRUPT 0x00000010
311 XFS_PTAG_SHUTDOWN_IOERROR 0x00000020
312 XFS_PTAG_SHUTDOWN_LOGERROR 0x00000040
313 XFS_PTAG_FSBLOCK_ZERO 0x00000080
314 XFS_PTAG_VERIFIER_ERROR 0x00000100
315
316 This option is intended for debugging only.
317
318 fs.xfs.inherit_sync (Min: 0 Default: 1 Max: 1)
319 Setting this to "1" will cause the "sync" flag set
320 by the **xfs_io(8)** chattr command on a directory to be
321 inherited by files in that directory.
322
323 fs.xfs.inherit_nodump (Min: 0 Default: 1 Max: 1)
324 Setting this to "1" will cause the "nodump" flag set
325 by the **xfs_io(8)** chattr command on a directory to be
326 inherited by files in that directory.
327
328 fs.xfs.inherit_noatime (Min: 0 Default: 1 Max: 1)
329 Setting this to "1" will cause the "noatime" flag set
330 by the **xfs_io(8)** chattr command on a directory to be
331 inherited by files in that directory.
332
333 fs.xfs.inherit_nosymlinks (Min: 0 Default: 1 Max: 1)
334 Setting this to "1" will cause the "nosymlinks" flag set
335 by the **xfs_io(8)** chattr command on a directory to be
336 inherited by files in that directory.
337
338 fs.xfs.inherit_nodefrag (Min: 0 Default: 1 Max: 1)
339 Setting this to "1" will cause the "nodefrag" flag set
340 by the **xfs_io(8)** chattr command on a directory to be
341 inherited by files in that directory.
342
343 fs.xfs.rotorstep (Min: 1 Default: 1 Max: 256)
344 In "inode32" allocation mode, this option determines how many
345 files the allocator attempts to allocate in the same allocation
346 group before moving to the next allocation group. The intent
347 is to control the rate at which the allocator moves between
348 allocation groups when allocating extents for new files.
349
350 Deprecated Sysctls
351 ==================
352
353 None currently.
354
355 Removed Sysctls
356 ===============
357
358 ========================================== =======
359 Name Removed
360 ========================================== =======
361 fs.xfs.xfsbufd_centisec v4.0
362 fs.xfs.age_buffer_centisecs v4.0
363 fs.xfs.irix_symlink_mode v6.18
364 fs.xfs.irix_sgid_inherit v6.18
365 fs.xfs.speculative_cow_prealloc_lifetime v6.18
366 ========================================== =======
367
368 Error handling
369 ==============
370
371 XFS can act differently according to the type of error found during its
372 operation. The implementation introduces the following concepts to the error
373 handler:
374
375 -failure speed:
376 Defines how fast XFS should propagate an error upwards when a specific
377 error is found during the filesystem operation. It can propagate
378 immediately, after a defined number of retries, after a set time period,
379 or simply retry forever.
380
381 -error classes:
382 Specifies the subsystem the error configuration will apply to, such as
383 metadata IO or memory allocation. Different subsystems will have
384 different error handlers for which behaviour can be configured.
385
386 -error handlers:
387 Defines the behavior for a specific error.
388
389 The filesystem behavior during an error can be set via ``sysfs`` files. Each
390 error handler works independently - the first condition met by an error handler
391 for a specific class will cause the error to be propagated rather than reset and
392 retried.
393
394 The action taken by the filesystem when the error is propagated is context
395 dependent - it may cause a shut down in the case of an unrecoverable error,
396 it may be reported back to userspace, or it may even be ignored because
397 there's nothing useful we can with the error or anyone we can report it to (e.g.
398 during unmount).
399
400 The configuration files are organized into the following hierarchy for each
401 mounted filesystem:
402
403 /sys/fs/xfs/<dev>/error/<class>/<error>/
404
405 Where:
406 <dev>
407 The short device name of the mounted filesystem. This is the same device
408 name that shows up in XFS kernel error messages as "XFS(<dev>): ..."
409
410 <class>
411 The subsystem the error configuration belongs to. As of 4.9, the defined
412 classes are:
413
414 - "metadata": applies metadata buffer write IO
415
416 <error>
417 The individual error handler configurations.
418
419
420 Each filesystem has "global" error configuration options defined in their top
421 level directory:
422
423 /sys/fs/xfs/<dev>/error/
424
425 fail_at_unmount (Min: 0 Default: 1 Max: 1)
426 Defines the filesystem error behavior at unmount time.
427
428 If set to a value of 1, XFS will override all other error configurations
429 during unmount and replace them with "immediate fail" characteristics.
430 i.e. no retries, no retry timeout. This will always allow unmount to
431 succeed when there are persistent errors present.
432
433 If set to 0, the configured retry behaviour will continue until all
434 retries and/or timeouts have been exhausted. This will delay unmount
435 completion when there are persistent errors, and it may prevent the
436 filesystem from ever unmounting fully in the case of "retry forever"
437 handler configurations.
438
439 Note: there is no guarantee that fail_at_unmount can be set while an
440 unmount is in progress. It is possible that the ``sysfs`` entries are
441 removed by the unmounting filesystem before a "retry forever" error
442 handler configuration causes unmount to hang, and hence the filesystem
443 must be configured appropriately before unmount begins to prevent
444 unmount hangs.
445
446 Each filesystem has specific error class handlers that define the error
447 propagation behaviour for specific errors. There is also a "default" error
448 handler defined, which defines the behaviour for all errors that don't have
449 specific handlers defined. Where multiple retry constraints are configured for
450 a single error, the first retry configuration that expires will cause the error
451 to be propagated. The handler configurations are found in the directory:
452
453 /sys/fs/xfs/<dev>/error/<class>/<error>/
454
455 max_retries (Min: -1 Default: Varies Max: INTMAX)
456 Defines the allowed number of retries of a specific error before
457 the filesystem will propagate the error. The retry count for a given
458 error context (e.g. a specific metadata buffer) is reset every time
459 there is a successful completion of the operation.
460
461 Setting the value to "-1" will cause XFS to retry forever for this
462 specific error.
463
464 Setting the value to "0" will cause XFS to fail immediately when the
465 specific error is reported.
466
467 Setting the value to "N" (where 0 < N < Max) will make XFS retry the
468 operation "N" times before propagating the error.
469
470 retry_timeout_seconds (Min: -1 Default: Varies Max: 1 day)
471 Define the amount of time (in seconds) that the filesystem is
472 allowed to retry its operations when the specific error is
473 found.
474
475 Setting the value to "-1" will allow XFS to retry forever for this
476 specific error.
477
478 Setting the value to "0" will cause XFS to fail immediately when the
479 specific error is reported.
480
481 Setting the value to "N" (where 0 < N < Max) will allow XFS to retry the
482 operation for up to "N" seconds before propagating the error.
483
484 **Note:** The default behaviour for a specific error handler is dependent on both
485 the class and error context. For example, the default values for
486 "metadata/ENODEV" are "0" rather than "-1" so that this error handler defaults
487 to "fail immediately" behaviour. This is done because ENODEV is a fatal,
488 unrecoverable error no matter how many times the metadata IO is retried.
489
490 Workqueue Concurrency
491 =====================
492
493 XFS uses kernel workqueues to parallelize metadata update processes. This
494 enables it to take advantage of storage hardware that can service many IO
495 operations simultaneously. This interface exposes internal implementation
496 details of XFS, and as such is explicitly not part of any userspace API/ABI
497 guarantee the kernel may give userspace. These are undocumented features of
498 the generic workqueue implementation XFS uses for concurrency, and they are
499 provided here purely for diagnostic and tuning purposes and may change at any
500 time in the future.
501
502 The control knobs for a filesystem's workqueues are organized by task at hand
503 and the short name of the data device. They all can be found in:
504
505 /sys/bus/workqueue/devices/${task}!${device}
506
507 ================ ===========
508 Task Description
509 ================ ===========
510 xfs_iwalk-$pid Inode scans of the entire filesystem. Currently limited to
511 mount time quotacheck.
512 xfs-gc Background garbage collection of disk space that have been
513 speculatively allocated beyond EOF or for staging copy on
514 write operations.
515 ================ ===========
516
517 For example, the knobs for the quotacheck workqueue for /dev/nvme0n1 would be
518 found in /sys/bus/workqueue/devices/xfs_iwalk-1111!nvme0n1/.
519
520 The interesting knobs for XFS workqueues are as follows:
521
522 ============ ===========
523 Knob Description
524 ============ ===========
525 max_active Maximum number of background threads that can be started to
526 run the work.
527 cpumask CPUs upon which the threads are allowed to run.
528 nice Relative priority of scheduling the threads. These are the
529 same nice levels that can be applied to userspace processes.
530 ============ ===========
531
532 Zoned Filesystems
533 =================
534
535 For zoned file systems, the following attributes are exposed in:
536
537 /sys/fs/xfs/<dev>/zoned/
538
539 max_open_zones (Min: 1 Default: Varies Max: UINTMAX)
540 This read-only attribute exposes the maximum number of open zones
541 available for data placement. The value is determined at mount time and
542 is limited by the capabilities of the backing zoned device, file system
543 size and the max_open_zones mount option.
544
545 zonegc_low_space (Min: 0 Default: 0 Max: 100)
546 Define a percentage for how much of the unused space that GC should keep
547 available for writing. A high value will reclaim more of the space
548 occupied by unused blocks, creating a larger buffer against write
549 bursts at the cost of increased write amplification. Regardless
550 of this value, garbage collection will always aim to free a minimum
551 amount of blocks to keep max_open_zones open for data placement purposes.
552

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

The SGI XFS Filesystem

1-18

XFS는 SGI IRIX에서 시작한 고성능 journaling filesystem입니다. 완전한 multi-thread 구조이며 큰 file과 filesystem, extended attribute, 가변 block size를 지원합니다. extent 기반이고 directory, extent, free space에 Btree를 폭넓게 사용해 성능과 확장성을 높입니다.

자세한 내용은 `https://xfs.wiki.kernel.org/`에서 볼 수 있습니다. Linux 구현의 on-disk 형식은 IRIX XFS와 호환됩니다. 라이선스는 `GPL-2.0`입니다.

Mount Options

19-217

XFS filesystem을 mount할 때 다음 option을 사용할 수 있습니다.

option동작과 제약
`allocsize=size`delayed allocation writeout 때 buffered I/O EOF preallocation 크기를 고정합니다. 기본은 64KiB이며 page size(보통 4KiB)부터 1GiB까지 2의 거듭제곱 단위가 유효합니다. 기본 dynamic heuristic은 allocation·access pattern으로 크기를 최적화하지만 고정 `allocsize`를 지정하면 꺼집니다.
`discard` / `nodiscard`(기본)filesystem이 해제한 공간을 block device가 회수하도록 할지 정합니다. SSD, thin-provisioned LUN, VM image에 유용하지만 성능 영향이 큽니다. mount `discard`보다 `fstrim` application 사용을 권장합니다.
`grpid`/`bsdgroups` / `nogrpid`/`sysvgroups`(기본)`grpid`이면 새 file은 parent directory의 group ID를 받습니다. 아니면 현재 process의 `fsgid`를 쓰되 parent에 `setgid`가 있으면 parent `gid`를 받고, 새 directory에도 `setgid`가 설정됩니다.
`filestreams`filestreams를 지정한 directory뿐 아니라 filesystem 전체에서 data allocator의 filestreams allocation mode를 사용합니다.
`inode32` / `inode64`(기본)`inode32`는 32bit보다 큰 inode number가 생기지 않는 위치로 inode 생성을 제한합니다. `inode64`는 filesystem 어디든 허용합니다. 큰 inode number를 처리하지 못하는 구형 system·application 호환이 필요할 때만 `inode32`를 사용합니다.
`largeio` / `nolargeio`(기본)`nolargeio`는 **stat(2)**의 `st_blksize`를 보통 page size로 작게 보고해 비효율적인 read/modify/write를 피하게 합니다. `largeio`는 mkfs의 `swidth`, 없으면 `allocsize`를 byte 단위로 보고하며 둘 다 없으면 `nolargeio`와 같습니다.
`logbufs=value`memory log buffer 수를 2~8로 설정하며 기본은 8입니다. 작은 system에서 memory 비용을 줄일 수 있지만 metadata 집중 workload 성능이 떨어질 수 있고, 각 buffer 크기는 `logbsize`가 정합니다.
`lifetime`(기본) / `nolifetime`user가 준 write lifetime hint를 바탕으로 비슷한 수명의 data를 통계적으로 유리할 때 함께 배치해 garbage collection 비용을 줄입니다. zoned rt filesystem에서만 사용할 수 있습니다.
`logbsize=value`memory log buffer 하나의 크기입니다. byte 또는 `k` suffix를 씁니다. v1·v2 log는 16k와 32k, v2는 64k·128k·256k도 허용합니다. **mkfs(8)**의 log stripe unit 정수배여야 하며 기본은 v1 32768, v2 `MAX(32768, log_sunit)`입니다.
`logdev=device` / `rtdev=device`외부 metadata journal과 real-time device를 사용합니다. XFS는 data, log, 선택적 real-time의 최대 세 부분으로 구성되고 log는 data 안에 있거나 별도일 수 있습니다.
`max_atomic_write=value`atomic write 최대 크기를 byte 또는 `k`, `m`, `g` suffix로 정합니다. 최대 write 크기, allocation group 크기, log가 atomically 완료할 remap 크기를 넘을 수 없습니다. 기본은 CPU마다 I/O completion 하나를 처리할 수 있게 정합니다.
`max_open_zones=value`zoned rt device에서 write용으로 열어 둘 zone 최대 수입니다. zone을 많이 열면 file data 분리에 도움이 되지만 HDD 성능에 영향을 줄 수 있습니다. 생략하면 device capability와 rt device 크기로 결정합니다.
`noalign`data allocation을 stripe unit 경계에 맞추지 않습니다. **mkfs(8)**에서 `sunit`, `swidth` 같은 non-zero data alignment로 만든 filesystem에만 의미가 있습니다.
`norecovery`log recovery 없이 mount합니다. clean unmount가 아니면 inconsistent할 가능성이 있고 file·directory에 접근하지 못할 수 있습니다. 반드시 read-only로 mount해야 합니다.
`nouuid`filesystem `uuid`를 이용한 double-mount 검사를 하지 않습니다. LVM snapshot volume에 유용하며 read-only snapshot에는 `norecovery`와 자주 함께 씁니다.
`noquota`filesystem의 모든 quota accounting과 enforcement를 강제로 끕니다.
`uquota`/`usrquota`/`uqnoenforce`/`quota`user disk quota accounting을 켜고 선택적으로 limit을 강제합니다. 자세한 내용은 **xfs_quota(8)**를 참조합니다.
`gquota`/`grpquota`/`gqnoenforce`group disk quota accounting을 켜고 선택적으로 limit을 강제합니다.
`pquota`/`prjquota`/`pqnoenforce`project disk quota accounting을 켜고 선택적으로 limit을 강제합니다.
`sunit=value` / `swidth=value`RAID device나 stripe volume의 stripe unit·width를 512-byte block 단위로 지정합니다. 기존 alignment와 호환되어야 하며 `sunit`은 보통 2의 거듭제곱 배로만 늘릴 수 있고 `swidth`는 유효한 `sunit`의 정수배여야 합니다. RAID geometry를 바꾼 뒤 주로 필요합니다.
`swalloc`EOF를 늘릴 때 file 크기가 stripe width보다 크면 data allocation을 stripe width 경계까지 올림합니다.
`wsync`create, unlink 같은 filesystem namespace operation을 모두 동기 실행해 완료 시 stable storage에 반영되게 합니다. failover 중·후 client가 inconsistent namespace를 보면 안 되는 HA setup에 유용합니다.

Deprecation of V4 Format

218-239

V4 filesystem format에는 V5가 지원하는 metadata checksum, 강화된 metadata verification, 2038년 이후 timestamp 저장 기능이 없습니다. 따라서 V4는 deprecated이며 file을 backup하고 V5로 다시 format한 뒤 restore해야 합니다.

`xfs_info`를 mountpoint에 실행해 `crc=` 문자열을 찾으면 V4 여부를 판단할 수 있습니다. 문자열이 없다면 xfsprogs를 최신으로 올리고 다시 확인합니다.

폐기는 두 단계입니다. V4 mount support는 Kconfig로 build 시 끌 수 있고 이 option은 2025년 9월 default가 `no`로 바뀌었습니다. 2030년 9월에는 codebase에서 완전히 제거됩니다. 배포판은 더 일찍 지원을 철회할 수 있습니다.

Deprecated Mount Options

240-250

다음 형식의 mount 지원은 2030년 9월 제거될 예정입니다.

NameRemoval Schedule
Mounting with V4 filesystemSeptember 2030
Mounting ascii-ci filesystemSeptember 2030

Removed Mount Options

251-266

다음 mount option은 표시된 kernel version에서 이미 제거됐습니다.

NameRemoved
delaylog/nodelaylogv4.0
ihashsizev4.0
irixsgidv4.0
osyncisdsync/osyncisosyncv4.0
barrierv4.19
nobarrierv4.19
ikeep/noikeepv6.18
attr2/noattr2v6.18

sysctls

267-349

다음 XFS sysctl을 사용할 수 있습니다. 범위 열은 `Min / Default / Max` 순서입니다.

sysctl범위설명
`fs.xfs.stats_clear`0 / 0 / 1`1`을 쓰면 `/proc/fs/xfs/stat`의 누적 XFS 통계를 지우고 즉시 `0`으로 돌아갑니다.
`fs.xfs.xfssyncd_centisecs`100 / 3000 / 720000metadata를 disk로 flush하고 내부 cache cleanup을 실행하는 간격입니다.
`fs.xfs.filestream_centisecs`1 / 3000 / 360000filestream cache reference를 age하고 timeout된 AG를 free stream pool로 돌리는 간격입니다.
`fs.xfs.speculative_prealloc_lifetime`1 / 300 / 86400 secondsunused speculative preallocation이 있는 inode를 background scan하는 간격입니다. clean inode의 미사용 공간을 free pool로 돌립니다.
`fs.xfs.error_level`0 / 3 / 11내부 error 보고량입니다. shutdown의 상세 message와 backtrace 등을 제어하며 threshold는 `XFS_ERRLEVEL_OFF=0`, `LOW=1`, `HIGH=5`입니다.
`fs.xfs.panic_mask`0 / 0 / 511선택한 error가 `BUG()`를 부르게 하는 debugging 전용 bitmask입니다. `XFS_PTAG_IFLUSH`부터 `XFS_PTAG_VERIFIER_ERROR`까지 tag를 OR합니다.
`fs.xfs.inherit_sync`0 / 1 / 1**xfs_io(8)** chattr로 directory에 준 `sync` flag를 내부 file에 상속합니다.
`fs.xfs.inherit_nodump`0 / 1 / 1directory의 `nodump` flag를 file에 상속합니다.
`fs.xfs.inherit_noatime`0 / 1 / 1directory의 `noatime` flag를 file에 상속합니다.
`fs.xfs.inherit_nosymlinks`0 / 1 / 1directory의 `nosymlinks` flag를 file에 상속합니다.
`fs.xfs.inherit_nodefrag`0 / 1 / 1directory의 `nodefrag` flag를 file에 상속합니다.
`fs.xfs.rotorstep`1 / 1 / 256`inode32` mode에서 다음 allocation group으로 이동하기 전 같은 AG에 배치하려는 file 수를 정해 새 file extent 할당의 AG 이동 속도를 제어합니다.

`fs.xfs.panic_mask`의 tag는 `XFS_NO_PTAG=0`, `XFS_PTAG_IFLUSH=0x00000001`, `LOGRES=0x00000002`, `AILDELETE=0x00000004`, `ERROR_REPORT=0x00000008`, `SHUTDOWN_CORRUPT=0x00000010`, `SHUTDOWN_IOERROR=0x00000020`, `SHUTDOWN_LOGERROR=0x00000040`, `FSBLOCK_ZERO=0x00000080`, `VERIFIER_ERROR=0x00000100`입니다.

Deprecated Sysctls

350-354

현재 deprecated sysctl은 없습니다.

Removed Sysctls

355-367

다음 sysctl은 표시된 kernel version에서 제거됐습니다.

NameRemoved
fs.xfs.xfsbufd_centisecv4.0
fs.xfs.age_buffer_centisecsv4.0
fs.xfs.irix_symlink_modev6.18
fs.xfs.irix_sgid_inheritv6.18
fs.xfs.speculative_cow_prealloc_lifetimev6.18

Error handling

368-489

XFS는 발견한 error 종류에 따라 다르게 동작합니다. failure speed는 error를 즉시, 정해진 retry 횟수 뒤, 정해진 시간 뒤에 위로 전달할지 또는 영원히 retry할지 정합니다. error class는 metadata I/O나 memory allocation처럼 설정이 적용될 subsystem을 뜻하고, error handler는 특정 error의 동작을 정의합니다.

동작은 `sysfs` file로 설정하며 각 handler는 독립적입니다. 한 class의 handler 조건 중 먼저 충족된 것이 error를 reset·retry하지 않고 전달합니다. 전달 뒤에는 context에 따라 unrecoverable shutdown, userspace 반환, 또는 unmount 중처럼 보고할 곳이 없어 무시될 수 있습니다.

mount된 filesystem마다 설정은 `/sys/fs/xfs/<dev>/error/<class>/<error>/` 아래에 있습니다. `<dev>`는 `XFS(<dev>): ...` kernel error message와 같은 짧은 device name, `<class>`는 subsystem이며 4.9 기준 `metadata` class가 metadata buffer write I/O에 적용됩니다. `<error>`는 개별 handler입니다.

top-level `/sys/fs/xfs/<dev>/error/`의 `fail_at_unmount` 범위는 0~1, 기본은 1입니다. `1`이면 unmount 중 다른 설정을 무시하고 retry와 timeout 없는 immediate fail로 바꿔 persistent error가 있어도 unmount를 끝냅니다.

`fail_at_unmount=0`이면 retry·timeout이 소진될 때까지 설정대로 계속해 unmount가 늦어지거나 `retry forever` 때문에 끝나지 않을 수 있습니다. unmount가 진행되면 sysfs entry가 먼저 사라질 수 있으므로 hang을 막을 값은 시작 전에 설정해야 합니다.

각 class에는 특정 error handler와 그 밖의 error용 `default` handler가 있습니다. 여러 retry constraint를 함께 설정하면 먼저 만료된 조건이 error를 전달합니다. 개별 directory의 `max_retries` 범위는 -1부터 INTMAX입니다.

  • `max_retries=-1`: 해당 error를 영원히 retry
  • `max_retries=0`: error가 보고되면 즉시 실패
  • `max_retries=N`: 전달하기 전에 N번 retry; 성공하면 해당 context의 count reset
  • `retry_timeout_seconds=-1`: 영원히 retry
  • `retry_timeout_seconds=0`: 즉시 실패
  • `retry_timeout_seconds=N`: 최대 N초 retry한 뒤 전달

기본값은 class와 error context에 따라 다릅니다. 예를 들어 `metadata/ENODEV`는 retry해도 회복할 수 없는 fatal error이므로 `-1`이 아니라 `0`, 즉 immediate fail이 기본입니다.

Workqueue Concurrency

490-531

XFS는 kernel workqueue로 metadata update를 병렬화해 여러 I/O를 동시에 처리하는 storage hardware를 활용합니다. 이 interface는 내부 구현 detail이며 userspace API/ABI 보장 대상이 아닙니다. 진단과 tuning 목적으로만 제공되고 언제든 바뀔 수 있습니다.

filesystem workqueue knob은 task와 data device의 짧은 이름으로 `/sys/bus/workqueue/devices/${task}!${device}`에 있습니다.

TaskDescription
xfs_iwalk-$pidfilesystem 전체 inode scan. 현재 mount-time quotacheck로 제한
xfs-gcEOF 밖 speculative allocation 또는 copy-on-write staging에 쓰고 남은 disk space의 background garbage collection

예를 들어 `/dev/nvme0n1`의 quotacheck workqueue는 `/sys/bus/workqueue/devices/xfs_iwalk-1111!nvme0n1/`에 있습니다.

KnobDescription
max_active작업을 실행하도록 시작할 수 있는 background thread 최대 수
cpumaskthread 실행이 허용된 CPU
nicethread scheduling 상대 priority. userspace process와 같은 nice level

Zoned Filesystems

532-551

zoned filesystem은 `/sys/fs/xfs/<dev>/zoned/`에 attribute를 노출합니다.

attribute범위설명
max_open_zonesMin 1 / Default varies / Max UINTMAXdata placement에 사용할 수 있는 open zone 최대 수를 보여 주는 read-only 값입니다. mount 때 backing zoned device capability, filesystem 크기, `max_open_zones` mount option으로 결정합니다.
zonegc_low_spaceMin 0 / Default 0 / Max 100GC가 write용으로 유지할 unused space 비율입니다. 높이면 unused block 공간을 더 회수해 burst 여유를 늘리지만 write amplification이 커집니다. 값과 무관하게 data placement용 `max_open_zones`를 열 수 있는 최소 block은 항상 확보합니다.