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 Writing inode tables: done Creating journal (4096 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 23 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override.
挂载 Linux RAID 1 设备:
1 2 3 4 5 6
[root@rhel1 ~]# mkdir /RAID1 [root@rhel1 ~]# mount /dev/md0 /RAID1 [root@rhel1 ~]# df -h /RAID1 Filesystem Size Used Avail Use% Mounted on /dev/md0 1004M 18M 936M 2% /RAID1 [root@rhel1 ~]#
作者简介:
大家好!我是 Manmohan Mirkar。我很高兴见到你们!我在 10 多年前开始使用 Linux,我从来没有想过我会到今天这个地步。我的激情是帮助你们获取 Linux 知识。谢谢阅读!