查看磁盘挂载和Raid信息
[root@host-10-105-36-41 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 446.6G 0 disk
├─sda1 8:1 0 1G 0 part /boot/efi
├─sda2 8:2 0 1G 0 part /boot
├─sda3 8:3 0 200G 0 part
│ ├─centos-root 253:0 0 100G 0 lvm /
│ └─centos-var 253:1 0 241.3G 0 lvm /var
└─sda4 8:4 0 141.3G 0 part
└─centos-var 253:1 0 241.3G 0 lvm /var
nvme0n1 259:2 0 3.5T 0 disk
└─md1 9:127 0 3.5T 0 raid1
├─data-test 253:2 0 2T 0 lvm /var/lib/test
├─data-log 253:3 0 1T 0 lvm /var/lib/log
└─data-data 253:5 0 2.9T 0 lvm /data
nvme1n1 259:0 0 3.5T 0 disk
└─md1 9:127 0 3.5T 0 raid1
├─data-test 253:2 0 2T 0 lvm /var/lib/test
├─data-log 253:3 0 1T 0 lvm /var/lib/log
└─data-data 253:5 0 2.9T 0 lvm /data
nvme2n1 259:1 0 3.5T 0 disk
└─md0 9:126 0 3.5T 0 raid1
├─data-st 253:4 0 1T 0 lvm /var/lib/st
└─data-data 253:5 0 2.9T 0 lvm /data
nvme3n1 259:3 0 3.5T 0 disk
└─md0 9:126 0 3.5T 0 raid1
├─data-st 253:4 0 1T 0 lvm /var/lib/st
└─data-data 253:5 0 2.9T 0 lvm /data
# 可以看出,这里有两个软Raid1
清理Raid信息
# 1.卸载目录
[root@localhost ~]# umount /var/lib/test
[root@localhost ~]# umount /var/lib/log
[root@localhost ~]# umount /data
[root@localhost ~]# umount /var/lib/st
# 2.停止软Raid
[root@localhost ~]# mdadm -S /dev/md0
[root@localhost ~]# mdadm -S /dev/md1
# 3.删除软Raid的配置文件
[root@localhost ~]# echo > /etc/mdadm/mdadm.conf
# 4.清理元数据,注意是每块盘
[root@localhost ~]# mdadm --zero-superblock /dev/nvme0n1
[root@localhost ~]# mdadm --zero-superblock /dev/nvme1n1
[root@localhost ~]# mdadm --zero-superblock /dev/nvme2n1
[root@localhost ~]# mdadm --zero-superblock /dev/nvme3n1
# 5.清除/etc/fstab里面的挂载信息
创建Raid
# 创建raid1
[root@localhost ~]# mdadm --create /dev/md0 --level=1 --raid-devices=2 --spare-devices=0 /dev/nvme0n1 /dev/nvme1n1
# 查看raid的详情
[root@localhost ~]# mdadm --detail /dev/md0
/dev/md0:
Version : 1.2
Creation Time : Fri Feb 17 11:05:50 2023
Raid Level : raid1
Array Size : 3750606144 (3.49 TiB 3.84 TB)
Used Dev Size : 3750606144 (3.49 TiB 3.84 TB)
Raid Devices : 2
Total Devices : 2
Persistence : Superblock is persistent
Intent Bitmap : Internal
Update Time : Thu Mar 9 15:20:36 2023
State : active
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
Consistency Policy : bitmap
Name : localhost.localdomain:0
UUID : d8229e82:f16763a3:107d988d:3b5a783a
Events : 931
Number Major Minor RaidDevice State
0 259 2 0 active sync /dev/nvme0n1
1 259 0 1 active sync /dev/nvme1n1
标签:Raid,root,Nvme,dev,Centos7,var,253,data,localhost
From: https://www.cnblogs.com/yuhaohao/p/17198599.html