xfs on lvm on hardware RAID: correct parameters?

Rather than "strip size" and "stripe size", the XFS man pages use the terms "stripe unit" and "stripe width" respectively.

This makes it possible to decode the otherwise confusing text in the mkfs.xfs(8) man page:

               sunit=value
                      This is used to specify the stripe unit for  a  RAID
                      device  or  a  logical  volume.  The value has to be
                      specified in 512-byte block units. Use the su subop‐
                      tion  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
                      512KiB.  Also inode allocations and the internal log
                      will be stripe unit aligned.

               su=value
                      This is an alternative to using sunit.  The su  sub‐
                      option is used to specify the stripe unit for a RAID
                      device or a striped logical volume. The 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.

So, with your array reporting a strip size of 256KiB, you would specify either su=256K or sunit=512 (because 512 512-byte blocks equals 256KiB).

               swidth=value
                      This  is used to specify the stripe width for a RAID
                      device or a striped logical volume. The 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.

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

                      When  a  filesystem  is  created on a logical volume
                      device, mkfs.xfs will automatically query the  logi‐
                      cal volume for appropriate sunit and swidth values.

With 10 spindles (8 data, 2 parity) you would specify either sw=8 (data spindles) or swidth=2M (the strip size multiplied by data spindles).

Note that xfs_info and mkfs.xfs interpret sunit and swidth as being specified in units of 512B sectors; that's unfortunately not the unit they're reported in, however. xfs_info and mkfs.xfs report them in multiples of your basic block size (bsize) and not in 512B sectors.

TL;DR:

The easiest way to specify these is usually by strip size and spindle count, thus su= strip size and sw= spindle count.

Tags:

Raid

Xfs

Lvm