---
name: "ioctl_xfs_fsgeometry"
section: "2"
platform: "linux"
package: "xfsprogs"
version: "7.2.1-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/ioctl_xfs_fsgeometry"
---

# ioctl\_xfs\_fsgeometry(2)

report XFS filesystem layout and features

## NAME

ioctl\_xfs\_fsgeometry - report XFS filesystem layout and features

## SYNOPSIS

**#include \<xfs/xfs\_fs.h\>**

**int ioctl(int** *fd***, XFS\_IOC\_FSGEOMETRY, struct xfs\_fsop\_geom \****arg***);**\
 **int ioctl(int** *fd***, XFS\_IOC\_FSGEOMETRY\_V4, struct xfs\_fsop\_geom\_v4 \****arg***);**\
 **int ioctl(int** *fd***, XFS\_IOC\_FSGEOMETRY\_V1, struct xfs\_fsop\_geom\_v1 \****arg***);**

## DESCRIPTION

Report the details of an XFS filesystem layout, features, and other descriptive items. This information is conveyed in a structure of the following form:

```
struct xfs_fsop_geom {
	__u32         blocksize;
	__u32         rtextsize;
	__u32         agblocks;
	__u32         agcount;
	__u32         logblocks;
	__u32         sectsize;
	__u32         inodesize;
	__u32         imaxpct;
	__u64         datablocks;
	__u64         rtblocks;
	__u64         rtextents;
	__u64         logstart;
	unsigned char uuid[16];
	__u32         sunit;
	__u32         swidth;
	__s32         version;
	__u32         flags;
	__u32         logsectsize;
	__u32         rtsectsize;
	__u32         dirblocksize;
	/* struct xfs_fsop_geom_v1 stops here. */
	__u32         logsunit;
	/* struct xfs_fsop_geom_v4 stops here. */
	__u32         sick;
	__u32         checked;
	__u64         rgextents;
	__u64         rtstart;
	__u64         rtreserved;
	__u64         reserved[14];
};
```

*blocksize* is the size of a fundamental filesystem block, in bytes.

*rtextsize* is the size of an extent on the realtime volume, in bytes.

*agblocks* is the size of an allocation group, in units of filesystem blocks.

*agcount* is the number of allocation groups in the filesystem.

*logblocks* is the size of the log, in units of filesystem blocks.

*sectsize* is the smallest amount of data that can be written to the data device atomically, in bytes.

*inodesize* is the size of an inode record, in bytes.

*imaxpct* is the maximum percentage of the filesystem that can be allocated to inode record blocks.

*datablocks* is the size of the data device, in units of filesystem blocks.

*rtblocks* is the size of the realtime device, in units of filesystem blocks.

*rtextents* is the number of extents that can be allocated on the realtime device.

*logstart* is the start of the log, in units of filesystem blocks. If the filesystem has an external log, this will be zero.

*uuid* is the universal unique identifier of the filesystem.

*sunit* is what the filesystem has been told is the size of a RAID stripe unit on the underlying data device, in filesystem blocks.

*swidth* is what the filesystem has been told is the width of a RAID stripe on the underlying data device, in units of RAID stripe units.

*version* is the version of this structure. This value will be XFS\_FSOP\_GEOM\_VERSION.

*flags* tell us what features are enabled on the filesystem. Refer to the section **FILESYSTEM FEATURE FLAGS** below for more information about each feature.

*logsectsize* is the smallest amount of data that can be written to the log device atomically, in bytes.

*rtsectsize* is the smallest amount of data that can be written to the realtime device atomically, in bytes.

*dirblocksize* is the size of directory blocks, in bytes.

*logsunit* is what the filesystem has been told is the size of a RAID stripe unit on the underlying log device, in filesystem blocks. This field is meaningful only if the flag **XFS\_FSOP\_GEOM\_FLAGS\_LOGV2** is set.

The fields *sick* and *checked* indicate the relative health of various whole-filesystem metadata. Please see the section **XFS METADATA HEALTH REPORTING** for more details.

*rgextents* Is the number of RT extents in each rtgroup.

*rtstart* Start of the internal RT device in fsblocks.  0 if an external RT device is used. This field is meaningful only if the flag **XFS\_FSOP\_GEOM\_FLAGS\_ZONED** is set.

*rtreserved* The amount of space in the realtime section that is reserved for internal use by garbage collection and reorganization algorithms in fsblocks. This field is meaningful only if the flag **XFS\_FSOP\_GEOM\_FLAGS\_ZONED** is set.

*reserved* is set to zero.

## FILESYSTEM FEATURE FLAGS

Filesystem features are reported to userspace as a combination the following flags:

- **XFS\_FSOP\_GEOM\_FLAGS\_ATTR**

  Extended attributes are present.

- **XFS\_FSOP\_GEOM\_FLAGS\_NLINK**

  Files on this filesystem support up to 2^32 hard links. If this flag is not set, files on this filesystem support only up to 2^16 hard links.

