요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
======================
The SGI XFS Filesystem
======================
XFS is a high performance journaling filesystem which originated
on the SGI IRIX platform. It is completely multi-threaded, can
support large files and large filesystems, extended attributes,
variable block sizes, is extent based, and makes extensive use of
Btrees (directories, extents, free space) to aid both performance
and scalability.
Refer to the documentation at https://xfs.wiki.kernel.org/
for further details. This implementation is on-disk compatible
with the IRIX version of XFS.
Mount Options
=============
When mounting an XFS filesystem, the following options are accepted.
allocsize=size
Sets the buffered I/O end-of-file preallocation size when
doing delayed allocation writeout (default size is 64KiB).
Valid values for this option are page size (typically 4KiB)
through to 1GiB, inclusive, in power-of-2 increments.
The default behaviour is for dynamic end-of-file
preallocation size, which uses a set of heuristics to
optimise the preallocation size based on the current
allocation patterns within the file and the access patterns
to the file. Specifying a fixed ``allocsize`` value turns off
the dynamic behaviour.
discard or nodiscard (default)
Enable/disable the issuing of commands to let the block
device reclaim space freed by the filesystem. This is
useful for SSD devices, thinly provisioned LUNs and virtual
machine images, but may have a performance impact.
Note: It is currently recommended that you use the ``fstrim``
application to ``discard`` unused blocks rather than the ``discard``
mount option because the performance impact of this option
is quite severe.
grpid/bsdgroups or nogrpid/sysvgroups (default)
These options define what group ID a newly created file
gets. When ``grpid`` is set, it takes the group ID of the
directory in which it is created; otherwise it takes the
``fsgid`` of the current process, unless the directory has the
``setgid`` bit set, in which case it takes the ``gid`` from the
parent directory, and also gets the ``setgid`` bit set if it is
a directory itself.
filestreams
Make the data allocator use the filestreams allocation mode
across the entire filesystem rather than just on directories
configured to use it.
inode32 or inode64 (default)
When ``inode32`` is specified, it indicates that XFS limits
inode creation to locations which will not result in inode
numbers with more than 32 bits of significance.
When ``inode64`` is specified, it indicates that XFS is allowed
to create inodes at any location in the filesystem,
including those which will result in inode numbers occupying
more than 32 bits of significance.
``inode32`` is provided for backwards compatibility with older
systems and applications, since 64 bits inode numbers might
cause problems for some applications that cannot handle
large inode numbers. If applications are in use which do
not handle inode numbers bigger than 32 bits, the ``inode32``
option should be specified.
largeio or nolargeio (default)
If ``nolargeio`` is specified, the optimal I/O reported in
``st_blksize`` by **stat(2)** will be as small as possible to allow
user applications to avoid inefficient read/modify/write
I/O. This is typically the page size of the machine, as
this is the granularity of the page cache.
If ``largeio`` is specified, a filesystem that was created with a
``swidth`` specified will return the ``swidth`` value (in bytes)
in ``st_blksize``. If the filesystem does not have a ``swidth``
specified but does specify an ``allocsize`` then ``allocsize``
(in bytes) will be returned instead. Otherwise the behaviour
is the same as if ``nolargeio`` was specified.
logbufs=value
Set the number of in-memory log buffers. Valid numbers
range from 2-8 inclusive.
The default value is 8 buffers.
If the memory cost of 8 log buffers is too high on small
systems, then it may be reduced at some cost to performance
on metadata intensive workloads. The ``logbsize`` option below
controls the size of each buffer and so is also relevant to
this case.
lifetime (default) or nolifetime
Enable data placement based on write life time hints provided
by the user. This turns on co-allocation of data of similar
life times when statistically favorable to reduce garbage
collection cost.
These options are only available for zoned rt file systems.
logbsize=value
Set the size of each in-memory log buffer. The size may be
specified in bytes, or in kilobytes with a "k" suffix.
Valid sizes for version 1 and version 2 logs are 16384 (16k)
and 32768 (32k). Valid sizes for version 2 logs also
include 65536 (64k), 131072 (128k) and 262144 (256k). The
logbsize must be an integer multiple of the log
stripe unit configured at **mkfs(8)** time.
The default value for version 1 logs is 32768, while the
default value for version 2 logs is MAX(32768, log_sunit).
logdev=device and rtdev=device
Use an external log (metadata journal) and/or real-time device.
An XFS filesystem has up to three parts: a data section, a log
section, and a real-time section. The real-time section is
optional, and the log section can be separate from the data
section or contained within it.
max_atomic_write=value
Set the maximum size of an atomic write. The size may be
specified in bytes, in kilobytes with a "k" suffix, in megabytes
with a "m" suffix, or in gigabytes with a "g" suffix. The size
cannot be larger than the maximum write size, larger than the
size of any allocation group, or larger than the size of a
remapping operation that the log can complete atomically.
The default value is to set the maximum I/O completion size
to allow each CPU to handle one at a time.
max_open_zones=value
Specify the max number of zones to keep open for writing on a
zoned rt device. Many open zones aids file data separation
but may impact performance on HDDs.
If ``max_open_zones`` is not specified, the value is determined
by the capabilities and the size of the zoned rt device.
noalign
Data allocations will not be aligned at stripe unit
boundaries. This is only relevant to filesystems created
with non-zero data alignment parameters (``sunit``, ``swidth``) by
**mkfs(8)**.
norecovery
The filesystem will be mounted without running log recovery.
If the filesystem was not cleanly unmounted, it is likely to
be inconsistent when mounted in ``norecovery`` mode.
Some files or directories may not be accessible because of this.
Filesystems mounted ``norecovery`` must be mounted read-only or
the mount will fail.
nouuid
Don't check for double mounted file systems using the file
system ``uuid``. This is useful to mount LVM snapshot volumes,
and often used in combination with ``norecovery`` for mounting
read-only snapshots.
noquota
Forcibly turns off all quota accounting and enforcement
within the filesystem.
uquota/usrquota/uqnoenforce/quota
User disk quota accounting enabled, and limits (optionally)
enforced. Refer to **xfs_quota(8)** for further details.
gquota/grpquota/gqnoenforce
Group disk quota accounting enabled and limits (optionally)
enforced. Refer to **xfs_quota(8)** for further details.
pquota/prjquota/pqnoenforce
Project disk quota accounting enabled and limits (optionally)
enforced. Refer to **xfs_quota(8)** for further details.
sunit=value and swidth=value
Used to specify the stripe unit and width for a RAID device
or a stripe volume. "value" must be specified in 512-byte
block units. These options are only relevant to filesystems
that were created with non-zero data alignment parameters.
The ``sunit`` and ``swidth`` parameters specified must be compatible
with the existing filesystem alignment characteristics. In
general, that means the only valid changes to ``sunit`` are
increasing it by a power-of-2 multiple. Valid ``swidth`` values
are any integer multiple of a valid ``sunit`` value.
Typically the only time these mount options are necessary if
after an underlying RAID device has had its geometry
modified, such as adding a new disk to a RAID5 lun and
reshaping it.
swalloc
Data allocations will be rounded up to stripe width boundaries
when the current end of file is being extended and the file
size is larger than the stripe width size.
wsync
When specified, all filesystem namespace operations are
executed synchronously. This ensures that when the namespace
operation (create, unlink, etc) completes, the change to the
namespace is on stable storage. This is useful in HA setups
where failover must not result in clients seeing
inconsistent namespace presentation during or after a
failover event.
Deprecation of V4 Format
========================
The V4 filesystem format lacks certain features that are supported by
the V5 format, such as metadata checksumming, strengthened metadata
verification, and the ability to store timestamps past the year 2038.
Because of this, the V4 format is deprecated. All users should upgrade
by backing up their files, reformatting, and restoring from the backup.
Administrators and users can detect a V4 filesystem by running xfs_info
against a filesystem mountpoint and checking for a string containing
"crc=". If no such string is found, please upgrade xfsprogs to the
latest version and try again.
The deprecation will take place in two parts. Support for mounting V4
filesystems can now be disabled at kernel build time via Kconfig option.
These options were changed to default to no in September 2025. In
September 2030, support will be removed from the codebase entirely.
Note: Distributors may choose to withdraw V4 format support earlier than
the dates listed above.
Deprecated Mount Options
========================
============================ ================
Name Removal Schedule
============================ ================
Mounting with V4 filesystem September 2030
Mounting ascii-ci filesystem September 2030
============================ ================
Removed Mount Options
=====================
=========================== =======
Name Removed
=========================== =======
delaylog/nodelaylog v4.0
ihashsize v4.0
irixsgid v4.0
osyncisdsync/osyncisosync v4.0
barrier v4.19
nobarrier v4.19
ikeep/noikeep v6.18
attr2/noattr2 v6.18
=========================== =======
sysctls
=======
The following sysctls are available for the XFS filesystem:
fs.xfs.stats_clear (Min: 0 Default: 0 Max: 1)
Setting this to "1" clears accumulated XFS statistics
in /proc/fs/xfs/stat. It then immediately resets to "0".
fs.xfs.xfssyncd_centisecs (Min: 100 Default: 3000 Max: 720000)
The interval at which the filesystem flushes metadata
out to disk and runs internal cache cleanup routines.
fs.xfs.filestream_centisecs (Min: 1 Default: 3000 Max: 360000)
The interval at which the filesystem ages filestreams cache
references and returns timed-out AGs back to the free stream
pool.
fs.xfs.speculative_prealloc_lifetime
(Units: seconds Min: 1 Default: 300 Max: 86400)
The interval at which the background scanning for inodes
with unused speculative preallocation runs. The scan
removes unused preallocation from clean inodes and releases
the unused space back to the free pool.
fs.xfs.error_level (Min: 0 Default: 3 Max: 11)
A volume knob for error reporting when internal errors occur.
This will generate detailed messages & backtraces for filesystem
shutdowns, for example. Current threshold values are:
XFS_ERRLEVEL_OFF: 0
XFS_ERRLEVEL_LOW: 1
XFS_ERRLEVEL_HIGH: 5
fs.xfs.panic_mask (Min: 0 Default: 0 Max: 511)
Causes certain error conditions to call BUG(). Value is a bitmask;
OR together the tags which represent errors which should cause panics:
XFS_NO_PTAG 0
XFS_PTAG_IFLUSH 0x00000001
XFS_PTAG_LOGRES 0x00000002
XFS_PTAG_AILDELETE 0x00000004
XFS_PTAG_ERROR_REPORT 0x00000008
XFS_PTAG_SHUTDOWN_CORRUPT 0x00000010
XFS_PTAG_SHUTDOWN_IOERROR 0x00000020
XFS_PTAG_SHUTDOWN_LOGERROR 0x00000040
XFS_PTAG_FSBLOCK_ZERO 0x00000080
XFS_PTAG_VERIFIER_ERROR 0x00000100
This option is intended for debugging only.
fs.xfs.inherit_sync (Min: 0 Default: 1 Max: 1)
Setting this to "1" will cause the "sync" flag set
by the **xfs_io(8)** chattr command on a directory to be
inherited by files in that directory.
fs.xfs.inherit_nodump (Min: 0 Default: 1 Max: 1)
Setting this to "1" will cause the "nodump" flag set
by the **xfs_io(8)** chattr command on a directory to be
inherited by files in that directory.
fs.xfs.inherit_noatime (Min: 0 Default: 1 Max: 1)
Setting this to "1" will cause the "noatime" flag set
by the **xfs_io(8)** chattr command on a directory to be
inherited by files in that directory.
fs.xfs.inherit_nosymlinks (Min: 0 Default: 1 Max: 1)
Setting this to "1" will cause the "nosymlinks" flag set
by the **xfs_io(8)** chattr command on a directory to be
inherited by files in that directory.
fs.xfs.inherit_nodefrag (Min: 0 Default: 1 Max: 1)
Setting this to "1" will cause the "nodefrag" flag set
by the **xfs_io(8)** chattr command on a directory to be
inherited by files in that directory.
fs.xfs.rotorstep (Min: 1 Default: 1 Max: 256)
In "inode32" allocation mode, this option determines how many
files the allocator attempts to allocate in the same allocation
group before moving to the next allocation group. The intent
is to control the rate at which the allocator moves between
allocation groups when allocating extents for new files.
Deprecated Sysctls
==================
None currently.
Removed Sysctls
===============
========================================== =======
Name Removed
========================================== =======
fs.xfs.xfsbufd_centisec v4.0
fs.xfs.age_buffer_centisecs v4.0
fs.xfs.irix_symlink_mode v6.18
fs.xfs.irix_sgid_inherit v6.18
fs.xfs.speculative_cow_prealloc_lifetime v6.18
========================================== =======
Error handling
==============
XFS can act differently according to the type of error found during its
operation. The implementation introduces the following concepts to the error
handler:
-failure speed:
Defines how fast XFS should propagate an error upwards when a specific
error is found during the filesystem operation. It can propagate
immediately, after a defined number of retries, after a set time period,
or simply retry forever.
-error classes:
Specifies the subsystem the error configuration will apply to, such as
metadata IO or memory allocation. Different subsystems will have
different error handlers for which behaviour can be configured.
-error handlers:
Defines the behavior for a specific error.
The filesystem behavior during an error can be set via ``sysfs`` files. Each
error handler works independently - the first condition met by an error handler
for a specific class will cause the error to be propagated rather than reset and
retried.
The action taken by the filesystem when the error is propagated is context
dependent - it may cause a shut down in the case of an unrecoverable error,
it may be reported back to userspace, or it may even be ignored because
there's nothing useful we can with the error or anyone we can report it to (e.g.
during unmount).
The configuration files are organized into the following hierarchy for each
mounted filesystem:
/sys/fs/xfs/<dev>/error/<class>/<error>/
Where:
<dev>
The short device name of the mounted filesystem. This is the same device
name that shows up in XFS kernel error messages as "XFS(<dev>): ..."
<class>
The subsystem the error configuration belongs to. As of 4.9, the defined
classes are:
- "metadata": applies metadata buffer write IO
<error>
The individual error handler configurations.
Each filesystem has "global" error configuration options defined in their top
level directory:
/sys/fs/xfs/<dev>/error/
fail_at_unmount (Min: 0 Default: 1 Max: 1)
Defines the filesystem error behavior at unmount time.
If set to a value of 1, XFS will override all other error configurations
during unmount and replace them with "immediate fail" characteristics.
i.e. no retries, no retry timeout. This will always allow unmount to
succeed when there are persistent errors present.
If set to 0, the configured retry behaviour will continue until all
retries and/or timeouts have been exhausted. This will delay unmount
completion when there are persistent errors, and it may prevent the
filesystem from ever unmounting fully in the case of "retry forever"
handler configurations.
Note: there is no guarantee that fail_at_unmount can be set while an
unmount is in progress. It is possible that the ``sysfs`` entries are
removed by the unmounting filesystem before a "retry forever" error
handler configuration causes unmount to hang, and hence the filesystem
must be configured appropriately before unmount begins to prevent
unmount hangs.
Each filesystem has specific error class handlers that define the error
propagation behaviour for specific errors. There is also a "default" error
handler defined, which defines the behaviour for all errors that don't have
specific handlers defined. Where multiple retry constraints are configured for
a single error, the first retry configuration that expires will cause the error
to be propagated. The handler configurations are found in the directory:
/sys/fs/xfs/<dev>/error/<class>/<error>/
max_retries (Min: -1 Default: Varies Max: INTMAX)
Defines the allowed number of retries of a specific error before
the filesystem will propagate the error. The retry count for a given
error context (e.g. a specific metadata buffer) is reset every time
there is a successful completion of the operation.
Setting the value to "-1" will cause XFS to retry forever for this
specific error.
Setting the value to "0" will cause XFS to fail immediately when the
specific error is reported.
Setting the value to "N" (where 0 < N < Max) will make XFS retry the
operation "N" times before propagating the error.
retry_timeout_seconds (Min: -1 Default: Varies Max: 1 day)
Define the amount of time (in seconds) that the filesystem is
allowed to retry its operations when the specific error is
found.
Setting the value to "-1" will allow XFS to retry forever for this
specific error.
Setting the value to "0" will cause XFS to fail immediately when the
specific error is reported.
Setting the value to "N" (where 0 < N < Max) will allow XFS to retry the
operation for up to "N" seconds before propagating the error.
**Note:** The default behaviour for a specific error handler is dependent on both
the class and error context. For example, the default values for
"metadata/ENODEV" are "0" rather than "-1" so that this error handler defaults
to "fail immediately" behaviour. This is done because ENODEV is a fatal,
unrecoverable error no matter how many times the metadata IO is retried.
Workqueue Concurrency
=====================
XFS uses kernel workqueues to parallelize metadata update processes. This
enables it to take advantage of storage hardware that can service many IO
operations simultaneously. This interface exposes internal implementation
details of XFS, and as such is explicitly not part of any userspace API/ABI
guarantee the kernel may give userspace. These are undocumented features of
the generic workqueue implementation XFS uses for concurrency, and they are
provided here purely for diagnostic and tuning purposes and may change at any
time in the future.
The control knobs for a filesystem's workqueues are organized by task at hand
and the short name of the data device. They all can be found in:
/sys/bus/workqueue/devices/${task}!${device}
================ ===========
Task Description
================ ===========
xfs_iwalk-$pid Inode scans of the entire filesystem. Currently limited to
mount time quotacheck.
xfs-gc Background garbage collection of disk space that have been
speculatively allocated beyond EOF or for staging copy on
write operations.
================ ===========
For example, the knobs for the quotacheck workqueue for /dev/nvme0n1 would be
found in /sys/bus/workqueue/devices/xfs_iwalk-1111!nvme0n1/.
The interesting knobs for XFS workqueues are as follows:
============ ===========
Knob Description
============ ===========
max_active Maximum number of background threads that can be started to
run the work.
cpumask CPUs upon which the threads are allowed to run.
nice Relative priority of scheduling the threads. These are the
same nice levels that can be applied to userspace processes.
============ ===========
Zoned Filesystems
=================
For zoned file systems, the following attributes are exposed in:
/sys/fs/xfs/<dev>/zoned/
max_open_zones (Min: 1 Default: Varies Max: UINTMAX)
This read-only attribute exposes the maximum number of open zones
available for data placement. The value is determined at mount time and
is limited by the capabilities of the backing zoned device, file system
size and the max_open_zones mount option.
zonegc_low_space (Min: 0 Default: 0 Max: 100)
Define a percentage for how much of the unused space that GC should keep
available for writing. A high value will reclaim more of the space
occupied by unused blocks, creating a larger buffer against write
bursts at the cost of increased write amplification. Regardless
of this value, garbage collection will always aim to free a minimum
amount of blocks to keep max_open_zones open for data placement purposes.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
The SGI XFS Filesystem
1-18XFS는 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-217XFS 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-239V4 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월 제거될 예정입니다.
| Name | Removal Schedule |
|---|---|
| Mounting with V4 filesystem | September 2030 |
| Mounting ascii-ci filesystem | September 2030 |
Removed Mount Options
251-266다음 mount option은 표시된 kernel version에서 이미 제거됐습니다.
| Name | Removed |
|---|---|
| delaylog/nodelaylog | v4.0 |
| ihashsize | v4.0 |
| irixsgid | v4.0 |
| osyncisdsync/osyncisosync | v4.0 |
| barrier | v4.19 |
| nobarrier | v4.19 |
| ikeep/noikeep | v6.18 |
| attr2/noattr2 | v6.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 / 720000 | metadata를 disk로 flush하고 내부 cache cleanup을 실행하는 간격입니다. |
| `fs.xfs.filestream_centisecs` | 1 / 3000 / 360000 | filestream cache reference를 age하고 timeout된 AG를 free stream pool로 돌리는 간격입니다. |
| `fs.xfs.speculative_prealloc_lifetime` | 1 / 300 / 86400 seconds | unused 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 / 1 | directory의 `nodump` flag를 file에 상속합니다. |
| `fs.xfs.inherit_noatime` | 0 / 1 / 1 | directory의 `noatime` flag를 file에 상속합니다. |
| `fs.xfs.inherit_nosymlinks` | 0 / 1 / 1 | directory의 `nosymlinks` flag를 file에 상속합니다. |
| `fs.xfs.inherit_nodefrag` | 0 / 1 / 1 | directory의 `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에서 제거됐습니다.
| Name | Removed |
|---|---|
| fs.xfs.xfsbufd_centisec | v4.0 |
| fs.xfs.age_buffer_centisecs | v4.0 |
| fs.xfs.irix_symlink_mode | v6.18 |
| fs.xfs.irix_sgid_inherit | v6.18 |
| fs.xfs.speculative_cow_prealloc_lifetime | v6.18 |
Error handling
368-489XFS는 발견한 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-531XFS는 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}`에 있습니다.
| Task | Description |
|---|---|
| xfs_iwalk-$pid | filesystem 전체 inode scan. 현재 mount-time quotacheck로 제한 |
| xfs-gc | EOF 밖 speculative allocation 또는 copy-on-write staging에 쓰고 남은 disk space의 background garbage collection |
예를 들어 `/dev/nvme0n1`의 quotacheck workqueue는 `/sys/bus/workqueue/devices/xfs_iwalk-1111!nvme0n1/`에 있습니다.
| Knob | Description |
|---|---|
| max_active | 작업을 실행하도록 시작할 수 있는 background thread 최대 수 |
| cpumask | thread 실행이 허용된 CPU |
| nice | thread scheduling 상대 priority. userspace process와 같은 nice level |
Zoned Filesystems
532-551zoned filesystem은 `/sys/fs/xfs/<dev>/zoned/`에 attribute를 노출합니다.
| attribute | 범위 | 설명 |
|---|---|---|
| max_open_zones | Min 1 / Default varies / Max UINTMAX | data placement에 사용할 수 있는 open zone 최대 수를 보여 주는 read-only 값입니다. mount 때 backing zoned device capability, filesystem 크기, `max_open_zones` mount option으로 결정합니다. |
| zonegc_low_space | Min 0 / Default 0 / Max 100 | GC가 write용으로 유지할 unused space 비율입니다. 높이면 unused block 공간을 더 회수해 burst 여유를 늘리지만 write amplification이 커집니다. 값과 무관하게 data placement용 `max_open_zones`를 열 수 있는 최소 block은 항상 확보합니다. |
요약과 해설
xfs.rst:1-551XFS는 extent와 Btree를 기반으로 큰 file·filesystem을 확장성 있게 처리합니다. 운영 시에는 mount option의 정렬·quota·journal·recovery 의미와, sysfs error handler의 retry 종료 조건을 정확히 구분해야 합니다.