how to fix "CORRUPT" partition table in mirrored drive

Warren Block wblock at
Fri Jun 26 00:43:31 UTC 2015

On Thu, 25 Jun 2015, William Dudley wrote:

> Warren,
> Again, thanks for the reply.  Does the fact that gpart show -l reports this:
> =>        63  3907029104  mirror/gm0  MBR  (1.8T) [CORRUPT]
> Mean that I'm screwed and must copy all the data to a new drive and
> create the mirror anew?

Possibly.  Years back, the Handbook showed the quick but wrong way to 
create a mirror out of an existing disk with a filesystem on it.  The 
new integrity check does not like that, because the last block of a 
partition was reused.

Here, if you add up the lengths of the partitions on gm0s1, you'll find 
that it is one block longer than the size of gm0.  See the "4" versus 
"5" in the last digit of the sizes of gm0 and gm0s1?  The contents of a 
partition cannot be larger than the partition itself.

>             =>        63  3907029104  mirror/gm0  MBR  (1.8T) [CORRUPT]
>             =>         0  3907029105  mirror/gm0s1  BSD  (1.8T)

That could be fixed by shrinking the last partition by one block, but 
shrinking it will not resize the UFS filesystem on it, and possibly 
leave it unusable.  If it were me, I'd back everything up, then follow 
the new procedures in the Handbook to create the mirror correctly. 
Those procedures were extensively tested.  (Ask me how I know.)

More information about the freebsd-questions mailing list