3
mkfs.xfs \- construct an XFS filesystem
6
\f3mkfs.xfs\f1 [ \f3\-b\f1 subopt=value ] [ \f3\-d\f1 subopt[=value] ]
7
[ \f3\-i\f1 subopt=value ] [ \f3\-l\f1 subopt[=value] ]
8
[ \f3\-n\f1 subopt[=value] ] [ \f3\-p\f1 protofile ] [ \f3\-q\f1 ]
9
[ \f3\-r\f1 subopt[=value] ] [ \f3\-C\f1 ] [ \f3\-L\f1 label ] device
13
constructs an XFS filesystem by writing on a special
14
file using the values found in the arguments of the command line.
15
It is invoked automatically by \f2mkfs\f1(8) when \f2mkfs\f1 is
16
given the \f3\-t xfs\f1 option.
18
In its simplest (and most commonly used form), the size of the
19
filesystem is determined from the disk driver. As an example, to make
20
a filesystem with an internal log on the first partition on the first
27
The metadata log can be placed on another device to reduce the number
28
of disk seeks. To create a filesystem on the first partition on the
29
first SCSI disk with a 10000 block log located on the first partition
30
on the second SCSI disk, use:
33
mkfs.xfs -l logdev=/dev/sdb1,size=10000b /dev/sda1
38
elements in the argument list above can be given as multiple comma-separated
40
suboptions if multiple suboptions apply to the same option.
41
Equivalently, each main option can be given multiple times with
44
.B \-l internal,size=10000b
46
.B \-l internal \-l size=10000b
49
In the descriptions below, sizes are given in bytes, blocks, kilobytes,
51
Sizes are treated as hexadecimal if prefixed by 0x or 0X,
52
octal if prefixed by 0, or decimal otherwise.
53
If suffixed with \f3b\f1 then the size is converted by multiplying it
54
by the filesystem's block size.
55
If suffixed with \f3k\f1 then the size is converted by multiplying it by 1024.
56
If suffixed with \f3m\f1 then the size is converted by multiplying it by
57
1048576 (1024 * 1024).
58
If suffixed with \f3g\f1 then the size is converted by multiplying it by
59
1073741824 (1024 * 1024 * 1024).
64
This option specifies the fundamental block size of the filesystem.
65
The valid suboptions are:
68
\f3size=\f1\f2value\f1;
69
only one can be supplied.
70
The block size is specified either as a base two logarithm value with
74
The default value is 4096 bytes (4 KB) on systems with a 4KB pagesize.
75
The minimum value for block size is 512; the maximum is 65536 (64 KB).
76
XFS on Linux currently only supports pagesize blocks.
81
These options specify the location, size, and other parameters of the
82
data section of the filesystem.
83
The valid suboptions are:
84
\f3agcount=\f1\f2value\f1,
85
\f3agsize=\f1\f2value\f1,
86
\f3file\f1[\f3=\f1\f2value\f1],
87
\f3name=\f1\f2value\f1,
88
\f3size=\f1\f2value\f1,
89
\f3sunit=\f1\f2value\f1,
90
\f3swidth=\f1\f2value\f1,
94
\f3unwritten\f1[\f3=\f1\f2value\f1].
98
suboption is used to specify the number of allocation groups.
99
The data section of the filesystem is divided into allocation groups
100
to improve the performance of XFS.
101
More allocation groups imply that more parallelism can be achieved
102
when allocating blocks and inodes.
103
The minimum allocation group size is 16 MB;
104
the maximum size is just under 4 GB.
105
The data section of the filesystem is divided into
107
allocation groups (default value 8, unless the filesystem is smaller
108
than 128 MB or larger than 8 GB).
111
to a very large number should be avoided, since this causes an unreasonable
112
amount of CPU time to be used when the filesystem is close to full.
116
suboption is an alternative to using
118
The argument provided to
120
is the desired size of the allocation group expressed in bytes
121
(usually using the \f3m\f1 or \f3g\f1 suffixes).
122
This value must be a multiple of the filesystem block size, and
123
must be at least 16MB, and no more than 4GB, and may
124
be automatically adjusted to properly align with the stripe geometry.
129
suboption are mutually exclusive.
133
suboption can be used to specify the name of the special file containing
135
In this case, the log section must be specified as
137
(with a size, see the
139
option below) and there can be no real-time section.
143
suboption is used to specify that the file given by the
145
suboption is a regular file.
146
The suboption value is either 0 or 1,
147
with 1 signifying that the file is regular.
148
This suboption is used only to make a filesystem image.
149
If the value is omitted then 1 is assumed.
153
suboption is used to specify the size of the data section.
154
This suboption is required if
157
Otherwise, it is only needed if the filesystem should occupy
158
less space than the size of the special file.
162
suboption is used to specify the stripe unit for a RAID device or a
164
The suboption value has to be specified in 512-byte block units.
167
suboption to specify the stripe unit size in bytes.
168
This suboption ensures that data allocations will be stripe unit aligned
169
when the current end of file is being extended and the file size is larger
171
Also inode allocations and the internal log will be stripe unit aligned.
175
suboption is an alternative to using
179
suboption is used to specify the stripe unit for a RAID device or a
180
striped logical volume.
181
The suboption value has to be specified in bytes,
182
(usually using the \f3m\f1 or \f3g\f1 suffixes).
183
This value must be a multiple of the filesystem block size.
187
suboption is used to specify the stripe width for a RAID device or a
188
striped logical volume.
189
The suboption value has to be specified in 512-byte block units.
192
suboption to specify the stripe width size in bytes.
193
This suboption is required if
195
has been specified and it has to be a multiple of the
198
The stripe width will be the preferred iosize returned in the
204
suboption is an alternative to using
208
suboption is used to specify the stripe width for a RAID device or
209
striped logical volume.
210
The suboption value is expressed as a multiplier of the stripe unit,
211
usually the same as the number of stripe members in the logical
212
volume configuration, or data disks in a RAID device.
214
When a filesystem is created on a logical volume device,
216
will automatically query the logical volume for appropriate
224
suboption is used to specify whether unwritten extents are flagged as such,
226
The suboption value is either 0 or 1, with 1 signifying that unwritten
227
extent flagging should occur.
228
If the suboption is omitted, unwritten extent flagging is enabled.
229
If unwritten extents are flagged, filesystem write performance
230
will be negatively affected for preallocated file extents, since
231
extra filesystem transactions are required to convert extent flags
232
for the range of the file written.
233
This suboption should be disabled if the filesystem
234
needs to be used on operating system versions which do not support the
240
This option specifies the inode size of the filesystem, and other
241
inode allocation parameters.
242
The XFS inode contains a fixed-size part and a variable-size part.
243
The variable-size part, whose size is affected by this option, can contain:
244
directory data, for small directories;
245
attribute data, for small attribute sets;
246
symbolic link data, for small symbolic links;
247
the extent list for the file, for files with a small number of extents;
248
and the root of a tree describing the location of extents for the file,
249
for files with a large number of extents.
251
The valid suboptions for specifying inode size are:
252
\f3log=\f1\f2value\f1,
253
\f3perblock=\f1\f2value\f1,
255
\f3size=\f1\f2value\f1;
256
only one can be supplied.
257
The inode size is specified either as a base two logarithm value with
261
or as the number fitting in a filesystem block with
263
The mininum (and default) value is 256 bytes.
264
The maximum value is 2048 (2 KB) subject to the restriction that
265
the inode size cannot exceed one half of the filesystem block size.
267
XFS uses 64-bit inode numbers internally; however, the number of
268
significant bits in an inode number
269
is affected by filesystem geometry. In
270
practice, filesystem size and inode size are the predominant factors.
271
The Linux kernel and most applications cannot currently handle
272
inode numbers greater than 32 significant bits, so if no
273
inode size is given on the command line,
275
will attempt to choose a size
276
such that inode numbers will be < 32 bits. If an inode size
277
is specified, or if a filesystem is sufficently large,
279
will warn if this will create inode numbers > 32 significant
282
The option \f3maxpct=\f1\f2value\f1 specifies the maximum percentage
283
of space in the filesystem that can be allocated to inodes.
284
The default value is 25%.
285
Setting the value to 0 means that
286
essentially all of the filesystem can become inode blocks.
290
is used to specify that inode allocation is or is not aligned.
291
The value is either 0 or 1,
292
with 1 signifying that inodes are allocated aligned.
293
If the value is omitted, 1 is assumed.
294
The default is that inodes are aligned.
295
Aligned inode access is normally more efficient than unaligned access;
296
alignment must be established at the time the filesystem is created,
297
since inodes are allocated at that time.
298
This option can be used to turn off inode alignment when the
299
filesystem needs to be mountable by a version of IRIX
300
that does not have the inode alignment feature
301
(any release of IRIX before 6.2, and IRIX 6.2 without XFS patches).
306
These options specify the location, size, and other parameters of the
307
log section of the filesystem.
308
The valid suboptions are:
309
.BI internal[= value ]
311
\f3size=\f1\f2value\f1.
315
suboption is used to specify that the log section is a piece of
316
the data section instead of being another device or logical volume.
317
The suboption value is either 0 or 1,
318
with 1 signifying that the log is internal.
319
If the value is omitted, 1 is assumed.
323
suboption is used to specify the size of the log section.
325
If the log is contained within the data section and
329
will try to select a suitable log size depending
330
on the size of the filesystem. The actual logsize depends on the
331
filesystem block size and the directory block size.
335
option is only needed if the log section of the filesystem
336
should occupy less space than the size of the special file.
337
The size is specified in bytes or blocks, with a \f3b\f1 suffix
338
meaning multiplication by the filesystem block size, as described above.
339
The overriding minimum value for size is 512 blocks.
340
With some combinations of filesystem block size, inode size,
341
and directory block size, the minimum log size is larger than 512 blocks.
346
These options specify the version and size parameters for the naming
347
(directory) area of the filesystem.
348
The valid suboptions are:
349
\f3log=\f1\f2value\f1,
350
\f3size=\f1\f2value\f1,
352
\f3version=\f1\f2value\f1.
353
The naming (directory) version is 1 or 2,
354
defaulting to 2 if unspecified.
355
With version 2 directories,
356
the directory block size can be any power of 2 size
357
from the filesystem block size up to 65536.
358
The block size is specified either as a base two logarithm value with
362
The default size value for version 2 directories is 4096 bytes (4 KB),
363
unless the filesystem block size is larger than 4096,
364
in which case the default value is the filesystem block size.
365
For version 1 directories the block size is the same as the
366
filesystem block size.
368
\f3\-p\f1 \f2protofile\f1
377
and takes its directions from that file.
378
The blocks and inodes
381
are provided for backwards compatibility, but are otherwise unused.
383
contains tokens separated by spaces or
385
A sample prototype specification follows (line numbers have been added to
386
aid in the explanation):
390
\f71 /stand/\f1\f2diskboot\f1\f7
394
5 sh ---755 3 1 /bin/sh
400
11 slink l--644 3 1 /a/symbolic/link
401
12 : This is a comment line
407
Line 1 is a dummy string.
408
(It was formerly the bootfilename.)
409
It is present for backward
410
compatibility; boot blocks are not used on SGI systems.
412
Note that some string of characters must be present as the first line of
413
the proto file to cause it to be parsed correctly; the value
414
of this string is immaterial since it is ignored.
416
Line 2 contains two numeric values (formerly the numbers of blocks and inodes).
417
These are also merely for backward compatibility: two numeric values must
418
appear at this point for the proto file to be correctly parsed,
419
but their values are immaterial since they are ignored.
423
about files and directories to
424
be included in this filesystem.
425
Line 3 specifies the root directory.
426
Lines 4-6 and 8-10 specifies other directories and files.
427
Note the special symbolic link syntax on line 11.
433
to end the branch of the filesystem it is on, and continue
434
from the next higher directory.
435
It must be the last character
438
on line 12 introduces a comment; all characters up until the
439
following newline are ignored.
440
Note that this means you cannot
441
have a file in a prototype file whose name contains a colon.
444
on lines 13 and 14 end the process, since no additional
445
specifications follow.
447
File specifications give the mode,
450
and the initial contents of the file.
451
Valid syntax for the contents field
452
depends on the first character of the mode.
454
The mode for a file is specified by a 6-character string.
456
specifies the type of the file.
457
The character range is
459
to specify regular, block special,
460
character special, directory files, named pipes (fifos), and symbolic
462
The second character of the mode
467
to specify setuserID mode or not.
472
for the setgroupID mode.
474
is a three digit octal number giving the
475
owner, group, and other read, write, execute
480
tokens come after the mode; they specify the
481
user and group IDs of the owner of the file.
483
If the file is a regular file,
484
the next token of the specification can be a pathname
485
from which the contents and size are copied.
486
If the file is a block or character special file,
488
follow that give the major and minor device numbers.
489
If the file is a symbolic link, the next token of the specification
490
is used as the contents of the link.
491
If the file is a directory,
498
reads a list of names and
500
file specifications for the entries
502
As noted above, the scan is terminated with the
511
prints the parameters of the filesystem
515
flag suppresses this.
518
Real-time section options.
520
These options specify the location, size, and other parameters of the
521
real-time section of the filesystem.
522
The valid suboptions are:
525
\f3size=\f1\f2value\f1.
529
suboption is used to specify the size of the blocks in the real-time
530
section of the filesystem.
531
This size must be a multiple of the filesystem block size.
532
The minimum allowed value is the filesystem block size
533
or 4 KB (whichever is larger);
534
the default value is the stripe width for striped volumes or 64 KB for
536
the maximum allowed value is 1 GB.
537
The real-time extent size should be carefully chosen to match the
538
parameters of the physical media used.
542
suboption is used to specify the size of the real-time section.
543
This suboption is only needed if the real-time section of the
544
filesystem should occupy
545
less space than the size of the partition or logical volume containing the section.
548
Disable overlapping partition/volume checks.
550
By default \f2mkfs.xfs\f1 checks to see if the destination partition or logical
551
volume overlaps any mounted or reserved partitions in the system. If an
552
overlap or mount conflict is found, the user will be notified and prevented
553
from potentially corrupting the existing data. For systems with
554
a large number of disks, this additional checking may add noticable overhead
555
to the command's execution time. For situations where command performance is
556
necessary, this switch may be used to disable the safeguards. Due to the
557
potential for user-error causing corrupted filesystems or other on-disk
558
data corruption, we strongly discourage use of this switch in normal operation.
560
\f3\-L\f1 \f2label\f1
561
Set the filesystem label.
562
XFS filesystem labels can be at most 12 characters long; if
564
is longer than 12 characters,
566
will not proceed with creating the filesystem. Refer to the
570
manual entries for additional information.
576
With a prototype file, it is not possible to specify hard links.