You are not logged in.

#1 2015-06-28 22:00:13

khouli
Member
Registered: 2014-12-14
Posts: 70

[SOLVED] gdisk created partition table spontaneously develops errors

I was trying to prepare a few disks for a RAID 5 array and I've run into trouble pre-partitioning my disks. It seems like partitioning goes fine but later the partition tables seem to have spontaneously gone bad:

$ gdisk /dev/sdd
GPT fdisk (gdisk) version 1.0.0

Caution! After loading partitions, the CRC doesn't check out!
Warning! Main partition table CRC mismatch! Loaded backup partition table
instead of main partition table!

Warning! One or more CRCs don't match. You should repair the disk!

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

****************************************************************************
Caution: Found protective or hybrid MBR and corrupt GPT. Using GPT, but disk
verification and recovery are STRONGLY recommended.
****************************************************************************

Command (? for help): o
This option deletes all partitions and creates a new protective MBR.
Proceed? (Y/N): y

Command (? for help): n
Partition number (1-128, default 1): 
First sector (34-3907029134, default = 2048) or {+-}size{KMGTP}: 
Last sector (2048-3907029134, default = 3907029134) or {+-}size{KMGTP}: 1877565M
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): FD00
Changed type of partition to 'Linux RAID'

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/sdd.
The operation has completed successfully.

$ sudo gdisk /dev/sdd
GPT fdisk (gdisk) version 1.0.0

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

Found valid GPT with protective MBR; using GPT.

Command (? for help): q

# enter gdisk and quit just like above 2 more times

# next time I start gdisk, it reports errors which seem to have developed spontaneously

$ sudo gdisk /dev/sdd
GPT fdisk (gdisk) version 1.0.0

Caution! After loading partitions, the CRC doesn't check out!
Warning! Main partition table CRC mismatch! Loaded backup partition table
instead of main partition table!

Warning! One or more CRCs don't match. You should repair the disk!

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

****************************************************************************
Caution: Found protective or hybrid MBR and corrupt GPT. Using GPT, but disk
verification and recovery are STRONGLY recommended.
****************************************************************************

Command (? for help):

Even if I just accept the defaults for a new partition I get the same behavior.

I also get seemingly spontaneous errors in a simpler case using sgdisk:

while true; do sgdisk -o /dev/sdd; done

The operation has completed successfully.
The operation has completed successfully.
The operation has completed successfully.
The operation has completed successfully.
The operation has completed successfully.
Caution! After loading partitions, the CRC doesn't check out!
Warning! Main partition table CRC mismatch! Loaded backup partition table
instead of main partition table!

Warning! One or more CRCs don't match. You should repair the disk!

****************************************************************************
Caution: Found protective or hybrid MBR and corrupt GPT. Using GPT, but disk
verification and recovery are STRONGLY recommended.
****************************************************************************

I'm getting this behavior from 4 different disks. Two of them passed long SMART checks in the last week and two of them are fresh out of the packaging.

What's could be going on?

Last edited by khouli (2015-06-28 23:18:30)

Offline

#2 2015-06-28 22:04:47

frostschutz
Member
Registered: 2013-11-15
Posts: 1,419

Re: [SOLVED] gdisk created partition table spontaneously develops errors

And you're using partitions in your RAID and not full disk devices? So you can rule out you're corrupting them yourself by breaking partition boundaries somehow?

There was another issue with corrupt partition tables only recently https://bbs.archlinux.org/viewtopic.php?id=198647 - might not be related, but would be interesting to know if there was a connection anyway.

Offline

#3 2015-06-28 23:18:08

khouli
Member
Registered: 2014-12-14
Posts: 70

Re: [SOLVED] gdisk created partition table spontaneously develops errors

The same commands worked when I tried them after rebooting and directly logging in as root instead of my user login. I also didn't start an X session. I'm still very confused about what was going on but I do have the RAID array up.

It took a lot of fighting with mdadm to get it to forget about previous attempts to set up the array. That might also have had something to do with it. It seemed like mdadm was still copying things between disks even after I thought I had removed the previous array attempt.

Offline

Board footer

Powered by FluxBB