mkfs.xfs [ -b block_size ] [ -d data_section_options ] [ -f ] [ -i inode_options ] [ -l log_section_options ] [ -n naming_options ] [ -p protofile ] [ -q ] [ -r realtime_section_options ] [ -s sector_size ] [ -L label ] [ -N ] [ -K ] device
mkfs.xfs constructs an XFS filesystem by writing on a special file using the values found in the arguments of the command line. It is invoked automatically by mkfs(8) when it is given the -t xfs option.
In its simplest (and most commonly used form), the size of the filesystem is determined from the disk driver. As an example, to make a filesystem with an internal log on the first partition on the first SCSI disk, use:
The metadata log can be placed on another device to reduce the number of disk seeks. To create a filesystem on the first partition on the first SCSI disk with a 10000 block log located on the first partition on the second SCSI disk, use:
mkfs.xfs -l logdev=/dev/sdb1,size=10000b /dev/sda1
Each of the option elements in the argument list above can be given as multiple comma-separated suboptions if multiple suboptions apply to the same option. Equivalently, each main option can be given multiple times with different suboptions. For example, -l internal,size=10000b and -l internal -l size=10000b are equivalent.
In the descriptions below, sizes are given in sectors, bytes, blocks, kilobytes, megabytes, gigabytes, etc. Sizes are treated as hexadecimal if prefixed by 0x or 0X, octal if prefixed by 0, or decimal otherwise. The following lists possible multiplication suffixes:
s - multiply by sector size (default = 512, see -s option below).
b - multiply by filesystem block size (default = 4K, see -b option below).
k - multiply by one kilobyte (1,024 bytes).
m - multiply by one megabyte (1,048,576 bytes).
g - multiply by one gigabyte (1,073,741,824 bytes).
t - multiply by one terabyte (1,099,511,627,776 bytes).
p - multiply by one petabyte (1,024 terabytes).
e - multiply by one exabyte (1,048,576 terabytes).
1 /stand/diskboot
2 4872 110
3 d--777 3 1
4 usr d--777 3 1
5 sh ---755 3 1 /bin/sh
6 ken d--755 6 1
7 $
8 b0 b--644 3 1 0 0
9 c0 c--644 3 1 0 0
10 fifo p--644 3 1
11 slink l--644 3 1 /a/symbolic/link
12 : This is a comment line
13 $
14 $
When the file is a directory, the mkfs.xfs command creates the entries dot (.) and dot-dot (..) and then reads the list of names and file specifications in a recursive manner for all of the entries in the directory. A scan of the protofile is always terminated with the dollar ( $ ) token.
With a prototype file, it is not possible to specify hard links.