安装(可能有故障的)硬盘

安装(可能有故障的)硬盘

我很久以前就有过一块 Lacie 2Big Triple RAID 硬盘,在机箱破裂之前,我没有复制一些家庭照片。我尝试将旧硬盘放入读卡器中,但无法安装磁盘。

对于第一个磁盘:

# fdisk -l
Disk /dev/sda: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model:  Disk           
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: 0x00000000

Device     Boot Start       End   Sectors   Size Id Type
/dev/sda1           1 976773167 976773167 465.8G ee GPT

我仅从 fdisk 输出中编辑了内部磁盘。

# file -sk /dev/sda
/dev/sda: DOS/MBR boot sector; partition 1 : ID=0xee, start-CHS (0x3ff,254,63), end-CHS (0x3ff,254,63), startsector 1, 1953366015 sectors, extended partition table (last)\012-  DOS/MBR boot sector\012-  GPT partition table, version 1.0, GUID: 8868abf6-211c-4f2d-9f22-44778cbe6b2b, disk size: 1953366016 sectors\012-  of 512 bytes\012- data

磁盘 1 的 gdisk:

# gdisk -l /dev/sda
GPT fdisk (gdisk) version 1.0.8

Warning! Disk size is smaller than the main header indicates! Loading
secondary header from the last sector of the disk! You should use 'v' to
verify disk integrity, and perhaps options on the experts' menu to repair
the disk.
Caution: invalid backup GPT header, but valid main header; regenerating
backup header from main header.

Warning! One or more CRCs don't match. You should repair the disk!
Main header: OK
Backup header: ERROR
Main partition table: OK
Backup partition table: ERROR

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: damaged

****************************************************************************
Caution: Found protective or hybrid MBR and corrupt GPT. Using GPT, but disk
verification and recovery are STRONGLY recommended.
****************************************************************************
Disk /dev/sda: 976773168 sectors, 465.8 GiB
Model:  Disk           
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 8868ABF6-211C-4F2D-9F22-44778CBE6B2B
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 1953365982
Partitions will be aligned on 8-sector boundaries
Total free space is 262157 sectors (128.0 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1              40          409639   200.0 MiB   EF00  EFI System Partition
   2          409640      1953103831   931.1 GiB   AF00  Mike

第二盘:

# fisk -l
Disk /dev/sda: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model:  Disk           
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

并文件:

# file -sk /dev/sda
/dev/sda: data

磁盘 2 的 gdisk:

# gdisk -l /dev/sda
GPT fdisk (gdisk) version 1.0.8

Partition table scan:
  MBR: not present
  BSD: not present
  APM: not present
  GPT: not present

Creating new GPT entries in memory.
Disk /dev/sda: 976773168 sectors, 465.8 GiB
Model:  Disk           
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 963D4F54-1270-451A-A1A0-0BEA70978DF7
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 976773134
Partitions will be aligned on 2048-sector boundaries
Total free space is 976773101 sectors (465.8 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name

据我所知,使用的是RAID1(镜像)。我没有找到这些磁盘的任何 ID。

我尝试了 DiskWarrior 并将其安装在 Mac 上,但认为 Linux 将是我的最佳选择。不过,我有点没主意了。如果您看到类似上述的磁盘,是否有任何关于如何再次安装这些磁盘并访问文件的提示?

我愿意购买或安装任何其他工具,但我需要建议。

答案1

分区大小大约是驱动器大小的两倍,因此很可能是 raid0,块大小待确定,尽管设备也支持串联...分区对齐很奇怪,40 扇区偏移...哦,好吧,它很旧。

通过反复试验来确定块大小的蹩脚方法(使用 Linux 实时环境,如系统救援或类似)。为了更好的方法,您必须查看原始数据(找到 JPEG 标头偏移量,并将其拼凑在一起。如果偏移 20K,那是因为分区对齐)。

创建只读循环设备:

# losetup --find --show --read-only /dev/sda
/dev/loop0
# losetup --find --show --read-only /dev/sdb
/dev/loop1

构建只读 mdadm raid0(无元数据):

# mdadm --build /dev/md42 \
        --level=0 --chunk=64K \
        --raid-devices=2 /dev/loop0 /dev/loop1

注意:由于某种原因,mdadm --build不允许mdadm --readonly使用选项,因此此步骤的只读性取决于循环设备的只读性。最好在副本或写时复制覆盖上进行此类尝试......

检查一下是否有什么:

# file -s /dev/md42*
/dev/md42:   DOS/MBR boot sector …
/dev/md42p1: DOS/MBR boot sector, code offset 0x3c+2, OEM-ID "mkfs.fat" …
/dev/md42p2: SGI XFS filesystem data …

分区应该始终显示(如果没有显示,请切换驱动器顺序),但这并不意味着它是可安装的。

挂载只读(使用另一层只读循环设备,因为某些文件系统仍然尝试以 ro 模式写入):

# mount -o loop,ro /dev/md42p1 /mnt
# ls /mnt
…any files?
# umount /mnt

# mount -o loop,ro /dev/md42p2 /mnt
# ls /mnt
…any files?
# umount /mnt

如果它确实挂载了,并且如果它确实列出了文件,您仍然应该找到几个大块的文件并验证其内容。有可能挂载的东西仍然损坏,因此您需要一个完整的大文件来确保。

如果任何步骤失败,请重新开始并尝试不同的块大小。

# mdadm --stop /dev/md42
# mdadm --build … --chunk=128K

冲洗并重复 64K 128K 32K 256K 16K 512K 4K ...希望它能与其中之一配合使用。

如果都不起作用,您也可以尝试使用--level=linear(无块大小)。

相关内容