ay UUID : 921a8946:b273e00e:3fa4b99d:040a4437
Name : omv30:raid1 (local to host omv30)
Creation Time : Sun Sep 30 22:31:39 2018
Raid Level : raid1
Raid Devices : 2
Avail Dev Size : 2095104 (1023.00 MiB 1072.69 MB)
Array Size : 1047552 (1023.00 MiB 1072.69 MB)
Data Offset : 2048 sectors
Super Offset : 8 sectors
Unused Space : before=1960 sectors, after=0 sectors
State : clean
Device UUID : 6e545465:3dcf10df:1d5bb938:fe840307
Update Time : Mon Oct 1 19:52:46 2018
Bad Block Log : 512 entries available at offset 72 sectors
Checksum : a47a7d1f - correct
Events : 29
Device Role : Active device 0
Array State : AA ('A' == active, '.' == missing, 'R' == replacing)
root@omv30:~# cat /proc/mdstat
Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10]
md0 : active (auto-read-only) raid1 sdb[0] sdc[1]
1047552 blocks super 1.2 [2/2] [UU]
unused devices: <none>
root@omv30:~# fdisk -l
...(省略)
Disk /dev/md0: 1023 MiB, 1072693248 bytes, 2095104 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
mount后访问正常。
2、更换硬盘位置测试
关机,新增一块硬盘,占用原来sdc的位置,启动:
root@omv30:~# mdadm -D /dev/md0
/dev/md0:
Version : 1.2
Creation Time : Sun Sep 30 22:31:39 2018
Raid Level : raid1
Array Size : 1047552 (1023.00 MiB 1072.69 MB)
Used Dev Size : 1047552 (1023.00 MiB 1072.69 MB)
Raid Devices : 2
Total Devices : 2
Persistence : Superblock is persistent
Update Time : Mon Oct 1 19:52:46 2018
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
Name : omv30:raid1 (local to host omv30)
UUID : 921a8946:b273e00e:3fa4b99d:040a4437
Events : 29
Number Major Minor RaidDevice State
0 8 16 0 active sync /dev/sdb
1 8 48 1 active sync /dev/sdd
root@omv30:~# cat /proc/mdstat
Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10]
md0 : active (auto-read-only) raid1 sdb[0] sdd[1]
1047552 blocks super 1.2 [2/2] [UU]
unused devices: <none>
原来的sdc变成了sdc,raid1还完好保存,不受影响。
3、移除硬盘测试
关机,然后移除一块硬盘,启动:
root@omv30:~# mdadm -D /dev/md0
/dev/md0:
Version : 1.2
Raid Level : raid0
Total Devices : 1
Persistence : Superblock is persistent
State : inactive
Name : omv30:raid1 (local to host omv30)
UUID : 921a8946:b273e00e:3fa4b99d:040a4437
Events : 29
Number Major Minor RaidDevice
- 8 16 - /dev/sdb
root@omv30:~# mdadm --query /dev/sdb
/dev/sdb: is not an md array
/dev/sdb: device 0 in 2 device undetected raid1 /dev/md0. Use mdadm --examine for more detail.
root@omv30:~# mdadm --examine /dev/sdb
/dev/sdb:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : 921a8946:b273e00e:3fa4b99d:040a4437
Name : omv30:raid1 (local to host omv30)
Creation Time : Sun Sep 30 22:31:39 2018
Raid Level : raid1
Raid Devices : 2
Avail Dev Size : 2095104 (1023.00 MiB 1072.69 MB)
Array Size : 1047552 (1023.00 MiB 1072.69 MB)
Data Offset : 2048 sectors
Super Offset : 8 sectors
Unused Space : before=1960 sectors, after=0 sectors
State : clean
Device UUID : 6e545465:3dcf10df:1d5bb938:fe840307
Update Time : Mon Oct 1 19:52:46 2018
Bad Block Log : 512 entries available at offset 72 sectors
Checksum : a47a7d1f - correct
Events : 29
Device Role : Active device 0
Array State : AA ('A' == active, '.' == missing, 'R' == replacing)
root@omv30:~# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md0 : inactive s