1

Topic: end of file while reading /dev/sdc, The backup GPT table is corrupt

We use a VessRAID from Promise Technology connected by iSCSI via a Fedora 25 host on a Dell PowerEdge 1850 (OLD!). Running

fdisk -l 

I get the message "The backup GPT table is corrupt, but the primary appears OK, so that will be used."

I've tried various tools to fix this:

 wipefs -a /dev/sdc
/dev/sdc: 8 bytes were erased at offset 0x00000200 (gpt): 45 46 49 20 50 41 52 54
/dev/sdc: 2 bytes were erased at offset 0x000001fe (PMBR): 55 aa
/dev/sdc: calling ioctl to re-read partition table: Success

And then I run:

# gdisk /dev/sdc
GPT fdisk (gdisk) version 1.0.1

Warning! Read error 27; strange behavior now likely!
Partition table scan:
  MBR: not present
  BSD: not present
  APM: not present
  GPT: not present

Creating new GPT entries.

Command (? for help): ?
b       back up GPT data to a file
c       change a partition's name
d       delete a partition
i       show detailed information on a partition
l       list known partition types
n       add a new partition
o       create a new empty GUID partition table (GPT)
p       print the partition table
q       quit without saving changes
r       recovery and transformation options (experts only)
s       sort partitions
t       change a partition's type code
v       verify disk
w       write table to disk and exit
x       extra functionality (experts only)
?       print this menu

Command (? for help): v

No problems found. 23437498301 free sectors (10.9 TiB) available in 1
segments, the largest of which is 23437498301 (10.9 TiB) in size.

Command (? for help): p
Disk /dev/sdc: 23437498368 sectors, 10.9 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): D72DDC12-BFF8-4236-B56F-4CEFFB3A020C
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 23437498334
Partitions will be aligned on 2048-sector boundaries
Total free space is 23437498301 sectors (10.9 TiB)

Number  Start (sector)    End (sector)  Size       Code  Name

Command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): Y
OK; writing new GUID partition table (GPT) to /dev/sdc.
The operation has completed successfully.

# fdisk -l
Disk /dev/sda: 68.4 GiB, 73407820800 bytes, 143374650 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x000036ea

So all looks good. But after that I still get the below when trying to create a partition with Gparted.

end of file while reading /dev/sdc
The backup GPT table is corrupt, but the primary appears OK, so that will be used.

dmesg has this:

GPT:partition_entry_array_crc32 values don't match: 0x13b3f390 != 0x60a276b1
[23557.399720] GPT: Use GNU Parted to correct GPT errors.

I've tried to use the 'z' option with gdisk which seems to fix it but again after trying to partition I get the backup GPT error. Any ideas?

2

Re: end of file while reading /dev/sdc, The backup GPT table is corrupt

What versions of GParted and Parted are you using?

The message "end of file while reading /dev/sdc" implies to me that the libparted library encountered difficulty trying to read the backup GPT where it thought the backup was at the end of the drive.

3

Re: end of file while reading /dev/sdc, The backup GPT table is corrupt

gedakc wrote:

What versions of GParted and Parted are you using?

The message "end of file while reading /dev/sdc" implies to me that the libparted library encountered difficulty trying to read the backup GPT where it thought the backup was at the end of the drive.

From the logs above:

GPT fdisk (gdisk) version 1.0.1

And:

GParted 0.27.0 --enable-libparted-dmraid --enable-online-resize

Libparted 3.2

4

Re: end of file while reading /dev/sdc, The backup GPT table is corrupt

Those are recent GParted and Parted versions.

If you haven't already done so, I highly recommend making a backup before editing partitions with any tool.

Have you tried selecting the option in GParted to fix the GPT?

This is the same option that is presented by the parted text user interface if you are more comfortable using the command line.