Syntax: mdadm [options] Options: -a, xx Adds a disk into a current array -C, —create Creates a new RAID array -D, —detail Prints the details of an array -G, —grow Changes the size or shape of an active array -f, xx Fails a disk in the array -l, —level Specifies level (type) of RAID array to create -n, —raid-devices Specifies the devices in the RAID array -q, —quiet Species not to show output -S, —stop Stops an array -v, —verbose Provides verbose output
创建 Linux RAID 1 设备:
1 2 3 4 5 6 7 8 9 10 11
[root@rhel1 ~]# mdadm -Cv /dev/md0 --level=1 -n2 /dev/sdc1 /dev/sdd1 mdadm: Note: this array has metadata at the start and may not be suitable as a boot device. If you plan to store '/boot' on this device please ensure that your boot-loader understands md/v1.x metadata, or use --metadata=0.90 mdadm: size set to 1044181K Continue creating array? y mdadm: Defaulting to version 1.2 metadata mdadm: array /dev/md0 started. [root@rhel1 ~]#
[root@rhel1 ~]# mkfs.ext4 /dev/md0 mke2fs 1.41.12 (17-May-2010) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 65280 inodes, 261045 blocks 13052 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=268435456 8 block groups 32768 blocks per group, 32768 fragments per group 8160 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376