{
    "content": [
        {
            "type": "text",
            "text": "# mdadm.conf (info)\n\n## NAME\n\nmdadm.conf - configuration for management of Software RAID with mdadm\n\n## SYNOPSIS\n\n/etc/mdadm/mdadm.conf\n\n## DESCRIPTION\n\nmdadm is a tool for creating, managing, and monitoring RAID devices us-\ning the md driver in Linux.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **EXAMPLE**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "mdadm.conf",
        "section": "",
        "mode": "info",
        "summary": "mdadm.conf - configuration for management of Software RAID with mdadm",
        "synopsis": "/etc/mdadm/mdadm.conf",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [
            "DEVICE /dev/sd[bcdjkl]1",
            "DEVICE /dev/hda1 /dev/hdb1",
            "# /dev/md0 is known by its UUID.",
            "ARRAY /dev/md0 UUID=3aaa0122:29827cfa:5331ad66:ca767371",
            "# /dev/md1 contains all devices with a minor number of",
            "#   1 in the superblock.",
            "ARRAY /dev/md1 superminor=1",
            "# /dev/md2 is made from precisely these two devices",
            "ARRAY /dev/md2 devices=/dev/hda1,/dev/hdb1",
            "# /dev/md4 and /dev/md5 are a spare-group and spares",
            "#  can be moved between them",
            "ARRAY /dev/md4 uuid=b23f3c6d:aec43a9f:fd65db85:369432df",
            "spare-group=group1",
            "ARRAY /dev/md5 uuid=19464854:03f71b1b:e0df2edd:246cc977",
            "spare-group=group1",
            "# /dev/md/home is created if need to be a partitionable md array",
            "# any spare device number is allocated.",
            "ARRAY /dev/md/home UUID=9187a482:5dde19d9:eea3cc4a:d646ab8b",
            "auto=part",
            "# The name of this array contains a space.",
            "ARRAY /dev/md9 name='Data Storage'",
            "POLICY domain=domain1 metadata=imsm path=pci-0000:00:1f.2-scsi-*",
            "action=spare",
            "POLICY domain=domain1 metadata=imsm path=pci-0000:04:00.0-scsi-[01]*",
            "action=include",
            "# One domain comprising of devices attached to specified paths  is  de-",
            "fined.",
            "#  Bare  device  matching  first path will be made an imsm spare on hot",
            "plug.",
            "# If more than one array is created on devices belonging to domain1 and",
            "# one of them becomes degraded, then any imsm spare matching  any  path",
            "for",
            "# given domain name can be migrated.",
            "MAILADDR root@mydomain.tld",
            "PROGRAM /usr/sbin/handle-mdadm-events",
            "CREATE group=system mode=0640 auto=part-8",
            "HOMEHOST <system>",
            "AUTO +1.x homehost -all",
            "SYSFS name=/dev/md/raid5 groupthreadcnt=4 syncspeedmax=1000000",
            "SYSFS    uuid=bead5eb6:31c17a27:da120ba2:7dfda40d    groupthreadcnt=4",
            "syncspeedmax=1000000",
            "MONITORDELAY 60"
        ],
        "see_also": [
            {
                "name": "mdadm",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/mdadm/8/json"
            },
            {
                "name": "md",
                "section": "4",
                "url": "https://www.chedong.com/phpMan.php/man/md/4/json"
            },
            {
                "name": "MDADM.CONF",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/MDADM.CONF/5/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 383,
                "subsections": []
            },
            {
                "name": "EXAMPLE",
                "lines": 46,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "mdadm.conf - configuration for management of Software RAID with mdadm\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "/etc/mdadm/mdadm.conf\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "mdadm is a tool for creating, managing, and monitoring RAID devices us-\ning the md driver in Linux.\n\nSome common tasks, such as assembling all arrays, can be simplified  by\ndescribing the devices and arrays in this configuration file.\n\nSYNTAX\nThe  file  should  be  seen as a collection of words separated by white\nspace (space, tab, or newline).  Any word that beings with a hash  sign\n(#)  starts  a comment and that word together with the remainder of the\nline is ignored.\n\nSpaces can be included in a word using  quotation  characters.   Either\nsingle quotes (') or double quotes (\") may be used.  All the characters\nfrom one quotation character to next identical character are  protected\nand will not be used to separate words to start new quoted strings.  To\ninclude a single quote it must be between double quotes.  To include  a\ndouble quote it must be between single quotes.\n\nAny  line  that  starts  with  white space (space or tab) is treated as\nthough it were a continuation of the previous line.\n\nEmpty lines are ignored, but otherwise  each  (non  continuation)  line\nmust  start  with a keyword as listed below.  The keywords are case in-\nsensitive and can be abbreviated to 3 characters.\n\nThe keywords are:\n\nDEVICE A device line lists the devices (whole  devices  or  partitions)\nthat might contain a component of an MD array.  When looking for\nthe components of an array, mdadm will scan  these  devices  (or\nany devices listed on the command line).\n\nThe device line may contain a number of different devices (sepa-\nrated by spaces) and each device name can contain wild cards  as\ndefined by glob(7).\n\nAlso, there may be several device lines present in the file.\n\nAlternatively,  a  device line can contain either or both of the\nwords containers and partitions.  The word containers will cause\nmdadm  to  look for assembled CONTAINER arrays and included them\nas a source for assembling further arrays.\n\nThe word partitions will cause mdadm  to  read  /proc/partitions\nand  include  all  devices  and partitions found therein.  mdadm\ndoes not use the names from /proc/partitions but only the  major\nand  minor  device numbers.  It scans /dev to find the name that\nmatches the numbers.\n\nIf no DEVICE line is present, then \"DEVICE  partitions  contain-\ners\" is assumed.\n\nFor example:\n\nDEVICE /dev/hda* /dev/hdc*\nDEV    /dev/sd*\nDEVICE /dev/disk/by-path/pci*\nDEVICE partitions\n\nARRAY  The  ARRAY lines identify actual arrays.  The second word on the\nline may be the name of the device where the array  is  normally\nassembled, such as /dev/md1 or /dev/md/backup.  If the name does\nnot start with  a  slash  ('/'),  it  is  treated  as  being  in\n/dev/md/.   Alternately  the  word <ignore> (complete with angle\nbrackets) can be given in which case any array which matches the\nrest  of  the line will never be automatically assembled.  If no\ndevice name is given, mdadm will use various heuristics  to  de-\ntermine an appropriate name.\n\nSubsequent  words identify the array, or identify the array as a\nmember of a group. If multiple identities are given, then a com-\nponent  device  must  match  ALL  identities  to be considered a\nmatch.  Each identity word has a tag, and equals sign, and  some\nvalue.  The tags are:\n\nuuid=  The  value  should  be  a  128 bit uuid in hexadecimal, with\npunctuation interspersed if desired.  This  must  match  the\nuuid stored in the superblock.\n\nname=  The  value  should  be a simple textual name as was given to\nmdadm when the array was created.  This must match the  name\nstored  in  the superblock on a device for that device to be\nincluded in the array.  Not all superblock  formats  support\nnames.\n\nsuper-minor=\nThe  value  is  an  integer which indicates the minor number\nthat was stored in the superblock when the  array  was  cre-\nated.  When  an array is created as /dev/mdX, then the minor\nnumber X is stored.\n\ndevices=\nThe value is a comma separated list of device names  or  de-\nvice name patterns.  Only devices with names which match one\nentry in the list will be used to assemble the array.   Note\nthat  the  devices listed there must also be listed on a DE-\nVICE line.\n\nlevel= The value is a RAID level.  This is  not  normally  used  to\nidentify an array, but is supported so that the output of\n\nmdadm --examine --scan\n\ncan be use directly in the configuration file.\n\nnum-devices=\nThe  value is the number of devices in a complete active ar-\nray.  As with level= this is mainly for  compatibility  with\nthe output of\n\nmdadm --examine --scan.\n\nspares=\nThe  value  is a number of spare devices to expect the array\nto have.  The sole use of this keyword and value is as  fol-\nlows: mdadm --monitor will report an array if it is found to\nhave fewer than this number of spares when --monitor  starts\nor when --oneshot is used.\n\nspare-group=\nThe  value is a textual name for a group of arrays.  All ar-\nrays with the same spare-group name  are  considered  to  be\npart  of the same group.  The significance of a group of ar-\nrays is that mdadm will, when monitoring the arrays, move  a\nspare  drive  from  one array in a group to another array in\nthat group if the first array had a failed or missing  drive\nbut no spare.\n\nauto=  This option is rarely needed with mdadm-3.0, particularly if\nuse with the Linux kernel v2.6.28 or later.  It tells  mdadm\nwhether  to use partitionable array or non-partitionable ar-\nrays and, in the absence of udev, how many partition devices\nto  create.  From 2.6.28 all md array devices are partition-\nable, hence this option is not needed.\n\nThe value of this option can be \"yes\" or  \"md\"  to  indicate\nthat  a  traditional,  non-partitionable  md array should be\ncreated, or \"mdp\", \"part\" or \"partition\" to indicate that  a\npartitionable  md  array  (only  available  in linux 2.6 and\nlater) should be used.  This later set can also have a  num-\nber  appended  to indicate how many partitions to create de-\nvice files for, e.g.  auto=mdp5.  The default is 4.\n\nbitmap=\nThe option specifies a file in which a  write-intent  bitmap\nshould be found.  When assembling the array, mdadm will pro-\nvide this file to the md driver as the  bitmap  file.   This\nhas  the  same function as the --bitmap-file option to --as-\nsemble.\n\nmetadata=\nSpecify the metadata format that the  array  has.   This  is\nmainly recognised for comparability with the output of mdadm\n-Es.\n\ncontainer=\nSpecify that this array is a member array of some container.\nThe value given can be either a path name in /dev, or a UUID\nof the container array.\n\nmember=\nSpecify that this array is a member array of some container.\nEach  type of container has some way to enumerate member ar-\nrays, often a simple sequence number.  The value  identifies\nwhich  member  of a container the array is.  It will usually\naccompany a \"container=\" word.\n\nMAILADDR\nThe mailaddr line gives an E-mail address that alerts should  be\nsent  to  when mdadm is running in --monitor mode (and was given\nthe --scan option).  There should only be one MAILADDR line  and\nit  should  have only one address.  Any subsequent addresses are\nsilently ignored.\n\nMAILFROM\nThe mailfrom line (which can only be abbreviated to at  least  5\ncharacters) gives an address to appear in the \"From\" address for\nalert mails.  This can be useful if you want to explicitly set a\ndomain,  as  the  default from address is \"root\" with no domain.\nAll words on this line are catenated with spaces to form the ad-\ndress.\n\nNote  that  this  value cannot be set via the mdadm commandline.\nIt is only settable via the config file.\n\nPROGRAM\nThe program line gives the name of a  program  to  be  run  when\nmdadm --monitor detects potentially interesting events on any of\nthe arrays that it is monitoring.  This program  gets  run  with\ntwo or three arguments, they being the Event, the md device, and\npossibly the related component device.\n\nThere should only be one program line and it should be give only\none program.\n\nCREATE The  create  line  gives default values to be used when creating\narrays, new members of arrays, and device  entries  for  arrays.\nThese include:\n\nowner=\n\ngroup= These  can  give  user/group  ids or names to use instead of\nsystem defaults (root/wheel or root/disk).\n\nmode=  An octal file mode such as 0660 can be given to override the\ndefault of 0600.\n\nauto=  This corresponds to the --auto flag to mdadm.  Give yes, md,\nmdp, part -- possibly followed by a number of partitions  --\nto indicate how missing device entries should be created.\n\nmetadata=\nThe name of the metadata format to use if none is explicitly\ngiven.  This can be useful to impose a  system-wide  default\nof version-1 superblocks.\n\nsymlinks=no\nNormally when creating devices in /dev/md/ mdadm will create\na matching symlink from /dev/ with a  name  starting  md  or\nmd.  Give symlinks=no to suppress this symlink creation.\n\nnames=yes\nSince Linux 2.6.29 it has been possible to create md devices\nwith a name like mdhome rather than  just  a  number,  like\nmd3.   mdadm  will use the numeric alternative by default as\nother tools that interact with md  arrays  may  expect  only\nnumbers.   If  names=yes  is  given in mdadm.conf then mdadm\nwill use a name when appropriate.   If  names=no  is  given,\nthen  non-numeric  md  device names will not be used even if\nthe default changes in a future release of mdadm.\n\nbbl=no By default, mdadm will reserve space for a  bad  block  list\n(bbl)  on all devices included in or added to any array that\nsupports them.  Setting bbl=no will prevent this,  so  newly\nadded devices will not have a bad block log.\n\nHOMEHOST\nThe  homehost line gives a default value for the --homehost= op-\ntion to mdadm.  There should normally be only one other word  on\nthe  line.   It should either be a host name, or one of the spe-\ncial words <system>, <none> and <ignore>.  If <system> is given,\nthen the gethostname(2) systemcall is used to get the host name.\nThis is the default.\n\nIf <ignore> is given, then a flag is set so that when arrays are\nbeing  auto-assembled  the  checking of the recorded homehost is\ndisabled.  If <ignore> is given it is also possible to  give  an\nexplicit  name which will be used when creating arrays.  This is\nthe only case when there can be more that one other word on  the\nHOMEHOST  line.   If  there  are  other words, or other HOMEHOST\nlines, they are silently ignored.\n\nIf <none> is given, then the default of using gethostname(2)  is\nover-ridden and no homehost name is assumed.\n\nWhen  arrays  are  created, this host name will be stored in the\nmetadata.  When arrays are assembled using auto-assembly, arrays\nwhich  do not record the correct homehost name in their metadata\nwill be assembled using a \"foreign\" name.  A \"foreign\" name  al-\nway  ends  with a digit string preceded by an underscore to dif-\nferentiate it from any possible local name. e.g.  /dev/md/11 or\n/dev/md/home0.\n\nAUTO   A  list  of names of metadata format can be given, each preceded\nby a plus or minus sign.  Also the word homehost is  allowed  as\nis all preceded by plus or minus sign.  all is usually last.\n\nWhen mdadm is auto-assembling an array, either via --assemble or\n--incremental and it finds metadata of a given type,  it  checks\nthat metadata type against those listed in this line.  The first\nmatch wins, where all matches anything.  If  a  match  is  found\nthat  was preceded by a plus sign, the auto assembly is allowed.\nIf the match was preceded by a minus sign, the auto assembly  is\ndisallowed.  If no match is found, the auto assembly is allowed.\n\nIf  the  metadata  indicates that the array was created for this\nhost, and the word homehost appears before any other match, then\nthe array is treated as a valid candidate for auto-assembly.\n\nThis  can be used to disable all auto-assembly (so that only ar-\nrays explicitly listed in mdadm.conf or on the command line  are\nassembled),  or  to  disable  assembly of certain metadata types\nwhich might be handled by other software.  It can also  be  used\nto disable assembly of all foreign arrays - normally such arrays\nare assembled but given a non-deterministic name in /dev/md/.\n\nThe known metadata types are 0.90, 1.x, ddf, imsm.\n\nAUTO should  be  given  at  most  once.   Subsequent  lines  are\nsilently  ignored.   Thus an earlier config file in a config di-\nrectory will over-ride the setting in a later config file.\n\nPOLICY This is used to specify what automatic behavior  is  allowed  on\ndevices  newly  appearing  in  the  system and provides a way of\nmarking spares that can be moved to other arrays as well as  the\nmigration domains.  Domain can be defined through policy line by\nspecifying  a  domain  name  for  a   number   of   paths   from\n/dev/disk/by-path/.  A device may belong to several domains. The\ndomain of an array is a union of domains of all devices in  that\narray.  A spare can be automatically moved from one array to an-\nother if the set of the destination array's domains contains all\nthe  domains  of  the  new  disk or if both arrays have the same\nspare-group.\n\nTo update hot plug configuration  it  is  necessary  to  execute\nmdadm --udev-rules command after changing the config file\n\nKeywords used in the POLICY line and supported values are:\n\ndomain=\nany arbitrary string\n\nmetadata=\n0.9 1.x ddf or imsm\n\npath=  file glob matching anything from /dev/disk/by-path\n\ntype=  either disk or part.\n\naction=\ninclude, re-add, spare, spare-same-slot, or force-spare\n\nauto=  yes, no, or homehost.\n\nThe  action  item determines the automatic behavior allowed for de-\nvices matching the path and type in the same  line.   If  a  device\nmatches  several lines with different actions then the most permis-\nsive will apply. The ordering of policy lines is irrelevant to  the\nend result.\n\ninclude\nallows  adding  a  disk to an array if metadata on that disk\nmatches that array\n\nre-add will include the device in the array if it appears to  be  a\ncurrent member or a member that was recently removed and the\narray has a write-intent-bitmap to allow  the  re-add  func-\ntionality.\n\nspare  as  above and additionally: if the device is bare it can be-\ncome a spare if there is any array that it  is  a  candidate\nfor based on domains and metadata.\n\nspare-same-slot\nas above and additionally if given slot was used by an array\nthat went degraded recently and the device plugged in has no\nmetadata  then  it will be automatically added to that array\n(or it's container)\n\nforce-spare\nas above and the disk will become a spare in remaining cases\n\nPART-POLICY\nThis is similar to POLICY and accepts the same  keyword  assign-\nments.   It  allows  a  consistent set of policies to applied to\neach of the partitions of a device.\n\nA PART-POLICY line should set type=disk and identify the path to\none or more disk devices.  Each partition on these disks will be\ntreated according to the action= setting  from this line.  If  a\ndomain  is set in the line, then the domain associated with each\npatition will be based on the  domain,  but  with  \"-partN\"  ap-\npended,  when  N  is the partition number for the partition that\nwas found.\n\nSYSFS  The SYSFS line lists custom values  of  MD  device's  sysfs  at-\ntributes which will be stored in sysfs after the array is assem-\nbled. Multiple lines are allowed and each line  has  to  contain\nthe uuid or the name of the device to which it relates.\n\nuuid=  hexadecimal  identifier  of MD device. This has to match the\nuuid stored in the superblock.\n\nname=  name of the MD device as was given to mdadm when  the  array\nwas created. It will be ignored if uuid is not empty.\n\nMONITORDELAY\nThe  monitordelay line gives a delay in seconds mdadm shall wait\nbefore pooling md arrays when  mdadm  is  running  in  --monitor\nmode.   -d/--delay  command  line argument takes precedence over\nthe config file\n",
                "subsections": []
            },
            "EXAMPLE": {
                "content": "DEVICE /dev/sd[bcdjkl]1\nDEVICE /dev/hda1 /dev/hdb1\n\n# /dev/md0 is known by its UUID.\nARRAY /dev/md0 UUID=3aaa0122:29827cfa:5331ad66:ca767371\n# /dev/md1 contains all devices with a minor number of\n#   1 in the superblock.\nARRAY /dev/md1 superminor=1\n# /dev/md2 is made from precisely these two devices\nARRAY /dev/md2 devices=/dev/hda1,/dev/hdb1\n\n# /dev/md4 and /dev/md5 are a spare-group and spares\n#  can be moved between them\nARRAY /dev/md4 uuid=b23f3c6d:aec43a9f:fd65db85:369432df\nspare-group=group1\nARRAY /dev/md5 uuid=19464854:03f71b1b:e0df2edd:246cc977\nspare-group=group1\n# /dev/md/home is created if need to be a partitionable md array\n# any spare device number is allocated.\nARRAY /dev/md/home UUID=9187a482:5dde19d9:eea3cc4a:d646ab8b\nauto=part\n# The name of this array contains a space.\nARRAY /dev/md9 name='Data Storage'\n\nPOLICY domain=domain1 metadata=imsm path=pci-0000:00:1f.2-scsi-*\naction=spare\nPOLICY domain=domain1 metadata=imsm path=pci-0000:04:00.0-scsi-[01]*\naction=include\n# One domain comprising of devices attached to specified paths  is  de-\nfined.\n#  Bare  device  matching  first path will be made an imsm spare on hot\nplug.\n# If more than one array is created on devices belonging to domain1 and\n# one of them becomes degraded, then any imsm spare matching  any  path\nfor\n# given domain name can be migrated.\nMAILADDR root@mydomain.tld\nPROGRAM /usr/sbin/handle-mdadm-events\nCREATE group=system mode=0640 auto=part-8\nHOMEHOST <system>\nAUTO +1.x homehost -all\nSYSFS name=/dev/md/raid5 groupthreadcnt=4 syncspeedmax=1000000\nSYSFS    uuid=bead5eb6:31c17a27:da120ba2:7dfda40d    groupthreadcnt=4\nsyncspeedmax=1000000\nMONITORDELAY 60\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "mdadm(8), md(4).\n\nMDADM.CONF(5)",
                "subsections": []
            }
        }
    }
}