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 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

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

SEE ALSO

719       xfs(5), mkfs(8), mount(8), xfs_info(8), xfs_admin(8).
720

BUGS

722       With a prototype file, it is not possible to specify hard links.
723
724
725
726                                                                   mkfs.xfs(8)
Impressum