![使用两个磁盘安装 raid 0 阵列时出现问题:](https://linux22.com/image/213796/%E4%BD%BF%E7%94%A8%E4%B8%A4%E4%B8%AA%E7%A3%81%E7%9B%98%E5%AE%89%E8%A3%85%20raid%200%20%E9%98%B5%E5%88%97%E6%97%B6%E5%87%BA%E7%8E%B0%E9%97%AE%E9%A2%98%EF%BC%9A.png)
我正在尝试备份未启动的 Ubuntu 系统的数据。数据位于带有两个 SSD 磁盘(/dev/nvme0n1p3 和 /dev/nvme1n1p3)的 raid0 阵列的 ext4 分区上。但我无法安装分区并在安装时出现“错误的文件系统类型、错误的选项、/dev/md2 上的错误超级块、缺少代码页或帮助程序或其他错误”。
# mdadm --assemble --run /dev/md2 /dev/nvme0n1p3 /dev/nvme1n1p3
mdadm: /dev/md2 has been started with 2 drives.
# mount /dev/md2 /mnt/md2
mount: /mnt/md2: wrong fs type, bad option, bad superblock on /dev/md2, missing codepage or helper program, or other error.
# mount -t ext4 /dev/md2 /mnt/md2
mount: /mnt/md2: wrong fs type, bad option, bad superblock on /dev/md2, missing codepage or helper program, or other error.
# dmesg | tail
[Thu Nov 24 19:55:31 2022] md2: detected capacity change from 0 to 1928589312
[Thu Nov 24 20:28:26 2022] EXT4-fs (md2): VFS: Can't find ext4 filesystem
fsck /dev/md2
正在抱怨错误的幻数,我尝试使用e2fsck
恢复备份超级块,但它没有帮助。
fsck /dev/md2
fsck from util-linux 2.36.1
e2fsck 1.46.2 (28-Feb-2021)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/md2
The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
or
e2fsck -b 32768 <device>
# mke2fs -n /dev/md2
mke2fs 1.46.2 (28-Feb-2021)
Creating filesystem with 241073664 4k blocks and 60268544 inodes
Filesystem UUID: 83d3f317-85ad-43df-986e-98edac27b774
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848
# e2fsck -b 98304 /dev/md2
e2fsck 1.46.2 (28-Feb-2021)
e2fsck: Bad magic number in super-block while trying to open /dev/md2
The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
or
e2fsck -b 32768 <device>
...
我很感谢任何帮助我解决这个问题的提示!
以下是我的设置的一些额外信息:
# fdisk -l
Disk /dev/nvme1n1: 476.94 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: SAMSUNG MZVL2512HCJQ-00B00
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x32c47eba
Device Boot Start End Sectors Size Id Type
/dev/nvme1n1p1 2048 33556479 33554432 16G fd Linux raid autodetect
/dev/nvme1n1p2 * 33556480 35653631 2097152 1G ef EFI (FAT-12/16/32)
/dev/nvme1n1p3 35653632 1000213167 964559536 459.9G fd Linux raid autodetect
Disk /dev/nvme0n1: 476.94 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: SAMSUNG MZVL2512HCJQ-00B00
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x9fd0f1b0
Device Boot Start End Sectors Size Id Type
/dev/nvme0n1p1 2048 33556479 33554432 16G fd Linux raid autodetect
/dev/nvme0n1p2 * 33556480 35653631 2097152 1G ef EFI (FAT-12/16/32)
/dev/nvme0n1p3 35653632 1000213167 964559536 459.9G fd Linux raid autodetect
Disk /dev/md2: 919.62 GiB, 987437727744 bytes, 1928589312 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 524288 bytes / 1048576 bytes
# mdadm --detail /dev/md2
/dev/md2:
Version : 1.2
Creation Time : Thu Nov 24 18:06:43 2022
Raid Level : raid0
Array Size : 964294656 (919.62 GiB 987.44 GB)
Raid Devices : 2
Total Devices : 2
Persistence : Superblock is persistent
Update Time : Thu Nov 24 18:06:43 2022
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
Layout : -unknown-
Chunk Size : 512K
Consistency Policy : none
Name : rescue:3 (local to host rescue)
UUID : 56fc7c67:5c505f86:36efce2c:4a04073d
Events : 0
Number Major Minor RaidDevice State
0 259 7 0 active sync /dev/nvme1n1p3
1 259 3 1 active sync /dev/nvme0n1p3
# cat /proc/mdstat
Personalities : [raid1] [raid0]
md2 : active raid0 nvme1n1p3[0] nvme0n1p3[1]
964294656 blocks super 1.2 512k chunks
unused devices: <none>
# fsck.ext4 -v /dev/md2
e2fsck 1.46.2 (28-Feb-2021)
ext2fs_open2: Bad magic number in super-block
fsck.ext4: Superblock invalid, trying backup blocks...
fsck.ext4: Bad magic number in super-block while trying to open /dev/md2
The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
or
e2fsck -b 32768 <device>
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 2.5G 1 loop
nvme1n1 259:0 0 476.9G 0 disk
├─nvme1n1p1 259:5 0 16G 0 part
├─nvme1n1p2 259:6 0 1G 0 part
└─nvme1n1p3 259:7 0 459.9G 0 part
└─md2 9:2 0 919.6G 0 raid0
nvme0n1 259:4 0 476.9G 0 disk
├─nvme0n1p1 259:1 0 16G 0 part
├─nvme0n1p2 259:2 0 1G 0 part
└─nvme0n1p3 259:3 0 459.9G 0 part
└─md2 9:2 0 919.6G 0 raid0
# parted -lm
BYT;
/dev/nvme0n1:512GB:nvme:512:512:msdos:SAMSUNG MZVL2512HCJQ-00B00:;
1:1049kB:17.2GB:17.2GB:::raid;
2:17.2GB:18.3GB:1074MB:xfs::boot, esp;
3:18.3GB:512GB:494GB:::raid;
Error: /dev/md2: unrecognised disk label
BYT;
/dev/md2:987GB:md:512:512:unknown:Linux Software RAID Array:;
BYT;
/dev/nvme1n1:512GB:nvme:512:512:msdos:SAMSUNG MZVL2512HCJQ-00B00:;
1:1049kB:17.2GB:17.2GB:::raid;
2:17.2GB:18.3GB:1074MB:::boot, esp;
3:18.3GB:512GB:494GB:::raid;
# file -sL /dev/md2
/dev/md2: data