============================练习============================
1、创建一个大小为10G的RAID 1 要求有一个空闲盘,而且CHUNK大小为128K
[iyunv@localhost ~]# mdadm -C /dev/md0 -a yes -n 2 -x 1 -l 1 -c 128 /dev/sda{6,7} /dev/sdb1
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
Continue creating array? y
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md0 started.
可以对其格式,然后挂载使用
[iyunv@localhost ~]# mkfs.ext4 /dev/md0
[iyunv@localhost ~]# mdadm -D /dev/md0
/dev/md0:
Version : 1.2
Creation Time : Wed Oct 28 01:25:39 2015
Raid Level : raid1
Array Size : 10479232 (9.99 GiB 10.73 GB)
Used Dev Size : 10479232 (9.99 GiB 10.73 GB)
Raid Devices : 2
Total Devices : 3
Persistence : Superblock is persistent
Update Time : Wed Oct 28 01:29:55 2015
State : active
Active Devices : 2
Working Devices : 3
Failed Devices : 0
Spare Devices : 1
Name : localhost.localdomain:0 (local to host localhost.localdomain)
UUID : 672b6987:7a038b6e:9863300e:a049f5a9
Events : 18
Number Major Minor RaidDevice State
0 8 6 0 active sync /dev/sda6
1 8 7 1 active sync /dev/sda7
[iyunv@localhost yum.repos.d]# mount -a
[iyunv@localhost yum.repos.d]# mount
/dev/sda2 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/sda1 on /boot type ext4 (rw)
/dev/sda3 on /usr type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/dev/md1 on /backup type ext4 (rw,noatime,acl)