0으로 채워진 파티션이 있고 /dev/sda1
이를 /dev/sdb1
Linux RAID에 넣었습니다.
# mdadm --create /dev/md0 --level=1 --raid-disks=2 --metadata 1.0 /dev/sda1 /dev/sdb1
mdadm: array /dev/md0 started.
#
# cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sdb1[1] sda1[0]
487360 blocks super 1.0 [2/2] [UU]
unused devices: <none>
#
그것이 중요하다면 둘 다 한때 다른 거울의 일부 /dev/sda1
였습니다 . /dev/sdb1
이제 다음을 사용하여 새로 생성된 md0
미러를 중지 mdadm --stop --scan
하고 다음을 사용하여 모든 어레이를 재조립하려고 하면 다음을 사용 하여 쉬거나 미러링할 때 더 이상 찾을 수 없습니다 mdadm --assemble --scan
./dev/md0
# cat /proc/mdstat
Personalities : [raid1]
md3 : active raid1 sda4[2] sdb4[1]
892150784 blocks super 1.2 [2/2] [UU]
bitmap: 0/7 pages [0KB], 65536KB chunk
md2 : active raid1 sda3[2] sdb3[1]
29280256 blocks super 1.2 [2/2] [UU]
md1 : active raid1 sda2[2] sdb2[1]
15617024 blocks super 1.2 [2/2] [UU]
unused devices: <none>
#
자세한 출력을 사용하여 배열을 어셈블하려고 하면 md0
슈퍼블록이 없다는 메시지가 표시되고 다음과 같은 메시지가 나타납니다./dev/sda1
/dev/sdb1
# mdadm -vv --assemble /dev/md0
mdadm: looking for devices for /dev/md0
mdadm: no RAID superblock on /dev/md/3
mdadm: no RAID superblock on /dev/md/2
mdadm: no RAID superblock on /dev/md/1
mdadm: no RAID superblock on /dev/sde2
mdadm: no RAID superblock on /dev/sde1
mdadm: no RAID superblock on /dev/sde
mdadm: no RAID superblock on /dev/sr1
mdadm: no RAID superblock on /dev/sdc
mdadm: no RAID superblock on /dev/sdd
mdadm: cannot open device /dev/sr0: No medium found
mdadm: /dev/sdb4 has wrong uuid.
mdadm: /dev/sdb3 has wrong uuid.
mdadm: /dev/sdb2 has wrong uuid.
mdadm: no RAID superblock on /dev/sdb1
mdadm: no RAID superblock on /dev/sdb
mdadm: /dev/sda4 has wrong uuid.
mdadm: /dev/sda3 has wrong uuid.
mdadm: /dev/sda2 has wrong uuid.
mdadm: no RAID superblock on /dev/sda1
mdadm: no RAID superblock on /dev/sda
mdadm: no RAID superblock on /dev/loop0
#
그러나 RAID1 구성원의 슈퍼블록 데이터를 확인하면 슈퍼블록 데이터가 존재한다는 것을 알 수 있습니다.
# mdadm --misc -E /dev/sda1
/dev/sda1:
Magic : a92b4efc
Version : 1.0
Feature Map : 0x0
Array UUID : 5a0545c5:e5b8c31b:0982665c:0cdfe114
Name : ubuntu:0 (local to host ubuntu)
Creation Time : Wed Apr 7 14:21:25 2021
Raid Level : raid1
Raid Devices : 2
Avail Dev Size : 974816 (476.06 MiB 499.11 MB)
Array Size : 487360 (476.02 MiB 499.06 MB)
Used Dev Size : 974720 (476.02 MiB 499.06 MB)
Super Offset : 974832 sectors
Unused Space : before=0 sectors, after=104 sectors
State : clean
Device UUID : 51c870bf:c75f1072:ff17ffcb:0d794b70
Update Time : Wed Apr 7 14:21:27 2021
Bad Block Log : 512 entries available at offset -8 sectors
Checksum : c908caac - correct
Events : 17
Device Role : Active device 0
Array State : AA ('A' == active, '.' == missing, 'R' == replacing)
#
# mdadm --misc -E /dev/sdb1
/dev/sdb1:
Magic : a92b4efc
Version : 1.0
Feature Map : 0x0
Array UUID : 5a0545c5:e5b8c31b:0982665c:0cdfe114
Name : ubuntu:0 (local to host ubuntu)
Creation Time : Wed Apr 7 14:21:25 2021
Raid Level : raid1
Raid Devices : 2
Avail Dev Size : 974816 (476.06 MiB 499.11 MB)
Array Size : 487360 (476.02 MiB 499.06 MB)
Used Dev Size : 974720 (476.02 MiB 499.06 MB)
Super Offset : 974832 sectors
Unused Space : before=0 sectors, after=104 sectors
State : clean
Device UUID : e8517473:237cf164:8fb85c22:5ef79704
Update Time : Wed Apr 7 14:21:27 2021
Bad Block Log : 512 entries available at offset -8 sectors
Checksum : 5a978f80 - correct
Events : 17
Device Role : Active device 1
Array State : AA ('A' == active, '.' == missing, 'R' == replacing)
#
이 동작의 원인은 무엇입니까?
답변1
/etc/mdadm/mdadm.conf 파일이 다른 메타데이터 형식의 배열을 지정하는 경우 mdadm은 해당 배열만 찾고 찾지 않습니다.