一.概念
mdadm是multiple devices admin的简称,它是Linux下的一款标准的软件 RAID 管理工具,作者是Neil Brown
二.特点
mdadm能够诊断、监控和收集详细的阵列信息
mdadm能够执行几乎所有的功能而不需要配置文件(也没有默认的配置文件)
三.作用 (引用)
在linux系统中目前以MD(Multiple Devices)虚拟块设备的方式实现软件RAID,利用多个底层的块设备虚拟出一个新的虚拟设备,并且利用条带化(stripping)技术将数据块均匀分布到多个磁盘上来提高虚拟设备的读写性能,利用不同的数据冗祭算法来保护用户数据不会因为某个块设备的故障而完全丢失,而且还能在设备被替换后将丢失的数据恢复到新的设备上.
目前MD支持linear,multipath,raid0(stripping),raid1(mirror),raid4,raid5,raid6,raid10等不同的冗余级别和级成方式,当然也能支持多个RAID陈列的层叠组成raid1 0,raid5 1等类型的陈列
四.实验
试题:建立4个大小为1G的磁盘,并将其中3个创建为raid5的阵列磁盘,1个为热备份磁盘。测试热备份磁盘替换阵列中的磁盘并同步数据。移除损坏的磁盘,添加一个新磁盘作为热备份磁盘。最后要求开机自动挂载。
4.1创建磁盘
[root@xiao ~]# fdisk /dev/sda
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command (m for help): n
First cylinder (10486-13054, default 10486):
Using default value 10486
Last cylinder, +cylinders or +size{K,M,G} (10486-13054, default 13054): +1G
Command (m for help): n
First cylinder (10618-13054, default 10618):
Using default value 10618
Last cylinder, +cylinders or +size{K,M,G} (10618-13054, default 13054): +1G
Command (m for help): n
First cylinder (10750-13054, default 10750):
Using default value 10750
Last cylinder, +cylinders or +size{K,M,G} (10750-13054, default 13054): +1G
Command (m for help): n
First cylinder (10882-13054, default 10882):
Using default value 10882
Last cylinder, +cylinders or +size{K,M,G} (10882-13054, default 13054): +1G
Command (m for help): t
Partition number (1-8): 8
Hex code (type L to list codes): fd
Changed system type of partition 8 to fd (Linux raid autodetect)
Command (m for help): t
Partition number (1-8): 7
Hex code (type L to list codes): fd
Changed system type of partition 7 to fd (Linux raid autodetect)
Command (m for help): t
Partition number (1-8): 6
Hex code (type L to list codes): fd
Changed system type of partition 6 to fd (Linux raid autodetect)
Command (m for help): t
Partition number (1-8): 5
Hex code (type L to list codes): fd
Changed system type of partition 5 to fd (Linux raid autodetect)
Command (m for help): p
Disk /dev/sda: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes