1
Here is the problem. I part all disks into 4 partitions. Use all disk partition one to create raid1(md0). However, after reboot some of the raid members lost, the raid is degraded. Use blkid to check the UUID and fount it lost.
Create command:
mdadm -C ${RAID_CHECK} -l 1 -n ${disk_num} ${disk_str};
and then write config:
mdadm --detail --scan > /etc/mdadm.conf
After creating:
mdadm -D /dev/md0 shows:
[root@afa_primary ~]# mdadm -D /dev/md0
/dev/md0:
Version : 1.2
Creation Time : Fri Jul 26 13:58:44 2019
Raid Level : raid1
Array Size : 1039360 (1015.00 MiB 1064.30 MB)
Used Dev Size : 1039360 (1015.00 MiB 1064.30 MB)
Raid Devices : 8
Total Devices : 8
Persistence : Superblock is persistent
Update Time : Mon Jul 29 11:10:54 2019
State : clean
Active Devices : 8
Working Devices : 8
Failed Devices : 0
Spare Devices : 0
Consistency Policy : resync
Name : afa_primary:0 (local to host afa_primary)
UUID : 5645af3f:a0bc4deb:8f876e72:0520f210
Events : 149
Number Major Minor RaidDevice State
0 259 7 0 active sync /dev/nvme1n1p1
1 259 2 1 active sync /dev/nvme2n1p1
2 259 23 2 active sync /dev/nvme3n1p1
8 259 18 3 active sync /dev/nvme4n1p1
9 259 27 4 active sync /dev/nvme5n1p1
10 259 38 5 active sync /dev/nvme6n1p1
6 259 14 6 active sync /dev/nvme7n1p1
11 259 42 7 active sync /dev/nvme8n1p1
use blkid to check every member:
[root@afa_primary ~]# blkid /dev/nvme4n1p1
/dev/nvme4n1p1: UUID="5645af3f-a0bc-4deb-8f87-6e720520f210" UUID_SUB="82e5c45d-857e-b54b-f4d8-c1f8a83e61a1" LABEL="afa_primary:0" TYPE="linux_raid_member" PARTLABEL="primary" PARTUUID="9cb306a4-527f-47ec-a134-f0272b185108"
You have new mail in /var/spool/mail/root
[root@afa_primary ~]# blkid /dev/nvme5n1p1
/dev/nvme5n1p1: UUID="5645af3f-a0bc-4deb-8f87-6e720520f210" UUID_SUB="bfe17ad0-3209-47c0-54df-853c0e59618d" LABEL="afa_primary:0" TYPE="linux_raid_member" PARTLABEL="primary" PARTUUID="79e1b000-51e3-4742-8f9c-8c0eb9ab29cc"
[root@afa_primary ~]#
My disk list is:
[root@afa_primary ~]# nvme list
Node SN Model Namespace Usage Format FW Rev
---------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- --------
/dev/nvme0n1 PHHH9012029A128A INTEL SSDPEKKA128G8 1 128.04 GB / 128.04 GB 512 B + 0 B 006D
/dev/nvme1n1 FL191900274 P5510DS0384T00 1 3.84 TB / 3.84 TB 512 B + 0 B 224003K0
/dev/nvme2n1 FL191900379 P5510DS0384T00 1 3.84 TB / 3.84 TB 512 B + 0 B 224003K0
/dev/nvme3n1 FL191900343 P5510DS0384T00 1 3.84 TB / 3.84 TB 512 B + 0 B 224003K0
/dev/nvme4n1 FL191900355 P5510DS0384T00 1 3.84 TB / 3.84 TB 512 B + 0 B 224003K0
/dev/nvme5n1 FL191900222 P5510DS0384T00 1 3.84 TB / 3.84 TB 512 B + 0 B 224003K0
/dev/nvme6n1 FL191900349 P5510DS0384T00 1 3.84 TB / 3.84 TB 512 B + 0 B 224003K0
/dev/nvme7n1 FL191900372 P5510DS0384T00 1 3.84 TB / 3.84 TB 512 B + 0 B 224003K0
/dev/nvme8n1 FL191900214 P5510DS0384T00 1 3.84 TB / 3.84 TB 512 B + 0 B 224003K0
after reboot,
[root@afa_primary ~]# mdadm -D /dev/md0
/dev/md0:
Version : 1.2
Creation Time : Mon Jul 29 11:54:37 2019
Raid Level : raid1
Array Size : 1039360 (1015.00 MiB 1064.30 MB)
Used Dev Size : 1039360 (1015.00 MiB 1064.30 MB)
Raid Devices : 8
Total Devices : 4
Persistence : Superblock is persistent
Update Time : Mon Jul 29 11:54:42 2019
State : clean, degraded
Active Devices : 4
Working Devices : 4
Failed Devices : 0
Spare Devices : 0
Consistency Policy : resync
Name : afa_primary:0 (local to host afa_primary)
UUID : a4ed7a9d:dae6864e:3d03a4ed:6c0d7145
Events : 17
Number Major Minor RaidDevice State
0 259 27 0 active sync /dev/nvme1n1p1
1 259 15 1 active sync /dev/nvme2n1p1
2 259 33 2 active sync /dev/nvme3n1p1
- 0 0 3 removed
- 0 0 4 removed
- 0 0 5 removed
6 259 10 6 active sync /dev/nvme7n1p1
- 0 0 7 removed
You have new mail in /var/spool/mail/root
[root@afa_primary ~]#
Check blkid and it lost
[root@afa_primary ~]# blkid /dev/nvme4n1p1
/dev/nvme4n1p1: PTTYPE="gpt" PARTLABEL="p1" PARTUUID="2149f139-6b8c-4a85-918f-4150fbbb8931"
[root@afa_primary ~]#
Hello and welcome to the forum. This link might help you. It is about the difference between blkid and mdadm. https://unix.stackexchange.com/questions/129497/difference-between-uuid-from-blkid-and-mdadm
– Diblo Dk – 2019-07-29T11:12:24.467Thanks for you answer. What I want to say is that, when mdadm creating a raid, it produce a UUID and write it into its disk members. So use blkid, I can check that a disk is a member of a raid. When I reboot the system, the UUID in disk is lost. I had search manage websites and has no idea what is the reason and how to solve it or avoid it. – X.Niu – 2019-07-30T03:12:37.633
I'm sure the raid hasn't degraded due to the lack of UUID. It is only a problem to generate the UUID if the partitions cannot be accessed. Therefore, look for problems in communication between blkid and drives. eg. kernel, cables, bad partitions, bad disk, motherboard limits and the like. – Diblo Dk – 2019-08-07T01:51:56.230