XFS

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

External

Internal

Overview

An XFS filesystem is created with mkfs.xfs.

Journal Recovery is done in kernel space at mount time. An fsck.xfs command exists, but it does not perform any useful action. If the journal needs repairing, unmount and mount the filesystem

Metadata Error Behavior. When an unrecoverable metadata error is encountered, the filesystem will be shut down.

Resize. The filesystem can be extended while online with xfs_growfs. It cannot be shrunk.

Speculative allocation. XFS uses speculative preallocation to allocate blocks past EOF as files are written. This avoids file fragmentation due to concurrent streaming writes on NFS servers. This temporarily increases the size of the file, but if the preallocated space is not used for five minutes, the preallocation will be discarded. Because of this, fragmentation is rarely a significant issue on XFS filesystems.

Mounting an XFS fileystem in /etc/fstab:

/dev/vdb1                       /support-nfs-storage  xfs defaults 0 0

Info

xfs_info <filesystem-mount-point>
xfs_info /test
meta-data=/dev/vdb1              isize=512    agcount=4, agsize=655296 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0 spinodes=0
data     =                       bsize=4096   blocks=2621184, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal               bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

XFS Quotas

XFS Quotas

Operations

Create an XFS File System

mkfs.xfs