Partition table to recover crashed drive

This drive was used as a primary drive for a Manjaro KDE. Hardware problems wiped the partition table.

I recreated the partition table with gdisk. I have:

sudo gdisk -l /dev/sdb
GPT fdisk (gdisk) version 1.0.1

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

Found valid GPT with hybrid MBR; using GPT.
Disk /dev/sdb: 732566646 sectors, 2.7 TiB
Logical sector size: 4096 bytes
Disk identifier (GUID): 92588189-62EA-4CF2-8597-DD1810E5C2C2
Partition table holds up to 128 entries
First usable sector is 6, last usable sector is 732566640
Partitions will be aligned on 256-sector boundaries
Total free space is 6696890 sectors (25.5 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1             256            2303   8.0 MiB     EF02  BIOS boot partition
   2            2304          264447   1024.0 MiB  8300  Linux filesystem
   3          264448       708053247   2.6 TiB     8300  Linux filesystem
   4       708053248       725870000   68.0 GiB    8200  Linux swap

part 2 is /grub
part 3 is /

I can access partition 2 but not partition 3. I get the following error:

[ 7741.127021] EXT4-fs (sdb3): bad geometry: block count 729088000 exceeds size of device (725876736 blocks)

I don’t understand why it reports the wrong block count when gdisk displays the same as fdisk -l

sudo fdisk -l /dev/sdb
Disk /dev/sdb: 2.7 TiB, 3000592982016 bytes, 732566646 sectors
Disk model: 2105            
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 92588189-62EA-4CF2-8597-DD1810E5C2C2

Device         Start       End   Sectors  Size Type
/dev/sdb1        256      2303      2048    8M BIOS boot
/dev/sdb2       2304    264447    262144    1G Linux filesystem
/dev/sdb3     264448 708053247 707788800  2.7T Linux filesystem
/dev/sdb4  708053248 725870000  17816753   68G Linux swap

Thanks

  1. Make a ddrescue copy of the device onto another device that is of equal size or larger and perform the following command on the copy:

  2. Execute:

    resize2fs /dev/XdY
    

    Where X and Y denominate the drive letters of your copy.

  3. As you seem to have had hard hardware problems, did I mention not to try and recover on the device itself but on a copy of the device?

:crossed_fingers:

I did recover through backups 80% to 90% of everything and 100% of the important stuff.

I didn’t know about that. I was using gdisk…

Thank you

That didn’t work. I got the following error message when trying to just print what resize2fs would think be the minimal size with

sudo resize2fs -P /dev/sdb

and I get

resize2fs: Bad magic number in super-block while trying to open /dev/sdb
Couldn't find valid filesystem superblock.

Thanks

:+1:

My bad! Please execute:

sudo resize2fs -P /dev/sdb1

:man_facepalming:

I finally solved my external hard drive crash/problem (if somebody else has similar problems)

Eventually, I tried GPARTED which could see the 3TB drive on the USB3 hard drive toaster.

Device > Attempt Rescue Data and magic happened. GP bypassed the partition table, read through the directories (don’t know how but it worked). I was able to copy all of my data to another drive. :slight_smile:

please marked as solved

I’ve marked this answer as the solution to your question as it is by far the best answer you’ll get.

However, if you disagree with my choice, please feel free to take any other answer as the solution to your question or even remove the solution altogether: You are in control! (If you disagree with my choice, just send me a personal message and explain why I shouldn’t have done this or :heart: or :+1: if you agree)

:innocent:
P.S. In the future, please don’t forget to come back and click the 3 dots below the answer to mark a solution like this below the answer that helped you most:
Solution
so that the next person that has the exact same problem you just had will benefit from your post as well as your question will now be in the “solved” status.

I’d love to but how do I do that. I can’t edit or change the title.

Nothing to do: I’ve already done it for you

:bowing_man:

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.