2

I have a disk which has a corrputed alternate GPT and Linux doesn't want to read the primary one.

I see all sorts of weird messages in the kernel logs. Here's what happens when I plug in the drive.

[ 1030.358675] usb 3-1: new SuperSpeed USB device number 14 using xhci_hcd
[ 1030.378105] scsi host4: uas
[ 1030.379592] scsi 4:0:0:0: Direct-Access     Seagate  Expansion        9300 PQ: 0 ANSI: 6
[ 1030.408991] sd 4:0:0:0: Attached scsi generic sg1 type 0
[ 1030.409144] sd 4:0:0:0: [sdb] Spinning up disk...
[ 1031.438623] .
[ 1032.451912] .
[ 1033.465247] .
[ 1034.478653] .
[ 1034.478938] ready
[ 1034.479056] sd 4:0:0:0: [sdb] 2930277167 512-byte logical blocks: (1.50 TB/1.36 TiB)
[ 1035.549485] sd 4:0:0:0: [sdb] Write Protect is off
[ 1035.549488] sd 4:0:0:0: [sdb] Mode Sense: 4f 00 00 00
[ 1035.549640] sd 4:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 1068.039214] sd 4:0:0:0: [sdb] tag#2 uas_eh_abort_handler 0 uas-tag 3 inflight: CMD IN 
[ 1068.039218] sd 4:0:0:0: [sdb] tag#2 CDB: opcode=0x28 28 00 ae a8 7b 2a 00 00 01 00
[ 1068.039304] sd 4:0:0:0: [sdb] tag#1 uas_eh_abort_handler 0 uas-tag 2 inflight: CMD IN 
[ 1068.039307] sd 4:0:0:0: [sdb] tag#1 CDB: opcode=0x28 28 00 ae a8 7b 29 00 00 01 00
[ 1068.039336] sd 4:0:0:0: [sdb] tag#0 uas_eh_abort_handler 0 uas-tag 1 inflight: CMD IN 
[ 1068.039340] sd 4:0:0:0: [sdb] tag#0 CDB: opcode=0x28 28 00 ae a8 7b 28 00 00 01 00
[ 1068.039389] scsi host4: uas_eh_bus_reset_handler start
[ 1068.152519] usb 3-1: reset SuperSpeed USB device number 14 using xhci_hcd
[ 1068.170382] scsi host4: uas_eh_bus_reset_handler success

And as soon as I forcefully plug it out, I get:

[  757.393131] Alternate GPT is invalid, using primary GPT.
[  757.393148]  sdb: sdb1 sdb3

This log entry seems to reflect that the primary GPT is valid and has the missing partitions. However, fdisk, parted and even dd get stuck when I try to read or write something to the block device, so I can't recover it by hand.

I looked into using a hex editor to overwrite the alt GPT with the primary one but as I mentioned, I/O to the disk is stuck.

If this is relevant, the disk is a Seagate one and has a LUKS partition and a NTFS partition and the table is a GUID partition table.

  • Does gdisk see the partition table? – fpmurphy Feb 20 '17 at 14:08
  • @fpmurphy1 nope. There's literally no I/O to the drive and everything from dd to gdisk is stuck. – Umang Raghuvanshi Feb 20 '17 at 14:47
  • Sounds like mechanical or electrical failure of the drive. Does a Windows system see the disk? – fpmurphy Feb 20 '17 at 15:01
  • Agree with @fpmurphy1 this sounds like a drive failure. Use another OS to test, sysrescuecd?, Windoze? Or put it in another linux box. Use gdisk to read and manipulate GPT tables, not fdisk. gdisk has "recovery and transformation options" that will allow you to examine and/or correct GPT partition table. In particular you may want to look at those tools/options if your disk is not fried. – bsd Feb 24 '17 at 12:04
  • What makes you think the alternate GPT is still readable? – phg Feb 24 '17 at 12:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.