What it does
XFS is fast with large files and many parallel writers. It can grow while mounted (xfs_growfs) but can not be shrunk. The defaults are good for nearly all cases; the label (-L, max 12 characters) is the option you use most.
How to write it
mkfs.xfs [OPTION]... DEVICEOptions 16
Most used
Nothing matches this filter.
Examples 10
$ run as a normal user# run as root (or with sudo)
1Create XFS
mkfs.xfs /dev/vdb1Prints the geometry it chose.
2With a label
mkfs.xfs -L data /dev/vdb1Mount with
LABEL=data.3Overwrite an old file system
mkfs.xfs -f /dev/vdb1Without -f it refuses when it finds a file system.
4On a logical volume
mkfs.xfs /dev/vgdata/lvdataGrow later with lvextend -r.
5Show settings without creating
mkfs.xfs -N /dev/vdb1Dry run.
6Fast creation on a thin or SSD device
mkfs.xfs -K /dev/vdb1Skips the discard step (faster on big devices).
7For a RAID with stripe settings
mkfs.xfs -d su=64k,sw=4 /dev/md0Aligns with the RAID layout.
8Check the result
xfs_info /dev/vdb1After mounting, use the mount point.
9Set the label later
xfs_admin -L newname /dev/vdb1Only when not mounted.
10Remember: no shrinking
xfs_growfs /dataXFS grows only. Plan sizes; use ext4 when you may need to shrink.
Nothing matches this filter.
Exit codes
0 | Done. |
1 | Error. |