← 返回命令列表

Linux command

mkfs.xfs 命令

安全

权限或系统影响较大,执行前请核对目标。

常用示例

Example

sudo mkfs.xfs /dev/sdXY

Example

sudo mkfs.xfs -L mylabel /dev/sdXY

Force

sudo mkfs.xfs -f /dev/sdXY

Example

sudo mkfs.xfs -b size=4096 /dev/sdXY

Example

sudo mkfs.xfs -i size=512 /dev/sdXY

说明

mkfs.xfs creates an XFS filesystem on a partition or device. XFS is a high-performance journaling filesystem designed for scalability and parallel I/O operations.

参数

-L LABEL
Set the filesystem label (max 12 characters)
-f
Force overwrite of existing filesystem
-b size=N
Set block size in bytes (512-65536, default usually 4096)
-i size=N
Set inode size in bytes
-d options
Data section options (agcount, file, name, size, etc.)
-l options
Log section options (internal, size, version, etc.)
-n options
Naming options (size, version, etc.)
-r options
Real-time section options
-q
Quiet mode; suppress output
-N
Dry run; print parameters without creating filesystem

FAQ

What is the mkfs.xfs command used for?

mkfs.xfs creates an XFS filesystem on a partition or device. XFS is a high-performance journaling filesystem designed for scalability and parallel I/O operations.

How do I run a basic mkfs.xfs example?

Run `sudo mkfs.xfs /dev/sdXY` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -L LABEL do in mkfs.xfs?

Set the filesystem label (max 12 characters)