在重启后停滞不前,我进行了硬重启,现在 mdadm 再也看不到 RAID 6 阵列了,LVM 找不到该 raid 阵列上的卷。我查看了/etc/mdadm/mdadm.conf
,它不包含我的/dev/md2
(RAID 6 阵列)。
如何在不丢失任何数据的情况下恢复 RAID 6 阵列,然后恢复 LVM 卷?
好的,我做了一个mdadm --assemble --scan
并重新组装了/dev/md2
,但它遗漏了一个驱动器。丢失的驱动器似乎已被添加到一个新的非活动阵列中:
md_d2 : inactive sdb1[3](S)
1953511936 blocks
现在将其删除并手动添加到/dev/md2
。
仍然不确定是否缺少 LVM 组和卷...
好的,重新组装阵列后,我拿回了 LVM:
root@freetunes:~# pvdisplay
--- Physical volume ---
PV Name /dev/md2
VG Name lvm-raid
PV Size 5.46 TiB / not usable 43.50 MiB
Allocatable yes (but full)
PE Size 256.00 MiB
Total PE 22356
Free PE 0
Allocated PE 22356
PV UUID sJxydW-lMTJ-fsQn-Bln1-z6Cj-Dt6F-OPxMtr
root@freetunes:~# lvdisplay
--- Logical volume ---
LV Name /dev/lvm-raid/lvm0
VG Name lvm-raid
LV UUID D7Wj1A-wiJk-NxlM-IDdH-0uM4-aF1r-Fbpjjr
LV Write Access read/write
LV Status available
# open 0
LV Size 5.46 TiB
Current LE 22356
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 1536
Block device 251:0
答案1
您是否依赖内核为您自动组装阵列?如果是这样,请仔细检查所有驱动器上的卷是否设置为正确的类型。对于 msdos 分区表,即 0xfd;对于 gpt 表,即 raid 标志。以下是正确设置自动组装的每种分区类型的示例。
# parted /dev/sda
GNU Parted 1.8.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: ATA INTEL SSDSA2M080 (scsi)
Disk /dev/sda: 80.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 4194kB 273MB 268MB primary ext3 boot, raid
2 273MB 80.0GB 79.8GB primary raid
# parted /dev/sda
GNU Parted 2.4
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: ATA WDC WD20EADS-32R (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 262kB 1074MB 1074MB ext3 boot raid
2 1074MB 35.4GB 34.4GB linux-swap(v1) swap raid
3 35.4GB 104GB 68.7GB ext4 root raid
4 104GB 2000GB 1896GB vg00 raid