- **XFS\_FSOP\_GEOM\_FLAGS\_QUOTA**

  Quotas are enabled.

- **XFS\_FSOP\_GEOM\_FLAGS\_IALIGN**

  Inodes are aligned for better performance.

- **XFS\_FSOP\_GEOM\_FLAGS\_DALIGN**

  Filesystem tries to align data block allocations to RAID stripe units for better performance.

- **XFS\_FSOP\_GEOM\_FLAGS\_SHARED**

  Unused.

- **XFS\_FSOP\_GEOM\_FLAGS\_EXTFLG**

  Filesystem supports unwritten extents.

- **XFS\_FSOP\_GEOM\_FLAGS\_DIRV2**

  Directories are in version 2 format and maintain free space data for better performance. Version 1 format directories are no longer supported.

- **XFS\_FSOP\_GEOM\_FLAGS\_LOGV2**

  Log uses the V2 format.

- **XFS\_FSOP\_GEOM\_FLAGS\_SECTOR**

  The log device has a sector size larger than 512 bytes.

- **XFS\_FSOP\_GEOM\_FLAGS\_ATTR2**

  Filesystem contains V2 extended attributes.

- **XFS\_FSOP\_GEOM\_FLAGS\_PROJID32**

  Project IDs can be as large as 2^32. If this flag is not set, the filesystem supports only 2^16 project IDs.

- **XFS\_FSOP\_GEOM\_FLAGS\_DIRV2CI**

  Case-insensitive lookups are supported on directories.

- **XFS\_FSOP\_GEOM\_FLAGS\_LAZYSB**

  On-disk superblock counters are updated only at unmount time.

- **XFS\_FSOP\_GEOM\_FLAGS\_V5SB**

  Metadata blocks are self describing and contain checksums.

- **XFS\_FSOP\_GEOM\_FLAGS\_FTYPE**

  Directories contain inode types in directory entries.

- **XFS\_FSOP\_GEOM\_FLAGS\_FINOBT**

  Filesystem maintains an index of free inodes.

- **XFS\_FSOP\_GEOM\_FLAGS\_SPINODES**

  Filesystem may allocate discontiguous inode chunks when free space is fragmented.

- **XFS\_FSOP\_GEOM\_FLAGS\_RMAPBT**

  Filesystem stores reverse mappings of blocks to owners.

- **XFS\_FSOP\_GEOM\_FLAGS\_REFLINK**

  Filesystem supports sharing blocks between files.

- **XFS\_FSOP\_GEOM\_FLAGS\_EXCHANGE\_RANGE**

  Filesystem can exchange file contents atomically via XFS\_IOC\_EXCHANGE\_RANGE.

- **XFS\_FSOP\_GEOM\_FLAGS\_METADIR**

  Filesystem contains a metadata directory tree.

- **XFS\_FSOP\_GEOM\_FLAGS\_ZONED**

  Filesystem uses the zoned allocator for the RT device.

## XFS METADATA HEALTH REPORTING

The online filesystem checking utility scans metadata and records what it finds in the kernel incore state. The following scheme is used for userspace to read the incore health status of the filesystem:

- •

  If a given sick flag is set in *sick*, then that piece of metadata has been observed to be damaged. The same bit should be set in *checked*.

- •

  If a given sick flag is set in *checked* but is not set in *sick*, then that piece of metadata has been checked and is not faulty.

- •

  If a given sick flag is not set in *checked*, then no conclusion can be made.

The following flags apply to these fields:

- **XFS\_FSOP\_GEOM\_SICK\_COUNTERS**

  Inode and space summary counters.

- **XFS\_FSOP\_GEOM\_SICK\_UQUOTA**

  User quota information.

- **XFS\_FSOP\_GEOM\_SICK\_GQUOTA**

  Group quota information.

- **XFS\_FSOP\_GEOM\_SICK\_PQUOTA**

  Project quota information.

- **XFS\_FSOP\_GEOM\_SICK\_RT\_BITMAP**

  Free space bitmap for the realtime device.

- **XFS\_FSOP\_GEOM\_SICK\_RT\_SUMMARY**

  Free space summary for the realtime device.

- **XFS\_FSOP\_GEOM\_SICK\_QUOTACHECK**

  Quota resource usage counters.

## RETURN VALUE

On error, -1 is returned, and *errno* is set to indicate the error.

## ERRORS

Error codes can be one of, but are not limited to, the following:

- **EFAULT**

  The kernel was not able to copy into the userspace buffer.

- **EFSBADCRC**

  Metadata checksum validation failed while performing the query.

- **EFSCORRUPTED**

  Metadata corruption was encountered while performing the query.

- **EIO**

  An I/O error was encountered while performing the query.

## CONFORMING TO

This API is specific to XFS filesystem on the Linux kernel.

## SEE ALSO

[**ioctl**(2)](/ioctl/2.md)
