基本語法 :mdadm [mode] <raid-device> [options] <component-devices>
1. Assemble:將以前定義的某個陣列加入當前在用陣列。
2. Build:Build a legacy array ,每個device 沒有 superblocks
3.Create:創建一個新的陣列,每個device 具有 superblocks
4.Manage: 管理陣列,比如 add 或 remove
5.Misc:允許單獨對陣列中的某個 device 做操作,比如抹去superblocks 或 終止在用的陣列。
6. Follow or Monitor:監控 raid 1,4,5,6 和 multipath 的狀態
7. Grow:改變raid 容量或 陣列中的 device 數目
-A, --assemble:加入一個以前定義的陣列
-B, --build:Build a legacy array without superblocks.
-Q, --query:查看一個device,判斷它爲一個 md device 或是 一個 md 陣列的一部分
-D, --detail:打印一個或多個 md device 的詳細信息
-E, --examine:打印 device 上的 md superblock 的內容
-F, --follow, --monitor:選擇 Monitor 模式
-h, --help:幫助信息,用在以上選項後,則顯示該選項信息
-b, --brief:較少的細節。用於 --detail 和 --examine 選項
-c, --config= :指定配置文件,缺省爲 /etc/mdadm.conf
-s, --scan:掃描配置文件或 /proc/mdstat以搜尋丟失的信息。配置文件/etc/mdadm.conf
RARI-5配置的基本步驟:
[root@localhost ~]# fdisk –l 查看
N(開始劃分分區)àP(主分區)->1(第一個主分區) 然後指定大小
[root@localhost ~]# fdisk /dev/sdc
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previouscontent won't be recoverable.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
Command (m for help): n 添加分區
p primary partition (1-4)
Partition number (1-4): 1 添加主分區1
First cylinder (1-130, default 1):確定第一個主分區的起始磁柱,默認爲1就好。
Last cylinder or +size or +sizeM or +sizeK (1-130, default 130): 50 設置大小(也可用+200M來指定)
Command (m for help): p 查看
Disk /dev/sdc: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 50 401593+ 83 Linux
Command (m for help): t 改變分區類型
Hex code (type L to list codes): fd fd爲linux raid autodetect
Changed system type of partition 1 to fd (Linux raid autodetect)
Disk /dev/sdc: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 50 401593+ fd Linux raid autodetect
Command (m for help): w (q) 保存退出 (不保存退出)
[root@localhost ~]# fdisk –l 查看
Disk /dev/sdc: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 50 401593+ fd Linux raid autodetect
Disk /dev/sdd: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdd1 1 50 401593+ fd Linux raid autodetect
Disk /dev/sde: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sde1 1 50 401593+ fd Linux raid autodetect
創建RAID-5卷