1mkfs.xfs(8) System Manager's Manual mkfs.xfs(8)
2
3
4
6 mkfs.xfs - construct an XFS filesystem
7
9 mkfs.xfs [ -b block_size_options ] [ -m global_metadata_options ] [ -d
10 data_section_options ] [ -f ] [ -i inode_options ] [ -l log_section_op‐
11 tions ] [ -n naming_options ] [ -p protofile ] [ -q ] [ -r real‐
12 time_section_options ] [ -s sector_size_options ] [ -L label ] [ -N ] [
13 -K ] device
14 mkfs.xfs -V
15
17 mkfs.xfs constructs an XFS filesystem by writing on a special file us‐
18 ing the values found in the arguments of the command line. It is in‐
19 voked automatically by mkfs(8) when it is given the -t xfs option.
20
21 In its simplest (and most commonly used form), the size of the filesys‐
22 tem is determined from the disk driver. As an example, to make a
23 filesystem with an internal log on the first partition on the first
24 SCSI disk, use:
25
26 mkfs.xfs /dev/sda1
27
28 The metadata log can be placed on another device to reduce the number
29 of disk seeks. To create a filesystem on the first partition on the
30 first SCSI disk with a 10MiB log located on the first partition on the
31 second SCSI disk, use:
32
33 mkfs.xfs -l logdev=/dev/sdb1,size=10m /dev/sda1
34
35 Each of the option elements in the argument list above can be given as
36 multiple comma-separated suboptions if multiple suboptions apply to the
37 same option. Equivalently, each main option can be given multiple
38 times with different suboptions. For example, -l internal,size=10m and
39 -l internal -l size=10m are equivalent.
40
41 In the descriptions below, sizes are given in sectors, bytes, blocks,
42 kilobytes, megabytes, gigabytes, etc. Sizes are treated as hexadecimal
43 if prefixed by 0x or 0X, octal if prefixed by 0, or decimal otherwise.
44 The following lists possible multiplication suffixes:
45 s - multiply by sector size (default = 512, see -s option be‐
46 low).
47 b - multiply by filesystem block size (default = 4K, see -b op‐
48 tion below).
49 k - multiply by one kilobyte (1,024 bytes).
50 m - multiply by one megabyte (1,048,576 bytes).
51 g - multiply by one gigabyte (1,073,741,824 bytes).
52 t - multiply by one terabyte (1,099,511,627,776 bytes).
53 p - multiply by one petabyte (1,024 terabytes).
54 e - multiply by one exabyte (1,048,576 terabytes).
55
56 When specifying parameters in units of sectors or filesystem blocks,
57 the -s option or the -b option may be used to specify the size of the
58 sector or block. If the size of the block or sector is not specified,
59 the default sizes (block: 4KiB, sector: 512B) will be used.
60
61 Many feature options allow an optional argument of 0 or 1, to explic‐
62 itly disable or enable the functionality.
63
65 Options may be specified either on the command line or in a configura‐
66 tion file. Not all command line options can be specified in configura‐
67 tion files; only the command line options followed by a [section] label
68 can be used in a configuration file.
69
70 Options that can be used in configuration files are grouped into re‐
71 lated sections containing multiple options. The command line options
72 and configuration files use the same option sections and grouping.
73 Configuration file section names are listed in the command line option
74 sections below. Option names and values are the same for both command
75 line and configuration file specification.
76
77 Options specified are the combined set of command line parameters and
78 configuration file parameters. Duplicated options will result in a re‐
79 specification error, regardless of the location they were specified at.
80
81 -c configuration_file_option
82 This option specifies the files that mkfs configuration will be
83 obtained from. The valid configuration_file_option is:
84
85 options=name
86 The configuration options will be sourced from the
87 file specified by the name option string. This op‐
88 tion can be use either an absolute or relative path
89 to the configuration file to be read.
90
91 -b block_size_options
92 Section Name: [block]
93 This option specifies the fundamental block size of the filesys‐
94 tem. The valid block_size_option is:
95
96 size=value
97 The filesystem block size is specified with a value
98 in bytes. The default value is 4096 bytes (4 KiB),
99 the minimum is 512, and the maximum is 65536 (64
100 KiB).
101
102 Although mkfs.xfs will accept any of these values
103 and create a valid filesystem, XFS on Linux can only
104 mount filesystems with pagesize or smaller blocks.
105
106 -m global_metadata_options
107 Section Name: [metadata]
108 These options specify metadata format options that either apply
109 to the entire filesystem or aren't easily characterised by a
110 specific functionality group. The valid global_metadata_options
111 are:
112
113 bigtime=value
114 This option enables filesystems that can handle in‐
115 ode timestamps from December 1901 to July 2486, and
116 quota timer expirations from January 1970 to July
117 2486. The value is either 0 to disable the feature,
118 or 1 to enable large timestamps.
119
120 If this feature is not enabled, the filesystem can
121 only handle timestamps from December 1901 to January
122 2038, and quota timers from January 1970 to February
123 2106.
124
125 By default, mkfs.xfs will not enable this feature.
126 If the option -m crc=0 is used, the large timestamp
127 feature is not supported and is disabled.
128
129 crc=value
130 This is used to create a filesystem which maintains
131 and checks CRC information in all metadata objects
132 on disk. The value is either 0 to disable the fea‐
133 ture, or 1 to enable the use of CRCs.
134
135 CRCs enable enhanced error detection due to hardware
136 issues, whilst the format changes also improves
137 crash recovery algorithms and the ability of various
138 tools to validate and repair metadata corruptions
139 when they are found. The CRC algorithm used is
140 CRC32c, so the overhead is dependent on CPU archi‐
141 tecture as some CPUs have hardware acceleration of
142 this algorithm. Typically the overhead of calculat‐
143 ing and checking the CRCs is not noticeable in nor‐
144 mal operation.
145
146 By default, mkfs.xfs will enable metadata CRCs.
147
148 Formatting a filesystem without CRCs selects the V4
149 format, which is deprecated and will be removed from
150 upstream in September 2030. Distributors may choose
151 to withdraw support for the V4 format earlier than
152 this date. Several other options, noted below, are
153 only tunable on V4 formats, and will be removed
154 along with the V4 format itself.
155
156 finobt=value
157 This option enables the use of a separate free inode
158 btree index in each allocation group. The value is
159 either 0 to disable the feature, or 1 to create a
160 free inode btree in each allocation group.
161
162 The free inode btree mirrors the existing allocated
163 inode btree index which indexes both used and free
164 inodes. The free inode btree does not index used in‐
165 odes, allowing faster, more consistent inode alloca‐
166 tion performance as filesystems age.
167
168 By default, mkfs.xfs will create free inode btrees
169 for filesystems created with the (default) -m crc=1
170 option set. When the option -m crc=0 is used, the
171 free inode btree feature is not supported and is
172 disabled.
173
174 inobtcount=value
175 This option causes the filesystem to record the num‐
176 ber of blocks used by the inode btree and the free
177 inode btree. This can be used to reduce mount times
178 when the free inode btree is enabled.
179
180 By default, mkfs.xfs will not enable this option.
181 This feature is only available for filesystems cre‐
182 ated with the (default) -m finobt=1 option set.
183 When the option -m finobt=0 is used, the inode btree
184 counter feature is not supported and is disabled.
185
186 uuid=value
187 Use the given value as the filesystem UUID for the
188 newly created filesystem. The default is to gener‐
189 ate a random UUID.
190
191 rmapbt=value
192 This option enables the creation of a reverse-map‐
193 ping btree index in each allocation group. The
194 value is either 0 to disable the feature, or 1 to
195 create the btree.
196
197 The reverse mapping btree maps filesystem blocks to
198 the owner of the filesystem block. Most of the map‐
199 pings will be to an inode number and an offset,
200 though there will also be mappings to filesystem
201 metadata. This secondary metadata can be used to
202 validate the primary metadata or to pinpoint exactly
203 which data has been lost when a disk error occurs.
204
205 By default, mkfs.xfs will not create reverse mapping
206 btrees. This feature is only available for filesys‐
207 tems created with the (default) -m crc=1 option set.
208 When the option -m crc=0 is used, the reverse map‐
209 ping btree feature is not supported and is disabled.
210
211 reflink=value
212 This option enables the use of a separate reference
213 count btree index in each allocation group. The
214 value is either 0 to disable the feature, or 1 to
215 create a reference count btree in each allocation
216 group.
217
218 The reference count btree enables the sharing of
219 physical extents between the data forks of different
220 files, which is commonly known as "reflink". Unlike
221 traditional Unix filesystems which assume that every
222 inode and logical block pair map to a unique physi‐
223 cal block, a reflink-capable XFS filesystem removes
224 the uniqueness requirement, allowing up to four bil‐
225 lion arbitrary inode/logical block pairs to map to a
226 physical block. If a program tries to write to a
227 multiply-referenced block in a file, the write will
228 be redirected to a new block, and that file's logi‐
229 cal-to-physical mapping will be changed to the new
230 block ("copy on write"). This feature enables the
231 creation of per-file snapshots and deduplication.
232 It is only available for the data forks of regular
233 files.
234
235 By default, mkfs.xfs will create reference count
236 btrees and therefore will enable the reflink fea‐
237 ture. This feature is only available for filesys‐
238 tems created with the (default) -m crc=1 option set.
239 When the option -m crc=0 is used, the reference
240 count btree feature is not supported and reflink is
241 disabled.
242
243 Note: the filesystem DAX mount option ( -o dax ) is
244 incompatible with reflink-enabled XFS filesystems.
245 To use filesystem DAX with XFS, specify the -m re‐
246 flink=0 option to mkfs.xfs to disable the reflink
247 feature.
248
249 -d data_section_options
250 Section Name: [data]
251 These options specify the location, size, and other parameters
252 of the data section of the filesystem. The valid data_sec‐
253 tion_options are:
254
255 agcount=value
256 This is used to specify the number of allocation
257 groups. The data section of the filesystem is di‐
258 vided into allocation groups to improve the perfor‐
259 mance of XFS. More allocation groups imply that more
260 parallelism can be achieved when allocating blocks
261 and inodes. The minimum allocation group size is 16
262 MiB; the maximum size is just under 1 TiB. The data
263 section of the filesystem is divided into value al‐
264 location groups (default value is scaled automati‐
265 cally based on the underlying device size).
266
267 agsize=value
268 This is an alternative to using the agcount subop‐
269 tion. The value is the desired size of the alloca‐
270 tion group expressed in bytes (usually using the m
271 or g suffixes). This value must be a multiple of
272 the filesystem block size, and must be at least
273 16MiB, and no more than 1TiB, and may be automati‐
274 cally adjusted to properly align with the stripe ge‐
275 ometry. The agcount and agsize suboptions are mutu‐
276 ally exclusive.
277
278 cowextsize=value
279 Set the copy-on-write extent size hint on all inodes
280 created by mkfs.xfs. The value must be provided in
281 units of filesystem blocks. If the value is zero,
282 the default value (currently 32 blocks) will be
283 used. Directories will pass on this hint to newly
284 created regular files and directories.
285
286 name=value
287 This can be used to specify the name of the special
288 file containing the filesystem. In this case, the
289 log section must be specified as internal (with a
290 size, see the -l option below) and there can be no
291 real-time section.
292
293 file[=value]
294 This is used to specify that the file given by the
295 name suboption is a regular file. The value is ei‐
296 ther 0 or 1, with 1 signifying that the file is reg‐
297 ular. This suboption is used only to make a filesys‐
298 tem image. If the value is omitted then 1 is as‐
299 sumed.
300
301 size=value
302 This is used to specify the size of the data sec‐
303 tion. This suboption is required if -d file[=1] is
304 given. Otherwise, it is only needed if the filesys‐
305 tem should occupy less space than the size of the
306 special file.
307
308 sunit=value
309 This is used to specify the stripe unit for a RAID
310 device or a logical volume. The value has to be
311 specified in 512-byte block units. Use the su subop‐
312 tion to specify the stripe unit size in bytes. This
313 suboption ensures that data allocations will be
314 stripe unit aligned when the current end of file is
315 being extended and the file size is larger than
316 512KiB. Also inode allocations and the internal log
317 will be stripe unit aligned.
318
319 su=value
320 This is an alternative to using sunit. The su sub‐
321 option is used to specify the stripe unit for a RAID
322 device or a striped logical volume. The value has to
323 be specified in bytes, (usually using the m or g
324 suffixes). This value must be a multiple of the
325 filesystem block size.
326
327 swidth=value
328 This is used to specify the stripe width for a RAID
329 device or a striped logical volume. The value has to
330 be specified in 512-byte block units. Use the sw
331 suboption to specify the stripe width size in bytes.
332 This suboption is required if -d sunit has been
333 specified and it has to be a multiple of the -d
334 sunit suboption.
335
336 sw=value
337 suboption is an alternative to using swidth. The sw
338 suboption is used to specify the stripe width for a
339 RAID device or striped logical volume. The value is
340 expressed as a multiplier of the stripe unit, usu‐
341 ally the same as the number of stripe members in the
342 logical volume configuration, or data disks in a
343 RAID device.
344
345 When a filesystem is created on a logical volume de‐
346 vice, mkfs.xfs will automatically query the logical
347 volume for appropriate sunit and swidth values.
348
349 noalign
350 This option disables automatic geometry detection
351 and creates the filesystem without stripe geometry
352 alignment even if the underlying storage device pro‐
353 vides this information.
354
355 rtinherit=value
356 If value is set to 1, all inodes created by mkfs.xfs
357 will be created with the realtime flag set. The de‐
358 fault is 0. Directories will pass on this flag to
359 newly created regular files and directories.
360
361 projinherit=value
362 All inodes created by mkfs.xfs will be assigned the
363 project quota id provided in value. Directories
364 will pass on the project id to newly created regular
365 files and directories.
366
367 extszinherit=value
368 All inodes created by mkfs.xfs will have this value
369 extent size hint applied. The value must be pro‐
370 vided in units of filesystem blocks. Directories
371 will pass on this hint to newly created regular
372 files and directories.
373
374 daxinherit=value
375 If value is set to 1, all inodes created by mkfs.xfs
376 will be created with the DAX flag set. The default
377 is 0. Directories will pass on this flag to newly
378 created regular files and directories. By default,
379 mkfs.xfs will not enable DAX mode.
380
381 -f Force overwrite when an existing filesystem is detected on the
382 device. By default, mkfs.xfs will not write to the device if it
383 suspects that there is a filesystem or partition table on the
384 device already.
385
386 -i inode_options
387 Section Name: [inode]
388 This option specifies the inode size of the filesystem, and
389 other inode allocation parameters. The XFS inode contains a
390 fixed-size part and a variable-size part. The variable-size
391 part, whose size is affected by this option, can contain: direc‐
392 tory data, for small directories; attribute data, for small at‐
393 tribute sets; symbolic link data, for small symbolic links; the
394 extent list for the file, for files with a small number of ex‐
395 tents; and the root of a tree describing the location of extents
396 for the file, for files with a large number of extents.
397
398 The valid inode_options are:
399
400 size=value | perblock=value
401 The inode size is specified either as a value in
402 bytes with size= or as the number fitting in a
403 filesystem block with perblock=. The minimum (and
404 default) value is 256 bytes without crc, 512 bytes
405 with crc enabled. The maximum value is 2048 (2 KiB)
406 subject to the restriction that the inode size can‐
407 not exceed one half of the filesystem block size.
408
409 XFS uses 64-bit inode numbers internally; however,
410 the number of significant bits in an inode number is
411 affected by filesystem geometry. In practice,
412 filesystem size and inode size are the predominant
413 factors. The Linux kernel (on 32 bit hardware plat‐
414 forms) and most applications cannot currently handle
415 inode numbers greater than 32 significant bits, so
416 if no inode size is given on the command line,
417 mkfs.xfs will attempt to choose a size such that in‐
418 ode numbers will be < 32 bits. If an inode size is
419 specified, or if a filesystem is sufficiently large,
420 mkfs.xfs will warn if this will create inode numbers
421 > 32 significant bits.
422
423 maxpct=value
424 This specifies the maximum percentage of space in
425 the filesystem that can be allocated to inodes. The
426 default value is 25% for filesystems under 1TB, 5%
427 for filesystems under 50TB and 1% for filesystems
428 over 50TB.
429
430 In the default inode allocation mode, inode blocks
431 are chosen such that inode numbers will not exceed
432 32 bits, which restricts the inode blocks to the
433 lower portion of the filesystem. The data block al‐
434 locator will avoid these low blocks to accommodate
435 the specified maxpct, so a high value may result in
436 a filesystem with nothing but inodes in a signifi‐
437 cant portion of the lower blocks of the filesystem.
438 (This restriction is not present when the filesystem
439 is mounted with the inode64 option on 64-bit plat‐
440 forms).
441
442 Setting the value to 0 means that essentially all of
443 the filesystem can become inode blocks, subject to
444 inode32 restrictions.
445
446 This value can be modified with xfs_growfs(8).
447
448 align[=value]
449 This is used to specify that inode allocation is or
450 is not aligned. The value is either 0 or 1, with 1
451 signifying that inodes are allocated aligned. If
452 the value is omitted, 1 is assumed. The default is
453 that inodes are aligned. Aligned inode access is
454 normally more efficient than unaligned access;
455 alignment must be established at the time the
456 filesystem is created, since inodes are allocated at
457 that time. This option can be used to turn off in‐
458 ode alignment when the filesystem needs to be mount‐
459 able by a version of IRIX that does not have the in‐
460 ode alignment feature (any release of IRIX before
461 6.2, and IRIX 6.2 without XFS patches).
462
463 This option is only tunable on the deprecated V4
464 format.
465
466 attr=value
467 This is used to specify the version of extended at‐
468 tribute inline allocation policy to be used. By de‐
469 fault, this is 2, which uses an efficient algorithm
470 for managing the available inline inode space be‐
471 tween attribute and extent data.
472
473 The previous version 1, which has fixed regions for
474 attribute and extent data, is kept for backwards
475 compatibility with kernels older than version
476 2.6.16.
477
478 This option is only tunable on the deprecated V4
479 format.
480
481 projid32bit[=value]
482 This is used to enable 32bit quota project identi‐
483 fiers. The value is either 0 or 1, with 1 signifying
484 that 32bit projid are to be enabled. If the value
485 is omitted, 1 is assumed. (This default changed in
486 release version 3.2.0.)
487
488 This option is only tunable on the deprecated V4
489 format.
490
491 sparse[=value]
492 Enable sparse inode chunk allocation. The value is
493 either 0 or 1, with 1 signifying that sparse alloca‐
494 tion is enabled. If the value is omitted, 1 is as‐
495 sumed. Sparse inode allocation is disabled by de‐
496 fault. This feature is only available for filesys‐
497 tems formatted with -m crc=1.
498
499 When enabled, sparse inode allocation allows the
500 filesystem to allocate smaller than the standard
501 64-inode chunk when free space is severely limited.
502 This feature is useful for filesystems that might
503 fragment free space over time such that no free ex‐
504 tents are large enough to accommodate a chunk of 64
505 inodes. Without this feature enabled, inode alloca‐
506 tions can fail with out of space errors under severe
507 fragmented free space conditions.
508
509 -l log_section_options
510 Section Name: [log]
511 These options specify the location, size, and other parameters
512 of the log section of the filesystem. The valid log_section_op‐
513 tions are:
514
515 agnum=value
516 If the log is internal, allocate it in this AG.
517
518 internal[=value]
519 This is used to specify that the log section is a
520 piece of the data section instead of being another
521 device or logical volume. The value is either 0 or
522 1, with 1 signifying that the log is internal. If
523 the value is omitted, 1 is assumed.
524
525 logdev=device
526 This is used to specify that the log section should
527 reside on the device separate from the data section.
528 The internal=1 and logdev options are mutually ex‐
529 clusive.
530
531 size=value
532 This is used to specify the size of the log section.
533
534 If the log is contained within the data section and
535 size isn't specified, mkfs.xfs will try to select a
536 suitable log size depending on the size of the
537 filesystem. The actual logsize depends on the
538 filesystem block size and the directory block size.
539
540 Otherwise, the size suboption is only needed if the
541 log section of the filesystem should occupy less
542 space than the size of the special file. The value
543 is specified in bytes or blocks, with a b suffix
544 meaning multiplication by the filesystem block size,
545 as described above. The overriding minimum value for
546 size is 512 blocks. With some combinations of
547 filesystem block size, inode size, and directory
548 block size, the minimum log size is larger than 512
549 blocks.
550
551 version=value
552 This specifies the version of the log. The current
553 default is 2, which allows for larger log buffer
554 sizes, as well as supporting stripe-aligned log
555 writes (see the sunit and su options, below).
556
557 The previous version 1, which is limited to 32k log
558 buffers and does not support stripe-aligned writes,
559 is kept for backwards compatibility with very old
560 2.4 kernels.
561
562 This option is only tunable on the deprecated V4
563 format.
564
565 sunit=value
566 This specifies the alignment to be used for log
567 writes. The value has to be specified in 512-byte
568 block units. Use the su suboption to specify the log
569 stripe unit size in bytes. Log writes will be
570 aligned on this boundary, and rounded up to this
571 boundary. This gives major improvements in perfor‐
572 mance on some configurations such as software RAID5
573 when the sunit is specified as the filesystem block
574 size. The equivalent byte value must be a multiple
575 of the filesystem block size. Version 2 logs are au‐
576 tomatically selected if the log sunit suboption is
577 specified.
578
579 The su suboption is an alternative to using sunit.
580
581 su=value
582 This is used to specify the log stripe. The value
583 has to be specified in bytes, (usually using the s
584 or b suffixes). This value must be a multiple of the
585 filesystem block size. Version 2 logs are automati‐
586 cally selected if the log su suboption is specified.
587
588 lazy-count=value
589 This changes the method of logging various persis‐
590 tent counters in the superblock. Under metadata in‐
591 tensive workloads, these counters are updated and
592 logged frequently enough that the superblock updates
593 become a serialization point in the filesystem. The
594 value can be either 0 or 1.
595
596 With lazy-count=1, the superblock is not modified or
597 logged on every change of the persistent counters.
598 Instead, enough information is kept in other parts
599 of the filesystem to be able to maintain the persis‐
600 tent counter values without needed to keep them in
601 the superblock. This gives significant improvements
602 in performance on some configurations. The default
603 value is 1 (on) so you must specify lazy-count=0 if
604 you want to disable this feature for older kernels
605 which don't support it.
606
607 This option is only tunable on the deprecated V4
608 format.
609
610 -n naming_options
611 Section Name: [naming]
612 These options specify the version and size parameters for the
613 naming (directory) area of the filesystem. The valid naming_op‐
614 tions are:
615
616 size=value
617 The directory block size is specified with a value
618 in bytes. The block size must be a power of 2 and
619 cannot be less than the filesystem block size. The
620 default size value for version 2 directories is 4096
621 bytes (4 KiB), unless the filesystem block size is
622 larger than 4096, in which case the default value is
623 the filesystem block size. For version 1 directo‐
624 ries the block size is the same as the filesystem
625 block size.
626
627 version=value
628 The naming (directory) version value can be either 2
629 or 'ci', defaulting to 2 if unspecified. With ver‐
630 sion 2 directories, the directory block size can be
631 any power of 2 size from the filesystem block size
632 up to 65536.
633
634 The version=ci option enables ASCII only case-insen‐
635 sitive filename lookup and version 2 directories.
636 Filenames are case-preserving, that is, the names
637 are stored in directories using the case they were
638 created with.
639
640 Note: Version 1 directories are not supported.
641
642 ftype=value
643 This feature allows the inode type to be stored in
644 the directory structure so that the readdir(3) and
645 getdents(2) do not need to look up the inode to de‐
646 termine the inode type.
647
648 The value is either 0 or 1, with 1 signifying that
649 filetype information will be stored in the directory
650 structure. The default value is 1.
651
652 When CRCs are enabled (the default), the ftype func‐
653 tionality is always enabled, and cannot be turned
654 off.
655
656 In other words, this option is only tunable on the
657 deprecated V4 format.
658
659 -p protofile
660 If the optional -p protofile argument is given, mkfs.xfs uses
661 protofile as a prototype file and takes its directions from that
662 file. The blocks and inodes specifiers in the protofile are
663 provided for backwards compatibility, but are otherwise unused.
664 The syntax of the protofile is defined by a number of tokens
665 separated by spaces or newlines. Note that the line numbers are
666 not part of the syntax but are meant to help you in the follow‐
667 ing discussion of the file contents.
668
669 1 /stand/diskboot
670 2 4872 110
671 3 d--777 3 1
672 4 usr d--777 3 1
673 5 sh ---755 3 1 /bin/sh
674 6 ken d--755 6 1
675 7 $
676 8 b0 b--644 3 1 0 0
677 9 c0 c--644 3 1 0 0
678 10 fifo p--644 3 1
679 11 slink l--644 3 1 /a/symbolic/link
680 12 : This is a comment line
681 13 $
682 14 $
683
684 Line 1 is a dummy string. (It was formerly the bootfilename.)
685 It is present for backward compatibility; boot blocks are not
686 used on SGI systems.
687
688 Note that some string of characters must be present as the first
689 line of the proto file to cause it to be parsed correctly; the
690 value of this string is immaterial since it is ignored.
691
692 Line 2 contains two numeric values (formerly the numbers of
693 blocks and inodes). These are also merely for backward compati‐
694 bility: two numeric values must appear at this point for the
695 proto file to be correctly parsed, but their values are immate‐
696 rial since they are ignored.
697
698 The lines 3 through 11 specify the files and directories you
699 want to include in this filesystem. Line 3 defines the root di‐
700 rectory. Other directories and files that you want in the
701 filesystem are indicated by lines 4 through 6 and lines 8
702 through 10. Line 11 contains symbolic link syntax.
703
704 Notice the dollar sign ($) syntax on line 7. This syntax directs
705 the mkfs.xfs command to terminate the branch of the filesystem
706 it is currently on and then continue from the directory speci‐
707 fied by the next line, in this case line 8. It must be the last
708 character on a line. The colon on line 12 introduces a comment;
709 all characters up until the following newline are ignored. Note
710 that this means you cannot have a file in a prototype file whose
711 name contains a colon. The $ on lines 13 and 14 end the
712 process, since no additional specifications follow.
713
714 File specifications provide the following:
715
716 * file mode
717 * user ID
718 * group ID
719 * the file's beginning contents
720
721 A 6-character string defines the mode for a file. The first
722 character of this string defines the file type. The character
723 range for this first character is -bcdpl. A file may be a regu‐
724 lar file, a block special file, a character special file, direc‐
725 tory files, named pipes (first-in, first out files), and sym‐
726 bolic links. The second character of the mode string is used to
727 specify setuserID mode, in which case it is u. If setuserID
728 mode is not specified, the second character is -. The third
729 character of the mode string is used to specify the setgroupID
730 mode, in which case it is g. If setgroupID mode is not speci‐
731 fied, the third character is -. The remaining characters of the
732 mode string are a three digit octal number. This octal number
733 defines the owner, group, and other read, write, and execute
734 permissions for the file, respectively. For more information on
735 file permissions, see the chmod(1) command.
736
737 Following the mode character string are two decimal number to‐
738 kens that specify the user and group IDs of the file's owner.
739
740 In a regular file, the next token specifies the pathname from
741 which the contents and size of the file are copied. In a block
742 or character special file, the next token are two decimal num‐
743 bers that specify the major and minor device numbers. When a
744 file is a symbolic link, the next token specifies the contents
745 of the link.
746
747 When the file is a directory, the mkfs.xfs command creates the
748 entries dot (.) and dot-dot (..) and then reads the list of
749 names and file specifications in a recursive manner for all of
750 the entries in the directory. A scan of the protofile is always
751 terminated with the dollar ( $ ) token.
752
753 -q Quiet option. Normally mkfs.xfs prints the parameters of the
754 filesystem to be constructed; the -q flag suppresses this.
755
756 -r realtime_section_options
757 Section Name: [realtime]
758 These options specify the location, size, and other parameters
759 of the real-time section of the filesystem. The valid real‐
760 time_section_options are:
761
762 rtdev=device
763 This is used to specify the device which should con‐
764 tain the real-time section of the filesystem. The
765 suboption value is the name of a block device.
766
767 extsize=value
768 This is used to specify the size of the blocks in
769 the real-time section of the filesystem. This value
770 must be a multiple of the filesystem block size. The
771 minimum allowed size is the filesystem block size or
772 4 KiB (whichever is larger); the default size is the
773 stripe width for striped volumes or 64 KiB for non-
774 striped volumes; the maximum allowed size is 1 GiB.
775 The real-time extent size should be carefully chosen
776 to match the parameters of the physical media used.
777
778 size=value
779 This is used to specify the size of the real-time
780 section. This suboption is only needed if the real-
781 time section of the filesystem should occupy less
782 space than the size of the partition or logical vol‐
783 ume containing the section.
784
785 noalign
786 This option disables stripe size detection, enforc‐
787 ing a realtime device with no stripe geometry.
788
789 -s sector_size_options
790 Section Name: [sector]
791 This option specifies the fundamental sector size of the
792 filesystem. The valid sector_size_option is:
793
794 size=value
795 The sector size is specified with a value in bytes.
796 The default sector_size is 512 bytes. The minimum
797 value for sector size is 512; the maximum is 32768
798 (32 KiB). The sector_size must be a power of 2 size
799 and cannot be made larger than the filesystem block
800 size.
801
802 -L label
803 Set the filesystem label. XFS filesystem labels can be at most
804 12 characters long; if label is longer than 12 characters,
805 mkfs.xfs will not proceed with creating the filesystem. Refer
806 to the mount(8) and xfs_admin(8) manual entries for additional
807 information.
808
809 -N Causes the file system parameters to be printed out without re‐
810 ally creating the file system.
811
812 -K Do not attempt to discard blocks at mkfs time.
813
814 -V Prints the version number and exits.
815
817 The configuration file uses a basic INI format to specify sections and
818 options within a section. Section and option names are case sensitive.
819 Section names must not contain whitespace. Options are name-value
820 pairs, ended by the first whitespace in the line. Option names cannot
821 contain whitespace. Full line comments can be added by starting a line
822 with a # symbol. If values contain whitespace, then it must be quoted.
823
824 The following example configuration file sets the block size to 4096
825 bytes, turns on reverse mapping btrees and sets the inode size to 2048
826 bytes.
827
828 # Example mkfs.xfs configuration file
829
830 [block]
831 size=4k
832
833 [metadata]
834 rmapbt=1
835
836 [inode]
837 size=2048
838
839
841 xfs(5), mkfs(8), mount(8), xfs_info(8), xfs_admin(8).
842
844 With a prototype file, it is not possible to specify hard links.
845
846
847
848 mkfs.xfs(8)