安装 mdadm 阵列时遇到问题。文件系统损坏?

安装 mdadm 阵列时遇到问题。文件系统损坏?

我的服务器崩溃了,无法开机。我不关心服务器,但我想恢复使用 mdadm 镜像(raid 1)的 2 个外部 USB 驱动器上的数据。这个系统大约有 3 年的历史了,运行的是 Fedora,我猜是用 ext3 格式化的,也许是 ext4。

我从死机系统中抓取了一个驱动器,并将其连接到运行 CentOS 7(localhost)的虚拟机。 fdisk并将dmesg其显示为/dev/sdc1。我运行了:

[root@localhost ~]# **mdadm --assemble --run --force /dev/md127 /dev/sdc1**

mdadm: Merging with already-assembled /dev/md/workshed:0

mdadm: failed to add /dev/sdc1 to /dev/md/workshed:0: Device or resource busy

mdadm: /dev/md/workshed:0 has been started with 0 drives (out of 2).

(workshed 是我无法启动的旧主机的名称)

现在我在 /proc 中看到这个:

[root@localhost ~]# **cat /proc/mdstat**

Personalities : [raid1]
md127 : active raid1 sdb1[2]
  976760400 blocks super 1.2 [2/1] [_U]

unused devices: <none>
[root@localhost ~]#

看起来它已创建/dev/md127(不确定为什么是 md127)并且处于活动状态。

好的,让我们尝试安装:

[root@localhost ~]# **mkdir /mnt/test**

[root@localhost ~]# **mount /dev/md127 /mnt/test**

mount: /dev/md127: can't read superblock

[root@localhost ~]# **fsck /dev/md127**

fsck from util-linux 2.23.2
e2fsck 1.42.9 (28-Dec-2013)
fsck.ext2: Attempt to read block from filesystem resulted in short read while trying to open /dev/md127

这可能是零长度分区吗?

[root@localhost ~]# **fsck /dev/sdc1**

fsck from util-linux 2.23.2

(嗯?好的,那么我们来尝试一下 e2fsck……)

[root@localhost ~]# **e2fsck /dev/md127**
e2fsck 1.42.9 (28-Dec-2013)
e2fsck: Attempt to read block from filesystem resulted in short read  while trying to open /dev/md127

这可能是零长度分区吗?

[root@localhost ~]# **e2fsck /dev/sdc1**

e2fsck 1.42.9 (28-Dec-2013)
ext2fs_open2: Bad magic number in super-block
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/sdc1

The superblock could not be read or does not describe a correct ext2
filesystem.  If the device is valid and it really contains an ext2
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>

[root@localhost ~]# **e2fsck -b 8193 /dev/sdc1**

e2fsck 1.42.9 (28-Dec-2013)
e2fsck: Bad magic number in super-block while trying to open /dev/sdc1

The superblock could not be read or does not describe a correct ext2
filesystem.  If the device is valid and it really contains an ext2
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>

好吧,所以我肯定是做错了什么。我也尝试了 raid 1 阵列中的另一个驱动器,得到了相同的结果。当我运行 fdisk 时,我可以听到两个驱动器旋转的声音,并且可以听到它访问驱动器的声音。两个驱动器都丢失了超级块,这似乎很奇怪。有什么东西告诉我我做错了什么……诚然,我已经有一段时间没有接触过 linux 了。有什么想法可以尝试下一步吗?

-公园

相关内容