GPT partition shown in fdisk, but gparted shows no partitions

3

This is very frustrating. I haven't been able to find anyone else with a similar problem.

First of all, my prebuilt windows PC stopped working, I can no longer turn it on, and I'm getting it sent in for repair. But first I wanted to remove the hard drive and connect it to another PC so I could recover some data on it.

So I connected this hard drive to another PC with Ubuntu, and it didn't auto-mount. So next I tried looking at the partitions with fdisk -l:

Disk /dev/sdb: 931.5 GiB, 1000204886016 bytes, 244190646 sectors
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: dos
Disk identifier: 0x00000000

Device     Boot Start        End    Sectors Size Id Type
/dev/sdb1           1 4294967295 4294967295  16T ee GPT

Okay, no problem there. Next I tried to mount the partition manually:

$ sudo mount -t ntfs /dev/sdb1 /windows
ntfs-3g: Failed to access volume '/dev/sdb1': No such file or directory

That didn't work. I then tried looking at it in gparted, and it shows the entire sdb disk as unallocated space. I don't understand. /dev/sdb1 clearly exists because it shows up in fdisk, and there were no problems accessing this partition on my windows PC. Now that since I've connected it to another PC, it seems to have lost its partition table? But not quite, because it does show that /dev/sdb1 partition with fdisk. I'm not sure what's going on.

I also tried looking at it with gdisk:

$ sudo gdisk /dev/sdb
GPT fdisk (gdisk) version 1.0.1

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

Creating new GPT entries.

Command (? for help): i
No partitions

So gdisk and gparted both think this disk has no partitions, but fdisk clearly shows a partition. Can anyone tell me what the issue is here?

hard-drive
mount
gpt
asked on Super User Apr 26, 2017 by warpio • edited Dec 27, 2018 by Kamil Maciorowski

1 Answer

5

Read this: Why is my USB drive showing corrupted data when plugged as an internal SATA drive?

The answer there states:

The enclosure exposes the drive to the computer as an Advanced Format 4Kn device, allowing the use of MBR for compatibility with Windows XP systems. When the drive is removed from the enclosure, the change in logical sector format results in an invalid partition table.

I guess your situation is the opposite: you had a working internal SATA drive that seems "corrupted" now, when you connect it via USB.

The issue is your disk is now seen with Sector size (logical/physical): 4096 bytes / 4096 bytes, while it used to be 512 bytes / 4096 bytes.

It seems your protective MBR describes the partition of the maximal size supported by MBR. It was 2 TiB when the logical sector size was 512 B (despite the fact your disk is less than 1 TiB), it's 16 TiB now.

GPT may still be intact, but because it starts at sector 1 (LBA 1) by definition, it was created at the 512 B offset from the beginning of the drive when the logical sector size was 512 B. Now LBA 1 means 4096 B offset – like the old LBA 8 did. That's why gparted and gdisk cannot see your GPT, they look at the wrong place.

Solution: connect the drive directly to motherboard and let it have Sector size (logical/physical): 512 bytes / 4096 bytes again.

I hope you haven't done any "recovering" yet with inappropriate logical sector size. It could make the things worse.

answered on Super User Apr 26, 2017 by Kamil Maciorowski • edited Apr 27, 2017 by Kamil Maciorowski

User contributions licensed under CC BY-SA 3.0