0

I have a dd image of an old SSD. It's been sitting on an external HDD for a while, but I have previously been able to mount the image and its partitions. Now, for some reason, I can only mount the EFI partition (the first partition) but the filesystems for the rest are not recognized. Furthermore, a LVM2 partition is no longer detected at all.

Mounting the img file:

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 ... 

Checking the partition info for the image & the mount points to ensure they are the same:

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 does not detect any file systems anywhere for whatever reason:

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% / 

Attempting to mount one of the Linux filesystems (partition 4 but trying 5 is the same):

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 > 

Trying to scan for LVM filesystems:

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 > 

Despite all this, the disk image and first partition mount properly:

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/ 

I have no idea where to go from here. I've tried 5 ways from Sunday to mount the filesystems in these partitions with no success. I even extracted the partition img files from the disk img, and couldn't work with those either (so it doesn't seem to be caused by the partition being part of a larger disk image).

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". 

Any help is greatly appreciated, I need to figure out how to recover this data.

8
  • What does file -s /dev/loop0p? say? As a general comment, it is sensible to either make the mounts read-only or else have a copy of the image file. If this is potentially valuable data then you don't want to risk automatic changes to it as it is being mounted. Commented Jan 24, 2024 at 5:03
  • I've been trying ro and rw (working off a copy of the file so if I fubar it I can just make another copy. file just says data for all partitions, no filesystem info even for the EFI partition (p1) that mounts successfully Commented Jan 24, 2024 at 8:31
  • Great that you are working off a copy! Lets try doing things a little more manually. losetup -o 52663296K /dev/loop0 /mnt/d/Disks/Toshiba/ssd-backup.gpt.img; file -s /dev/loop0; losetup -d /dev/loop9 -if it doesn't report "data" then you could try mounting it. Just to make sure we are on the same page, the info shown by gdisk about the partitions comes from the gpt table,not from the partitions themselves. Commented Jan 24, 2024 at 9:11
  • Results: pastebin.com/ni5ZAFMk Commented Jan 24, 2024 at 15:25
  • That is a pity! I would try running cgsecurity.org/wiki/TestDisk (probably available through your package manager) on the image next, asking it to find any filesystems in the image. Commented Jan 24, 2024 at 16:42

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.