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

SEE ALSO

729       xfs(5), mkfs(8), mount(8), xfs_info(8), xfs_admin(8).
730

BUGS

732       With a prototype file, it is not possible to specify hard links.
733
734
735
736                                                                   mkfs.xfs(8)
Impressum