1mkfs.xfs(8)                 System Manager's Manual                mkfs.xfs(8)
2
3
4

NAME

6       mkfs.xfs - construct an XFS filesystem
7

SYNOPSIS

9       mkfs.xfs  [ -b block_size_options ] [ -m global_metadata_options ] [ -d
10       data_section_options ] [ -f ]  [  -i  inode_options  ]  [  -l  log_sec‐
11       tion_options ] [ -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

DESCRIPTION

17       mkfs.xfs  constructs  an  XFS  filesystem  by writing on a special file
18       using the values found in the arguments of the  command  line.   It  is
19       invoked 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
46                     below).
47              b - multiply  by  filesystem  block  size  (default = 4K, see -b
48                     option 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 first needs to be added to the command
58       line.  Failure to specify the size of the units will result in  illegal
59       value errors when parameters are quantified in those units.
60
61       Many  feature  options allow an optional argument of 0 or 1, to explic‐
62       itly disable or enable the functionality.
63

OPTIONS

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

SEE ALSO

723       xfs(5), mkfs(8), mount(8), xfs_info(8), xfs_admin(8).
724

BUGS

726       With a prototype file, it is not possible to specify hard links.
727
728
729
730                                                                   mkfs.xfs(8)
Impressum