mkfs_xfs(1M)                                                      mkfs_xfs(1M)


NAME
     mkfs_xfs - construct an XFS filesystem

SYNOPSIS
     mkfs_xfs [ -b subopt=value ] [ -d subopt[=value] ] [ -i subopt=value ]
          [ -l subopt[=value] ] [ -n subopt[=value] ] [ -p protofile ] [ -q ]
          [ -r subopt[=value] ] [ -C ] device

DESCRIPTION
     mkfs_xfs constructs an XFS filesystem by writing on a special file using
     the values found in the arguments of the command line.  It is invoked
     automatically by mkfs(1M) when mkfs is given the -t xfs option, options
     that are specific to XFS, or no options that are specific to EFS.

     In its simplest (and most commonly used form), the size of the filesystem
     is determined from the disk driver.  As an example, to make a filesystem
     on partition 7 (all of the useable portion of an option drive, normally)
     on drive 7 on SCSI bus 0, with an internal log, use:

               mkfs_xfs /dev/dsk/dks0d7s7


     XFS filesystems are composed of a data section, a log section, and
     optionally a real-time section.  This separation can be accomplished
     using the XLV/XVM volume manager to create a multi-subvolume volume, or
     by embedding an internal log section in the data section.  In the former
     case, the device name is supplied as the final argument.  In the latter
     case a disk partition or XLV/XVM logical volume without a log subvolume
     can contain the XFS filesystem, which is named by the -d name=special
     option or by the final argument.

     Each of the subopt=value elements in the argument list above can be given
     as multiple comma-separated subopt=value suboptions if multiple
     suboptions apply to the same option.  Equivalently, each main option can
     be given multiple times with different suboptions.  For example, -l
     internal,size=1000b and -l internal -l size=1000b are equivalent.

     In the descriptions below, sizes are given in bytes, blocks, kilobytes,
     or megabytes.  Sizes are treated as hexadecimal if prefixed by 0x or 0X,
     octal if prefixed by 0, or decimal otherwise.  If suffixed with b then
     the size is converted by multiplying it by the filesystem's block size.
     If suffixed with k then the size is converted by multiplying it by 1024.
     If suffixed with m then the size is converted by multiplying it by
     1048576 (1024 * 1024).  If suffixed with g then the size is converted by
     multiplying it by 1073741824 (1024 * 1024 * 1024).

     -b   Block size options.

          This option specifies the fundamental block size of the filesystem.
          The valid suboptions are:  log=value and size=value; only one can be
          supplied.  The block size is specified either as a base two
          logarithm value with log=, or in bytes with size=.  The default


          value is 4096 bytes (4 KB).  The minimum value for block size is
          512; the maximum is 65536 (64 KB).

     -d   Data section options.

          These options specify the location, size, and other parameters of
          the data section of the filesystem.  The valid suboptions are:
          agcount=value, agsize=value, file[=value], largeag[=value],
          name=value, size=value, sunit=value, swidth=value, su=value,
          sw=value, and unwritten[=value].

          The agcount suboption is used to specify the number of allocation
          groups.  The data section of the filesystem is divided into
          allocation groups to improve the performance of XFS.  More
          allocation groups imply that more parallelism can be achieved when
          allocating blocks and inodes.  The minimum allocation group size is
          16 MB; the maximum size is just under 4 GB.  The data section of the
          filesystem is divided into agcount allocation groups (default value
          8, unless the filesystem is smaller than 128 MB or larger than 8
          GB).  Setting agcount to a very large number should be avoided,
          since this causes an unreasonable amount of CPU time to be used when
          the filesystem is close to full.

          The agsize suboption is an alternative to using agcount. The
          argument provided to agsize is the desired size of the allocation
          group expressed in bytes (usually using the m or g suffixes).  This
          value must be a multiple of the filesystem block size, and must be
          at least 16MB, and no more than 4GB, and may be automatically
          adjusted to properly align with the stripe geometry.  The agcount
          suboption and the agsize suboption are mutually exclusive.

          The name suboption can be used to specify the name of the special
          file containing the filesystem.  In this case, the log section must
          be specified as internal (with a size, see the -l option below) and
          there can be no real-time section.  Either the block or character
          special device can be supplied.  An XLV/XVM logical volume with a
          log subvolume cannot be supplied here.  Note that the default log in
          this case is an internal log with at least 1000 blocks, actual size
          depending on the filesystem block size and the directory block size.

          The file suboption is used to specify that the file given by the
          name suboption is a regular file.  The suboption value is either 0
          or 1, with 1 signifying that the file is regular.  This suboption is
          used only to make a filesystem image (for instance, a miniroot
          image).  If the value is omitted then 1 is assumed.

          The size suboption is used to specify the size of the data section.
          This suboption is required if -d file[=1] is given.  Otherwise, it
          is only needed if the filesystem should occupy less space than the
          size of the special file.


          The largeag suboption is used to change the default allocation group
          size from a maximum of 4GB to 1TB.  It is better to use large AGs on
          multi-terabyte filesystems.

          The sunit suboption is used to specify the stripe unit for a RAID
          device or XLV/XVM striped volume.  The suboption value has to be
          specified in 512-byte block units.  Use the su suboption to specify
          the stripe unit size in bytes.  This suboption ensures that data
          allocations will be stripe unit aligned when the current end of file
          is being extended and the file size is larger than the specified
          stripe unit size.  Also inode allocations and the internal log will
          be stripe unit aligned.

          The su suboption is an alternative to using sunit. The su suboption
          is used to specify the stripe unit for a RAID device or XLV/XVM
          striped volume.  The suboption value has to be specified in bytes,
          (usually using the m or g suffixes).  This value must be a multiple
          of the filesystem block size.

          The swidth suboption is used to specify the stripe width for a RAID
          device or XLV/XVM striped volume.  The suboption value has to be
          specified in 512-byte block units.  Use the sw suboption to specify
          the stripe width size in bytes.  This suboption is required if -d
          sunit has been specified and it has to be a multiple of the -d sunit
          suboption.  The stripe width will be the preferred iosize returned
          in the stat system call.

          The sw suboption is an alternative to using swidth. The sw suboption
          is used to specify the stripe width for a RAID device or XLV/XVM
          striped volume.  The suboption value is expressed as a multiplier of
          the stripe unit, usually the same as the number of stripe members in
          the XLV/XVM configuration, or data disks in a RAID device.

          The unwritten suboption is used to specify whether unwritten extents
          are flagged as such, or not.  The suboption value is either 0 or 1,
          with 1 signifying that unwritten extent flagging should occur.  If
          the suboption is omitted, unwritten extent flagging is enabled.  If
          unwritten extents are flagged, filesystem write performance will be
          negatively affected for preallocated file extents, since extra
          filesystem transactions are required to convert extent flags for the
          range of the file written.  This suboption should be disabled if the
          filesystem needs to be used on operating system versions which do
          not support the flagging capability.

     -i   Inode options.

          This option specifies the inode size of the filesystem, and other
          inode allocation parameters.  The XFS inode contains a fixed-size
          part and a variable-size part.  The variable-size part, whose size
          is affected by this option, can contain:  directory data, for small
          directories; attribute data, for small attribute sets; symbolic link
          data, for small symbolic links; the extent list for the file, for


          files with a small number of extents; and the root of a tree
          describing the location of extents for the file, for files with a
          large number of extents.

          The valid suboptions for specifying inode size are:  log=value,
          perblock=value, and size=value; only one can be supplied.  The inode
          size is specified either as a base two logarithm value with log=, in
          bytes with size=, or as the number fitting in a filesystem block
          with perblock=.  The mininum (and default) value is 256 bytes.  The
          maximum value is 2048 (2 KB) subject to the restriction that the
          inode size cannot exceed one half of the filesystem block size.

          The option maxpct=value specifies the maximum percentage of space in
          the filesystem that can be allocated to inodes.  The default value
          is 25%.  Setting the value to 0 means that essentially all of the
          filesystem can become inode blocks.

          The option align[=value] is used to specify that inode allocation is
          or is not aligned.  The value is either 0 or 1, with 1 signifying
          that inodes are allocated aligned.  If the value is omitted, 1 is
          assumed.  The default is that inodes are aligned.  Aligned inode
          access is normally more efficient than unaligned access; alignment
          must be established at the time the filesystem is created, since
          inodes are allocated at that time.  This option can be used to turn
          off inode alignment when the filesystem needs to be mountable by a
          version of IRIX that does not have the inode alignment feature (any
          release of IRIX before 6.2, and IRIX 6.2 without XFS patches).

          The option attr[=value] is used to specify the version of extended
          attribute inline allocation policy to be used.  By default, this is
          zero.  Once extended attributes are used for the first time, the
          version will be set to either one or two.  The current version (two)
          uses a more efficient algorithm for managing the available inline
          inode space than version one does, however, for backward
          compatibility reasons (and in the absence of the attr=2 mkfs option,
          or the attr2 mount option), version one will be selected by default
          when attributes are first used on a filesystem.

          The option parent[=value] is used to specify that links to the
          inode's parents and associated directory entry names are stored.
          The value is either 0 or 1, with 1 turning this feature on and 0
          turning this feature off.  The default value is 0.  This option can
          be used to map inodes to paths without requiring the search of
          directories to find the inode.

     -l   Log section options.

          These options specify the location, size, and other parameters of
          the log section of the filesystem.  The valid suboptions are:
          internal[=value], size=value, version=[1|2], sunit=value, su=value
          and lazy-count=[0|1].


          The internal suboption is used to specify that the log section is a
          piece of the data section instead of being a separate part of an
          XLV/XVM logical volume.  The suboption value is either 0 or 1, with
          1 signifying that the log is internal.  If the value is omitted, 1
          is assumed.

          The size suboption is used to specify the size of the log section.
          This suboption is required if -l internal[=1] is given.  Otherwise,
          it is only needed if the log section of the filesystem should occupy
          less space than the size of the special file.  The size is specified
          in bytes or blocks, with a b suffix meaning multiplication by the
          filesystem block size, as described above.  The overriding minimum
          value for size is 512 blocks.  With some combinations of filesystem
          block size, inode size, and directory block size, the minimum log
          size is larger than 512 blocks.

          For a filesystem which is not contained in an XLV/XVM logical volume
          with a log subvolume, the default is to make an internal log 1000
          blocks long, or longer with some combinations of filesystem block
          size, inode size, and directory block size.

          For a filesystem which is contained in a XLV/XVM striped logical
          volume, the default internal log size is rounded up to a multiple of
          the data stripe unit size.  If a log stripe unit is specified, then
          the log size is rounded up to a multiple of the log stripe unit
          instead.  If the user specified a size value, then it must be a
          multiple of the log stripe size if log striping is used, otherwise
          it must be a multiple of the data stripe size if data striping is
          used.

          Using the version suboption to specify a version 2 log enables the
          sunit suboption, and allows the logbsize mount option (see fstab(4))
          to be increased beyond 32K.  Version 2 logs are automatically
          selected if a log stripe unit is specified.  See sunit and su
          suboptions, below.

          The sunit suboption specifies the alignment to be used for log
          writes.  The suboption value has to be specified in 512-byte block
          units.  Use the su suboption to specify the log stripe unit size in
          bytes.  Log writes will be aligned on this boundary, and rounded up
          to this boundary.  This gives major improvements in performance on
          some configurations.  The equivalent byte value must be a multiple
          of the filesystem block size.  Version 2 logs are automatically
          selected if the log su suboption is specified.

          The su suboption is an alternative to using sunit. The su suboption
          is used to specify the log stripe.  The suboption value has to be
          specified in bytes, (usually using the s or b suffixes).  This value
          must be a multiple of the filesystem block size.  Version 2 logs are
          automatically selected if the log su suboption is specified.


          The lazy-count suboption changes the method of logging various
          persistent counters in the superblock.  Under metadata intensive
          workloads, these counters are updated and logged frequently enough
          that the superblock updates become a serialisation point in the
          filesystem.

          With lazy-count=1, the superblock is not modified or logged on every
          change of the persistent counters. Instead, enough information is
          kept in other parts of the filesystem to be able to maintain the
          persistent counter values without needed to keep them in the
          superblock.  This gives significant improvements in performance on
          some configurations.  The default value is 0 (off) so you must
          specify lazy-count=1 if you want to make use of this feature.

     -n   Naming options.

          These options specify the version and size parameters for the naming
          (directory) area of the filesystem.  The valid suboptions are:
          log=value, size=value, and version=value.  The naming (directory)
          version is 1, 2 or 'ci', defaulting to 2 if unspecified.  With
          version 2 directories, the directory block size can be any power of
          2 size from the filesystem block size up to 65536.  The block size
          is specified either as a base two logarithm value with log=, or in
          bytes with size=.  The default size value for version 2 directories
          is 4096 bytes (4 KB), unless the filesystem block size is larger
          than 4096, in which case the default value is the filesystem block
          size.  For version 1 directories the block size is the same as the
          filesystem block size.

          Note that you must use V1 directories in the rare case that your
          filesystems are expected to be moved to computers running IRIX
          releases older than IRIX 6.5.5.  Such older releases of IRIX will
          not be able to mount a filesystem created with V2 directories and
          will issue the message "Wrong filesystem type:  xfs" when a mount is
          attempted.

          The version=ci suboption enables case-insensitive filenames and
          version 2 directories.  Filenames will be stored in directories as
          they were created, but all file or directory name searches will be
          case-insensitive.  This feature is normally used only when doing
          file serving to Windows clients.

          Note that NMC directories are not available on systems older than
          IRIX 6.5.22.  Such older releases of IRIX will not be able to mount
          a filesystem created with NMC directories and will issue the message
          "Wrong filesystem type:  xfs" when a mount is attempted.

     -p protofile
          If the optional -p protofile argument is given, mkfs_xfs uses
          protofile as a prototype file and takes its directions from that
          file.  The blocks and inodes specifiers in the protofile are
          provided for backwards compatibility, but are otherwise unused.  The


          prototype file contains tokens separated by spaces or newlines.  A
          sample prototype specification follows (line numbers have been added
          to aid in the explanation):

               1       /stand/diskboot
               2       4872 110
               3       d--777 3 1
               4       usr     d--777 3 1
               5       sh      ---755 3 1 /bin/sh
               6       ken     d--755 6 1
               7               $
               8       b0      b--644 3 1 0 0
               9       c0      c--644 3 1 0 0
               10      fifo    p--644 3 1
               11      slink   l--644 3 1 /a/symbolic/link
               12      :  This is a comment line
               13      $
               14      $

          Line 1 is a dummy string.  (It was formerly the bootfilename.)  It
          is present for backward compatibility; boot blocks are not used on
          SGI systems.

          Note that some string of characters must be present as the first
          line of the proto file to cause it to be parsed correctly; the value
          of this string is immaterial since it is ignored.

          Line 2 contains two numeric values (formerly the numbers of blocks
          and inodes).  These are also merely for backward compatibility: two
          numeric values must appear at this point for the proto file to be
          correctly parsed, but their values are immaterial since they are
          ignored.

          Lines 3-11 tell mkfs_xfs about files and directories to be included
          in this filesystem.  Line 3 specifies the root directory.  Lines 4-6
          and 8-10 specifies other directories and files.  Note the special
          symbolic link syntax on line 11.

          The $ on line 7 tells mkfs_xfs to end the branch of the filesystem
          it is on, and continue from the next higher directory.  It must be
          the last character on a line.  The colon on line 12 introduces a
          comment; all characters up until the following newline are ignored.
          Note that this means you cannot have a file in a prototype file
          whose name contains a colon.  The $ on lines 13 and 14 end the
          process, since no additional specifications follow.

          File specifications give the mode, the user ID, the group ID, and
          the initial contents of the file.  Valid syntax for the contents
          field depends on the first character of the mode.


          The mode for a file is specified by a 6-character string.  The first
          character specifies the type of the file.  The character range is
          -bcdpl to specify regular, block special, character special,
          directory files, named pipes (fifos), and symbolic links,
          respectively.  The second character of the mode is either u or - to
          specify setuserID mode or not.  The third is g or - for the
          setgroupID mode.  The rest of the mode is a three digit octal number
          giving the owner, group, and other read, write, execute permissions
          (see chmod(1)).

          Two decimal number tokens come after the mode; they specify the user
          and group IDs of the owner of the file.

          If the file is a regular file, the next token of the specification
          can be a pathname from which the contents and size are copied.  If
          the file is a block or character special file, two decimal numbers
          follow that give the major and minor device numbers.  If the file is
          a symbolic link, the next token of the specification is used as the
          contents of the link.  If the file is a directory, mkfs_xfs makes
          the entries .  and .. and then reads a list of names and
          (recursively) file specifications for the entries in the directory.
          As noted above, the scan is terminated with the token $.

     -q   Quiet option.

          Normally mkfs_xfs prints the parameters of the filesystem to be
          constructed; the -q flag suppresses this.

     -r   Real-time section options.

          These options specify the location, size, and other parameters of
          the real-time section of the filesystem.  The valid suboptions are:
          extsize=value and size=value.

          The extsize suboption is used to specify the size of the blocks in
          the real-time section of the filesystem.  This size must be a
          multiple of the filesystem block size.  The minimum allowed value is
          the filesystem block size or 4 KB (whichever is larger); the default
          value is the stripe width for striped volumes or 64 KB for non-
          striped volumes; the maximum allowed value is 1 GB.  The real-time
          extent size should be carefully chosen to match the parameters of
          the physical media used.

          The size suboption is used to specify the size of the real-time
          section.  This suboption is only needed if the real-time section of
          the filesystem should occupy less space than the size of the XLV/XVM
          real-time subvolume.

     -C   Disable overlapping partition/volume checks.


          By default mkfs_xfs checks to see if the destination partition or
          logical volume overlaps any mounted or reserved partitions in the
          system.  If an overlap or mount conflict is found, the user will be
          notified and prevented from potentially corrupting the existing
          data.  For systems with a large number of disks, this additional
          checking may add noticable overhead to the command's execution time.
          For situations where command performance is necessary, this switch
          may be used to disable the safeguards.  Due to the potential for
          user-error causing corrupted filesystems or other on-disk data
          corruption, we strongly discourage use of this switch in normal
          operation.

SEE ALSO
     mkfs(1M), mkfs_efs(1M).

BUGS
     With a prototype file, it is not possible to specify hard links.


                                                                        Page 9