无法从映像挂载分区

无法从映像挂载分区

我有dd一张旧 SSD 的图像。它已经在外部硬盘上放置了一段时间,但我之前已经能够安装该映像及其分区。现在,由于某种原因,我只能挂载 EFI 分区(第一个分区),但其余的文件系统无法识别。此外,根本不再检测到 LVM2 分区。

挂载img文件:

ubuntu > sudo losetup -f -P /mnt/d/Disks/Toshiba/ssd-backup.gpt.img
ubuntu > lsblk
NAME      MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0       7:0    0 238.5G  0 loop
├─loop0p1 259:0    0   100M  0 part
├─loop0p2 259:1    0   128M  0 part
├─loop0p3 259:2    0    50G  0 part
├─loop0p4 259:3    0   200M  0 part
├─loop0p5 259:4    0   200M  0 part
├─loop0p6 259:5    0    50G  0 part
└─loop0p7 259:6    0   100G  0 part
...

检查映像和安装点的分区信息以确保它们相同:

ubuntu > gdisk -l /mnt/d/Disks/Toshiba/ssd-backup.gpt.img
GPT fdisk (gdisk) version 1.0.5

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

Found valid GPT with protective MBR; using GPT.
Disk /mnt/d/Disks/Toshiba/ssd-backup.gpt.img: 500118192 sectors, 238.5 GiB
Sector size (logical): 512 bytes
Disk identifier (GUID): 74230653-CCAA-49B1-B5F7-7A901F6960BE
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 500118158
Partitions will be aligned on 2048-sector boundaries
Total free space is 79400926 sectors (37.9 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          206847   100.0 MiB   EF00  EFI system partition
   2          206848          468991   128.0 MiB   0C01  Microsoft reserved ...
   3          468992       105326591   50.0 GiB    0700  Basic data partition
   4       105326592       105736191   200.0 MiB   8300  Linux filesystem
   5       105736192       106145791   200.0 MiB   8300  Linux filesystem
   6       106145792       211003391   50.0 GiB    0700  Basic data partition
   7       290402304       500118158   100.0 GiB   8E00  Linux LVM

ubuntu > sudo gdisk -l /dev/loop0
GPT fdisk (gdisk) version 1.0.5

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

Found valid GPT with protective MBR; using GPT.
Disk /dev/loop0: 500118192 sectors, 238.5 GiB
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 74230653-CCAA-49B1-B5F7-7A901F6960BE
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 500118158
Partitions will be aligned on 2048-sector boundaries
Total free space is 79400926 sectors (37.9 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          206847   100.0 MiB   EF00  EFI system partition
   2          206848          468991   128.0 MiB   0C01  Microsoft reserved ...
   3          468992       105326591   50.0 GiB    0700  Basic data partition
   4       105326592       105736191   200.0 MiB   8300  Linux filesystem
   5       105736192       106145791   200.0 MiB   8300  Linux filesystem
   6       106145792       211003391   50.0 GiB    0700  Basic data partition
   7       290402304       500118158   100.0 GiB   8E00  Linux LVM

lsblk无论出于何种原因,都没有在任何地方检测到任何文件系统:

ubuntu > sudo lsblk -f
NAME      FSTYPE LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
loop0
├─loop0p1
├─loop0p2
├─loop0p3
├─loop0p4
├─loop0p5
├─loop0p6
└─loop0p7
sda
sdb
sdc                          236.1G     1% /

尝试挂载 Linux 文件系统之一(分区 4,但尝试 5 是相同的):

ubuntu > sudo mount /dev/loop0p4 /tmp/mnt
mount: /tmp/mnt: wrong fs type, bad option, bad superblock on /dev/loop0p4, missing codepage or helper program, or other error.
ubuntu > sudo mount -t ext3 /dev/loop0p4 /tmp/mnt
mount: /tmp/mnt: wrong fs type, bad option, bad superblock on /dev/loop0p4, missing codepage or helper program, or other error.
ubuntu > sudo mount -t ext4 /dev/loop0p4 /tmp/mnt
mount: /tmp/mnt: wrong fs type, bad option, bad superblock on /dev/loop0p4, missing codepage or helper program, or other error.
ubuntu > sudo mount -t btrfs /dev/loop0p4 /tmp/mnt
mount: /tmp/mnt: wrong fs type, bad option, bad superblock on /dev/loop0p4, missing codepage or helper program, or other error.
ubuntu > sudo btrfs device scan -d /dev/loop0p4
Scanning for Btrfs filesystems
ubuntu >

尝试扫描 LVM 文件系统:

ubuntu > sudo pvdisplay /dev/loop0p7
  Failed to find physical volume "/dev/loop0p7".
ubuntu > sudo pvscan
  No matching physical volumes found
ubuntu > sudo lvdisplay /dev/loop0p7
  Volume group "loop0p7" not found
  Cannot process volume group loop0p7
ubuntu > sudo vgscan
ubuntu > sudo vgdisplay
ubuntu >

尽管如此,磁盘映像和第一个分区仍然正确安装:

ubuntu > sudo mount /dev/loop0p1 /tmp/mnt
ubuntu > ll /tmp/mnt
total 11531
drwxr-xr-x  3 root root    1024 Dec 31  1969 ./
drwxrwxrwt 12 root root    4096 Jan 23 19:44 ../
drwxr-xr-x  7 root root    1024 Sep  4  2014 EFI/

我不知道从这里该去哪里。从周日开始,我尝试了 5 种方法来在这些分区中挂载文件系统,但没有成功。我什至从磁盘 img 中提取了分区 img 文件,但也无法使用这些文件(因此这似乎不是由分区是较大磁盘映像的一部分引起的)。

ubuntu > sudo losetup -f -P /mnt/d/Disks/Toshiba/ssd-backup.gpt/6.Linux\ LVM.img
ubuntu > lsblk
NAME      MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0       7:0    0 238.5G  0 loop
├─loop0p1 259:0    0   100M  0 part /tmp/mnt
├─loop0p2 259:1    0   128M  0 part
├─loop0p3 259:2    0    50G  0 part
├─loop0p4 259:3    0   200M  0 part
├─loop0p5 259:4    0   200M  0 part
├─loop0p6 259:5    0    50G  0 part
└─loop0p7 259:6    0   100G  0 part
loop1       7:1    0   100G  0 loop
sda         8:0    0   256G  0 disk
sdb         8:16   0 339.8M  1 disk
sdc         8:32   0   256G  0 disk /
ubuntu > sudo pvdisplay /dev/loop1
  Failed to find physical volume "/dev/loop1".

非常感谢任何帮助,我需要弄清楚如何恢复这些数据。

相关内容