我有一个新客户,他的旧服务器出现故障(由于 CPU 故障,它无法再启动)。
不幸的是,客户没有备份我正在尝试从硬盘恢复数据(服务器有2 个 SATA 硬盘和2 个软件 RAID1 卷)。
我使用 USB 适配器连接了硬盘,并且可以看到 RAID 卷:
root@sysresccd /root % fdisk -l /dev/sdd
Disk /dev/sdd: 149.1 GiB, 160041009152 bytes, 312580096 sectors
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: 0x00058ff6
Device Boot Start End Sectors Size Id Type
/dev/sdd1 * 2048 310484991 310482944 148.1G fd Linux raid autodetect
/dev/sdd2 310487038 312580095 2093058 1022M 5 Extended
/dev/sdd5 310487040 312580095 2093056 1022M fd Linux raid autodetect
RAID 卷将被自动发现:
root@sysresccd /root % mdadm -E --scan
ARRAY /dev/md/0 metadata=1.2 UUID=eb090ee2:954e393d:b4575a0a:9b185fd2 name=data:0
ARRAY /dev/md/1 metadata=1.2 UUID=5417558e:46ab5709:79d76af5:567916e7 name=data:1
而且它们看起来不错:
root@sysresccd /root % mdadm --examine /dev/sdd1
/dev/sdd1:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : eb090ee2:954e393d:b4575a0a:9b185fd2
Name : Erredieci:0
Creation Time : Fri Apr 12 11:35:10 2013
Raid Level : raid1
Raid Devices : 2
Avail Dev Size : 310220800 (147.92 GiB 158.83 GB)
Array Size : 155110272 (147.92 GiB 158.83 GB)
Used Dev Size : 310220544 (147.92 GiB 158.83 GB)
Data Offset : 262144 sectors
Super Offset : 8 sectors
Unused Space : before=262064 sectors, after=256 sectors
State : clean
Device UUID : 82a2f3b0:f94bbb41:c5d52ae6:6b6d27e1
Update Time : Mon Mar 19 19:41:36 2018
Checksum : f90e94f7 - correct
Events : 574
Device Role : Active device 0
Array State : AA ('A' == active, '.' == missing, 'R' == replacing)
root@sysresccd /root % mdadm --examine /dev/sdd5
/dev/sdd5:
Magic : a92b4efc
Version : 1.2
Feature Map : 0x0
Array UUID : 5417558e:46ab5709:79d76af5:567916e7
Name : Erredieci:1
Creation Time : Fri Apr 12 11:36:28 2013
Raid Level : raid1
Raid Devices : 2
Avail Dev Size : 2092032 (1021.50 MiB 1071.12 MB)
Array Size : 1045952 (1021.44 MiB 1071.05 MB)
Used Dev Size : 2091904 (1021.44 MiB 1071.05 MB)
Data Offset : 1024 sectors
Super Offset : 8 sectors
Unused Space : before=944 sectors, after=128 sectors
State : clean
Device UUID : bd9f0ff3:8d373ef1:95a2bfc0:1e2a7c7d
Update Time : Mon Mar 19 18:06:16 2018
Checksum : b505e632 - correct
Events : 22
Device Role : Active device 0
Array State : AA ('A' == active, '.' == missing, 'R' == replacing)
RAID 卷安装为/dev/md126和/dev/md127:
root@sysresccd /root % ls -l /dev/md/
total 0
lrwxrwxrwx 1 root root 8 Apr 28 19:46 data:0 -> ../md126
lrwxrwxrwx 1 root root 8 Apr 28 18:35 data:1 -> ../md127
最大的问题是我无法安装任何卷:
root@sysresccd /root % mount /dev/md126 /mnt/usb
mount: /dev/md126: can't read superblock
root@sysresccd /root % mount /dev/md127 /mnt/usb
mount: /dev/md127: can't read superblock
我知道 RAID 卷上的文件系统应该是 ReiserFS,但不幸的是我无法确认这一点:
root@sysresccd /root % tune2fs -l /dev/md126
tune2fs 1.43.3 (04-Sep-2016)
tune2fs: Attempt to read block from filesystem resulted in short read while trying to open /dev/md126
Couldn't find valid filesystem superblock.
root@sysresccd /root % tune2fs -l /dev/md127
tune2fs 1.43.3 (04-Sep-2016)
tune2fs: Attempt to read block from filesystem resulted in short read while trying to open /dev/md127
Couldn't find valid filesystem superblock.
我尝试通过重新创建超级块来修复文件系统,但是没有成功:
root@sysresccd /root % fsck.reiser4 /dev/md126
*******************************************************************
This is an EXPERIMENTAL version of fsck.reiser4. Read README first.
*******************************************************************
Fscking the /dev/md126 block device.
Will check the consistency of the Reiser4 SuperBlock.
Will check the consistency of the Reiser4 FileSystem.
Continue?
(Yes/No): Yes
***** fsck.reiser4 started at Sat Apr 28 20:17:14 2018
Fatal: Can't read master super block.
Fatal: Failed to open the reiser4 backup.
Fatal: Cannot open the FileSystem on (/dev/md126).
1 fatal corruptions were detected in SuperBlock. Run with --build-sb option to fix them.
root@sysresccd /root % fsck.reiser4 --build-sb /dev/md126
*******************************************************************
This is an EXPERIMENTAL version of fsck.reiser4. Read README first.
*******************************************************************
Fscking the /dev/md126 block device.
Will build the Reiser4 SuperBlock.
Will check the consistency of the Reiser4 FileSystem.
Continue?
(Yes/No): Yes
***** fsck.reiser4 started at Sat Apr 28 20:17:22 2018
Fatal: Can't read master super block.
Master super block cannot be found on (/dev/md126). Do you want to build a new one?
(Yes/No): Yes
Which block size do you use? [4096]:
Warn : A new master superblock is created on '/dev/md126'.
Error: Can't read format40 super block. Input/output error.
Fatal: Can't open disk-format format40.
Enter the key plugin name [key_large]:
Enter the correct block count please [38777568]:
Warn : The format 'format40' is created on '/dev/md126'.
Fatal: Can't read status block.
Warn : Creating a new status block.
Error: Can't read bitmap block 18. Input/output error.
Error: Can't load ondisk bitmap.
Error: Can't initialize block allocator.
Fatal: Failed to open the block allocator.
Fatal: Cannot synchronize file "/dev/md126"
Operational error occurred while fscking.
奇怪的是,我在两个硬盘上得到了相同的结果。
所以我尝试使用救援将 /dev/md126 转储到新分区:
root@sysresccd /root % ddrescue --force /dev/md126 /dev/sde1 ddrescue.log
它没有任何错误地完成,但我无法安装它:
root@sysresccd /root % mount -t reiserfs /dev/sde1 /mnt/usb
mount: wrong fs type, bad option, bad superblock on /dev/sde1,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
并且它没有被识别并且没有一个好的分区:
root@sysresccd /root % file -s /dev/sde1
/dev/sde1: data
请问你能帮帮我吗?
您知道如何恢复我客户的数据吗?
谢谢!