免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1523 | 回复: 0
打印 上一主题 下一主题

mdadm manual [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-05-01 17:56 |只看该作者 |倒序浏览
NAME
       mdadm - manage MD devices aka Linux Software RAID
SYNOPSIS
       mdadm [mode]  [options]
DESCRIPTION
       RAID devices are virtual devices created from two or more real block devices. This
       allows multiple devices (typically disk drives or partitions thereof) to  be  com-
       bined  into  a single device to hold (for example) a single filesystem.  Some RAID
       levels include redundancy and so can survive some degree of device failure.
       Linux Software RAID devices are implemented  through  the  md  (Multiple  Devices)
       device driver.
       Currently,  Linux supports LINEAR md devices, RAID0 (striping), RAID1 (mirroring),
       RAID4, RAID5, RAID6, RAID10, MULTIPATH, and FAULTY.
       MULTIPATH is not a Software RAID mechanism, but  does  involve  multiple  devices:
       each device is a path to one common physical storage device.
       FAULTY  is  also  not  true  RAID, and it only involves one device.  It provides a
       layer over a true device that can be used to inject faults.
MODES
       mdadm has several major modes of operation:
       Assemble
              Assemble the components of a previously created array into an active array.
              Components  can  be  explicitly given or can be searched for.  mdadm checks
              that the components do form a bona fide array, and can, on request,  fiddle
              superblock information so as to assemble a faulty array.
       Build  Build  an  array that doesn't have per-device superblocks.  For these sorts
              of arrays, mdadm cannot differentiate between initial creation  and  subse-
              quent  assembly of an array.  It also cannot perform any checks that appro-
              priate components have been requested.  Because of  this,  the  Build  mode
              should  only be used together with a complete understanding of what you are
              doing.
       Create Create a new array with per-device superblocks.
       Follow or Monitor
              Monitor one or more md devices and act on any state changes.  This is  only
              meaningful  for  raid1, 4, 5, 6, 10 or multipath arrays, as only these have
              interesting state.  raid0 or linear never have missing,  spare,  or  failed
              drives, so there is nothing to monitor.
       Grow   Grow  (or shrink) an array, or otherwise reshape it in some way.  Currently
              supported growth options including changing the active  size  of  component
              devices  and  changing the number of active devices in RAID levels 1/4/5/6,
              as well as adding or removing a write-intent bitmap.
       Incremental Assembly
              Add a single device to an appropriate array.  If the addition of the device
              makes  the array runnable, the array will be started.  This provides a con-
              venient interface to a hot-plug system.  As each device is detected,  mdadm
              has a chance to include it in some array as appropriate.
       Manage This  is for doing things to specific components of an array such as adding
              new spares and removing faulty devices.
       Misc   This is an Everything  else? mode  that  supports  operations  on  active
              arrays,  operations  on  component devices such as erasing old superblocks,
              and information gathering operations.
       Auto-detect
              This mode does not act on  a  specific  device  or  array,  but  rather  it
              requests the Linux Kernel to activate any auto-detected arrays.

OPTIONS
Options for selecting a mode are:
       -A, --assemble
              Assemble a pre-existing array.
       -B, --build
              Build a legacy array without superblocks.
       -C, --create
              Create a new array.
       -F, --follow, --monitor
              Select Monitor mode.
       -G, --grow
              Change the size or shape of an active array.
       -I, --incremental
              Add  a  single  device  into  an  appropriate array, and possibly start the
              array.
       --auto-detect
              Request that the kernel starts any auto-detected  arrays.   This  can  only
              work if md is compiled into the kernel ?not if it is a module.  Arrays can
              be auto-detected by the kernel if all the components are in primary  MS-DOS
              partitions with partition type FD.  In-kernel autodetect is not recommended
              for new installations.  Using mdadm to detect and assemble arrays ? possi-
              bly  in an initrd ?is substantially more flexible and should be preferred.
       If a device is given before any options, or if the first option is --add,  --fail,
       or --remove, then the MANAGE mode is assume.  Anything other than these will cause
       the Misc mode to be assumed.
Options that are not mode-specific are:
       -h, --help
              Display general help message or, after one of the above  options,  a  mode-
              specific help message.
       --help-options
              Display  more  detailed  help  about command line parsing and some commonly
              used options.
       -V, --version
              Print version information for mdadm.
       -v, --verbose
              Be more verbose about what is happening.  This can  be  used  twice  to  be
              extra-verbose.   The extra verbosity currently only affects --detail --scan
              and --examine --scan.
       -q, --quiet
              Avoid printing purely informative  messages.   With  this,  mdadm  will  be
              silent unless there is something really important to report.
       -b, --brief
              Be  less verbose.  This is used with --detail and --examine.  Using --brief
              with --verbose gives an intermediate level of verbosity.
       -f, --force
              Be more forceful about certain operations.  See the various modes  for  the
              exact meaning of this option in different contexts.
       -c, --config=
              Specify  the config file.  Default is to use /etc/mdadm.conf, or if that is
              missing then /etc/mdadm/mdadm.conf.  If the config file given is partitions
              then  nothing  will  be  read, but mdadm will act as though the config file
              contained exactly DEVICE partitions and will read /proc/partitions to  find
              a  list of devices to scan.  If the word none is given for the config file,
              then mdadm will act as though the config file were empty.
       -s, --scan
              Scan config file or /proc/mdstat for missing information.  In general, this
              option  gives  mdadm permission to get any missing information (like compo-
              nent devices, array devices, array identities, and alert destination)  from
              the  configuration  file  (see previous option); one exception is MISC mode
              when using --detail or --stop, in which case --scan says to get a  list  of
              array devices from /proc/mdstat.
       -e ,  --metadata=
              Declare the style of superblock (raid metadata) to be used.  The default is
              0.90 for --create, and to guess for other operations.  The default  can  be
              overridden  by  setting  the  metadata  value  for  the  CREATE  keyword in
              mdadm.conf.
              Options are:
              0, 0.90, default
                     Use the original 0.90 format superblock.  This format limits  arrays
                     to 28 component devices and limits component devices of levels 1 and
                     greater to 2 terabytes.
              1, 1.0, 1.1, 1.2
                     Use the new version-1 format superblock.  This has few restrictions.
                     The  different  sub-versions store the superblock at different loca-
                     tions on the device, either at the end (for 1.0), at the start  (for
                     1.1) or 4K from the start (for 1.2).
       --homehost=
              This will override any HOMEHOST setting in the config file and provides the
...skipping...
              128Kb of space at the end of the drive for the RAID superblock.  If this is
              not  specified  (as  it  normally is not) the smallest drive (or partition)
              sets the size, though if there is a variance among the  drives  of  greater
              than 1%, a warning is issued.
              This  value can be set with --grow for RAID level 1/4/5/6. If the array was
              created with a size smaller than the currently  active  drives,  the  extra
              space  can  be  accessed  using --grow.  The size can be given as max which
              means to choose the largest size that fits on all current drives.
       -c, --chunk=
              Specify chunk size of kibibytes.  The default is 64.
       --rounding=
              Specify rounding factor for linear array (==chunk size)
       -l, --level=
              Set raid level.  When used with --create, options are:  linear,  raid0,  0,
              stripe,  raid1, 1, mirror, raid4, 4, raid5, 5, raid6, 6, raid10, 10, multi-
              path, mp, faulty.  Obviously some of these are synonymous.
              When used with --build, only linear, stripe, raid0,  0,  raid1,  multipath,
              mp, and faulty are valid.
              Not yet supported with --grow.
       -p, --layout=
              This  option  configures  the  fine  details  of data layout for raid5, and
              raid10 arrays, and controls the failure modes for faulty.
              The layout of the  raid5  parity  block  can  be  one  of  left-asymmetric,
              left-symmetric,  right-asymmetric,  right-symmetric,  la,  ra, ls, rs.  

FILES
/proc/mdstat
       If  you're  using  the  /proc filesystem, /proc/mdstat lists all active md devices
       provide brief information about the device.
         mdadm --assemble --scan
       This  will assemble and start all arrays listed in the standard config file.  This
       command will typically go in a system startup file.
         mdadm --stop --scan
       This will shut down all arrays that can be shut down (i.e. are  not  currently  in
       use).  This will typically go in a system shutdown script.
         mdadm --follow --scan --delay=120
       If (and only if) there is an Email address or program given in the standard config
       file, then monitor the status of all arrays listed in that file  by  polling  them
       ever 2 minutes.
         mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/hd[ac]1
       Create /dev/md0 as a RAID1 array consisting of /dev/hda1 and /dev/hdc1.
         echo DEVICE /dev/hd*[0-9] /dev/sd*[0-9]?> mdadm.conf
         mdadm --detail --scan >> mdadm.conf
       This  will  create  a prototype config file that describes currently active arrays
       that are known to be made from partitions of IDE or SCSI drives.  This file should
       be reviewed before being used as it may contain unwanted detail.
         echo DEVICE /dev/hd[a-z] /dev/sd*[a-z]?> mdadm.conf
         mdadm --examine --scan --config=mdadm.conf >> mdadm.conf
       This  will  find  arrays which could be assembled from existing IDE and SCSI whole
       drives (not partitions), and store the information in the format of a config file.
       This  file  is  very  likely to contain unwanted detail, particularly the devices=
       entries.  It should be reviewed and edited before being used as an  actual  config
       file.
         mdadm --examine --brief --scan --config=partitions
         mdadm -Ebsc partitions
       Create  a  list  of  devices  by  reading  /proc/partitions,  scan  these for RAID
       superblocks, and printout a brief listing of all that were found.
         mdadm -Ac partitions -m 0 /dev/md0
       Scan all partitions and devices listed in /proc/partitions and  assemble  /dev/md0
       out of all such devices with a RAID superblock with a minor number of 0.
         mdadm --monitor --scan --daemonise > /var/run/mdadm
       If  config  file  contains a mail address or alert program, run mdadm in the back-
       ground in monitor mode monitoring all md devices.  Also write pid of mdadm  daemon
       to /var/run/mdadm.
         mdadm -Iq /dev/somedevice
       Try to incorporate newly discovered device into some array as appropriate.
         mdadm --incremental --rebuild --run --scan
       Rebuild  the  array  map  from  any current arrays, and then start any that can be
       started.
         mdadm /dev/md4 --fail detached --remove detached
       Any devices which are components of /dev/md4 will be marked  as  faulty  and  then
       remove from the array.
         mdadm --create --help
       Provide help about the Create mode.
         mdadm --config --help
       Provide help about the format of the config file.
         mdadm --help
       Provide general help.


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/94265/showart_1915930.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP