Subject: Re: bug#24930: Parted fails after reordering of partitions with fdisk

From: Phil Susi <[email-masked]>
Date: Wed, 19 Apr 2017 09:29:08 -0400

On 11/12/2016 4:55 AM, Hans Peter Würmli wrote:
> 
> My system is Debian testing and kernel version "Linux version 4.7.0-1-
> amd64 ([email-masked]) (gcc version 5.4.1 20160904
> (Debian 5.4.1-2) ) #1 SMP Debian 4.7.8-1 (2016-10-19)". 
> 
> GNU Parted has version 3.2.
> 
> I reordered partitions to their natural order using fdisk. After
> rebooting and using gparted (or parted) I get an error with
> message "Assertion (metadata_length > 0) at
> ../../../libparted/labels/dos.c:2313 in function
> add_logical_part_metadata() failed".

Finally, a clue as to how people are having this happen.  I have no idea
why fdisk has that option or why anyone would ever use it, but it seems
like that is the culprit for ending up with these goofy partition
tables.  Please provide the output of fdisk -l, as well as dd
if=/dev/sda count=1 | hd.