从 raid0 设置重新挂载两个旧磁盘以恢复数据

Lat*_*san 6 linux raid hard-drive partitioning

我在服务器上的 RAID0 中设置了两个 500gb 磁盘,但最近遇到了硬盘故障(在启动时看到硬盘上出现 SMART 错误)。我的主机再次将 2 个新磁盘放入 RAID-0(重新安装操作系统)并在同一台机器上重新连接旧驱动器,以便我可以恢复数据。

我的旧驱动器是:

  • /dev/sdb
  • /dev/sdc

如何将这两个磁盘挂载回 RAID0,以便我们可以从旧驱动器中恢复数据?或者这不再可能了?我丢失了所有数据吗?

这是我/etc/fstabdf -h

这是我的fdisk -l

[root@localhost ~]# fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00040cf1

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      102400   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              13        1288    10240000   83  Linux
/dev/sda3            1288        2333     8388608   82  Linux swap / Solaris

Disk /dev/sdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0005159c

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1       60802   488385536   fd  Linux raid autodetect

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0006dd55

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1          26      204800   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sdb2              26        4106    32768000   82  Linux swap / Solaris
/dev/sdb3            4106        5380    10240000   83  Linux
/dev/sdb4            5380       60802   445172736    5  Extended
/dev/sdb5            5380       60802   445171712   fd  Linux raid autodetect

Disk /dev/sdd: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x9f639f63

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1               1       60802   488385536   83  Linux

Disk /dev/md127: 956.0 GB, 955960524800 bytes
2 heads, 4 sectors/track, 233388800 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 524288 bytes / 1048576 bytes
Disk identifier: 0x00000000
Run Code Online (Sandbox Code Playgroud)

我在某处读到您可以使用此命令执行此操作:mdadm -A --scan但是,它不会为我产生任何结果 -> 在配置文件中找不到数组或自动

Dar*_*oid 4

首先,确定数据的价值。如果这是您必须拥有的关键业务数据,请评估将磁盘发送给专业数据恢复服务的选项。从失效的磁盘和崩溃的 RAID 阵列中进行自我恢复总是有点遥不可及。如果您已经假设旧驱动器上的数据已丢失,并且您只是希望恢复一些数据,并且不想花费额外的钱,那么请继续。

您可能必须将阵列强制在一起。这可能会导致无声损坏,因为 RAID 知道它不干净,而您却告诉它微笑并假装它是干净的。请记住,您需要手动验证从 RAID 中提取的任何文件的完整性。

您可以将数组强制与:

mdadm --assemble --force /dev/md126 /dev/sdb5 /dev/sdc1
Run Code Online (Sandbox Code Playgroud)

如果/dev/md126您的系统上已存在该设备,请选择下一个 ( /dev/md125),直到找到空闲(不存在)的设备。

这应该会强制阵列进入工作状态。让我们以只读方式安装文件系统,以便我们可以从中提取数据而不会进一步损坏任何内容

mkdir /mnt/oldData
mount /dev/md126 /mnt/oldData -o ro
Run Code Online (Sandbox Code Playgroud)

此时,您应该能够将数据复制/mnt/oldData到安全位置或将数据复制到安全位置。