GNU bug report logs - #21070
GPT backup corruption causes parted and linux installer to crash

Previous Next

Package: parted;

Reported by: CeDeROM <cederom <at> tlen.pl>

Date: Wed, 15 Jul 2015 20:33:02 UTC

Severity: normal

Done: Phil Susi <psusi <at> ubuntu.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 21070 in the body.
You can then email your comments to 21070 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-parted <at> gnu.org:
bug#21070; Package parted. (Wed, 15 Jul 2015 20:33:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to CeDeROM <cederom <at> tlen.pl>:
New bug report received and forwarded. Copy sent to bug-parted <at> gnu.org. (Wed, 15 Jul 2015 20:33:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: CeDeROM <cederom <at> tlen.pl>
To: bug-parted <at> gnu.org
Subject: GPT backup corruption causes parted and linux installer to crash
Date: Wed, 15 Jul 2015 19:34:04 +0000
Hello,

I have bought 2x2TB disks and set it up for RAID0. I have installed
Win7 first with UEFI that created GPT partitions. I want to install
FreeBSD and Linux on it..

Using Lubuntu AMD64 14.04.02 ISO and UEFI boot I have problem with
installation. Installer crashes, so I have tried gparted it crashes as
well, and so parted, below are details.

Please advise :-)
Tomek

root <at> lubuntu:~# parted
GNU Parted 2.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Error: Invalid argument during seek for read on /dev/sda
Retry/Ignore/Cancel? r
Error: Invalid argument during seek for read on /dev/sda
Retry/Ignore/Cancel? r
Error: Invalid argument during seek for read on /dev/sda
Retry/Ignore/Cancel? i
Error: The backup GPT table is corrupt, but the primary appears OK, so that will
be used.
OK/Cancel? y
parted: invalid token: y
OK/Cancel? o
Backtrace has 8 calls on stack:
  8: /lib/x86_64-linux-gnu/libparted.so.0(ped_assert+0x31) [0x7fbc7ebf04b1]
  7: /lib/x86_64-linux-gnu/libparted.so.0(+0x3f5f6) [0x7fbc7ec205f6]
  6: /lib/x86_64-linux-gnu/libparted.so.0(ped_disk_new+0x49) [0x7fbc7ebf5f99]
  5: parted() [0x406dff]
  4: parted(interactive_mode+0x101) [0x40db71]
  3: parted(main+0x153d) [0x4065bd]
  2: /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7fbc7e3cdec5]
  1: parted() [0x406617]


You found a bug in GNU Parted! Here's what you have to do:

Don't panic! The bug has most likely not affected any of your data.
Help us to fix this bug by doing the following:

Check whether the bug has already been fixed by checking
the last version of GNU Parted that you can find at:

    http://ftp.gnu.org/gnu/parted/

Please check this version prior to bug reporting.

If this has not been fixed yet or if you don't know how to check,
please visit the GNU Parted website:

    http://www.gnu.org/software/parted

for further information.

Your report should contain the version of this release (2.3)
along with the error message below, the output of

    parted DEVICE unit co print unit s print

and the following history of commands you entered.
Also include any additional information about your setup you
consider important.

Assertion (last_usable <= disk->dev->length) at
../../../libparted/labels/gpt.c:994 in function _parse_header() failed.

Aborted (core dumped)

root <at> lubuntu:~# uname -a
Linux lubuntu 3.16.0-30-generic #40~14.04.1-Ubuntu SMP Thu Jan 15
17:43:14 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
root <at> lubuntu:~# parted --version
parted (GNU parted) 2.3
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by <http://git.debian.org/?p=parted/parted.git;a=blob_plain;f=AUTHORS>.


-- 
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info




Information forwarded to bug-parted <at> gnu.org:
bug#21070; Package parted. (Wed, 15 Jul 2015 20:59:02 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: CeDeROM <cederom <at> tlen.pl>
To: bug-parted <at> gnu.org
Subject: Re: GPT backup corruption causes parted and linux installer to crash
Date: Wed, 15 Jul 2015 19:39:45 +0000
I have found a solution for that - use GDISK and rewrite GPT partition table.

Still, it would be nice parted to do the job :-)

root <at> lubuntu:~# gdisk
The program 'gdisk' can be found in the following packages:
 * gdisk
 * gdisk-noicu
Try: apt-get install <selected package>
root <at> lubuntu:~# apt-get install gdisk
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  gdisk
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 186 kB of archives.
After this operation, 761 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ trusty/main gdisk amd64
0.8.8-1build1 [186 kB]
Fetched 186 kB in 1s (154 kB/s)
Selecting previously unselected package gdisk.
(Reading database ... 113515 files and directories currently installed.)
Preparing to unpack .../gdisk_0.8.8-1build1_amd64.deb ...
Unpacking gdisk (0.8.8-1build1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up gdisk (0.8.8-1build1) ...
root <at> lubuntu:~# gdisk
GPT fdisk (gdisk) version 0.8.8

Type device filename, or press <Enter> to exit: /dev/sda
Warning! Disk size is smaller than the main header indicates! Loading
secondary header from the last sector of the disk! You should use 'v' to
verify disk integrity, and perhaps options on the experts' menu to repair
the disk.
Caution: invalid backup GPT header, but valid main header; regenerating
backup header from main header.

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): p
Disk /dev/sda: 3907029168 sectors, 1.8 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): BFD8B9FE-8BF3-4AF3-B04C-326FC7FB5569
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 7812499934
Partitions will be aligned on 2048-sector boundaries
Total free space is 6890901949 sectors (3.2 TiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          206847   100.0 MiB   EF00  EFI system partition
   2          206848          468991   128.0 MiB   0C01  Microsoft reserved part
   3          468992       307199999   146.3 GiB   0700  Basic data partition
   4       307200000       614399999   146.5 GiB   A500  FreeBSD
   5       614400000       921599999   146.5 GiB   0700  Basic data partition

Command (? for help): w
Caution! Secondary header was placed beyond the disk's limits! Moving the
header, but other problems may occur!

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/sda.
The operation has completed successfully.
root <at> lubuntu:~# parted
GNU Parted 2.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: ATA WDC WD20EFRX-68E (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start   End    Size   File system  Name                          Flags
 1      1049kB  106MB  105MB               EFI system partition          boot
 2      106MB   240MB  134MB               Microsoft reserved partition  msftres
 3      240MB   157GB  157GB               Basic data partition
  msftdata
 4      157GB   315GB  157GB               FreeBSD
 5      315GB   472GB  157GB               Basic data partition
  msftdata

(parted)

-- 
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info




Information forwarded to bug-parted <at> gnu.org:
bug#21070; Package parted. (Wed, 15 Jul 2015 20:59:03 GMT) Full text and rfc822 format available.

Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):

From: CeDeROM <cederom <at> tlen.pl>
To: bug-parted <at> gnu.org
Subject: Re: GPT backup corruption causes parted and linux installer to crash
Date: Wed, 15 Jul 2015 21:56:42 +0200
Well, fixing GPT backup does not fix the problem of paritioning under
LUbuntu 14.04 LTS. This is blocker and I cannot install. I will try
fresh release installer..

-- 
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info




Information forwarded to bug-parted <at> gnu.org:
bug#21070; Package parted. (Thu, 16 Jul 2015 14:49:02 GMT) Full text and rfc822 format available.

Message #14 received at 21070 <at> debbugs.gnu.org (full text, mbox):

From: "Brian C. Lane" <bcl <at> redhat.com>
To: CeDeROM <cederom <at> tlen.pl>
Cc: 21070 <at> debbugs.gnu.org
Subject: Re: bug#21070: GPT backup corruption causes parted and linux
 installer to crash
Date: Thu, 16 Jul 2015 07:48:17 -0700
On Wed, Jul 15, 2015 at 07:34:04PM +0000, CeDeROM wrote:
> 
> root <at> lubuntu:~# parted
> GNU Parted 2.3

This version of parted is pretty old, the current release, v3.2, has
much better support for handling corrupt GPT disks.

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)




Information forwarded to bug-parted <at> gnu.org:
bug#21070; Package parted. (Thu, 16 Jul 2015 17:37:02 GMT) Full text and rfc822 format available.

Message #17 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Rod Smith <rodsmith <at> rodsbooks.com>
To: bug-parted <at> gnu.org
Subject: Re: bug#21070: GPT backup corruption causes parted and linux installer
 to	crash
Date: Thu, 16 Jul 2015 13:36:02 -0400
On 07/16/2015 12:01 PM, bug-parted-request <at> gnu.org wrote:

> I have bought 2x2TB disks and set it up for RAID0. I have installed
> Win7 first with UEFI that created GPT partitions.
...
> root <at> lubuntu:~# gdisk
> GPT fdisk (gdisk) version 0.8.8
> 
> Type device filename, or press <Enter> to exit: /dev/sda
...
> Command (? for help): p
> Disk /dev/sda: 3907029168 sectors, 1.8 TiB
> Logical sector size: 512 bytes
> Disk identifier (GUID): BFD8B9FE-8BF3-4AF3-B04C-326FC7FB5569
> Partition table holds up to 128 entries
> First usable sector is 34, last usable sector is 7812499934
> Partitions will be aligned on 2048-sector boundaries
> Total free space is 6890901949 sectors (3.2 TiB)

I've quoted some information that highlights issues that point to the
root cause of your problem:

* You've got 2x2TB in a RAID setup, so you should be seeing a
  disk device on the order of 4TB (~3.6TiB)
* gdisk says that the disk is 1.8TiB in size -- about the size
  of ONE of your two disks, NOT a RAID configuration.
* The partition table indicates that the last usable sector on
  the disk is 7,812,499,934, which works out to about 3.6TiB --
  so the original GPT was laid out with RAID active.

Overall, it looks like you're not using RAID from Linux. If this is
motherboard-based software RAID (aka "fake RAID"), you should NOT be
directly accessing /dev/sda, /dev/sdb, etc.; you should be using devices
in /dev/mapper, whose names vary depending on your chipset. Also,
sometimes Linux and Windows get out of sync on these drivers, so that
one OS activates the driver and the other doesn't. If you don't see
devices in /dev/mapper, you'll need to look into activating RAID in
Ubuntu. See the Ubuntu Community Wiki for advice on this topic:

https://help.ubuntu.com/community/Installation/SoftwareRAID

All that said, if a more up-to-date version of parted produces the
errors you report, that still constitutes a bug. As Brian Lane said,
though, your parted is a bit behind the times. This often happens when
you use a distribution-provided package, particularly for a long-term
support distribution like an Ubuntu LTS or a CentOS (vs. a non-LTS
Ubuntu or Fedora).

-- 
Rod Smith
rodsmith <at> rodsbooks.com
http://www.rodsbooks.com




Information forwarded to bug-parted <at> gnu.org:
bug#21070; Package parted. (Thu, 16 Jul 2015 17:55:01 GMT) Full text and rfc822 format available.

Message #20 received at 21070 <at> debbugs.gnu.org (full text, mbox):

From: Dan Williams <dan.j.williams <at> intel.com>
To: Rod Smith <rodsmith <at> rodsbooks.com>
Cc: 21070 <at> debbugs.gnu.org
Subject: Re: bug#21070: GPT backup corruption causes parted and linux
 installer to crash
Date: Thu, 16 Jul 2015 10:53:57 -0700
On Thu, Jul 16, 2015 at 10:36 AM, Rod Smith <rodsmith <at> rodsbooks.com> wrote:
> On 07/16/2015 12:01 PM, bug-parted-request <at> gnu.org wrote:
>
>> I have bought 2x2TB disks and set it up for RAID0. I have installed
>> Win7 first with UEFI that created GPT partitions.
> ...
>> root <at> lubuntu:~# gdisk
>> GPT fdisk (gdisk) version 0.8.8
>>
>> Type device filename, or press <Enter> to exit: /dev/sda
> ...
>> Command (? for help): p
>> Disk /dev/sda: 3907029168 sectors, 1.8 TiB
>> Logical sector size: 512 bytes
>> Disk identifier (GUID): BFD8B9FE-8BF3-4AF3-B04C-326FC7FB5569
>> Partition table holds up to 128 entries
>> First usable sector is 34, last usable sector is 7812499934
>> Partitions will be aligned on 2048-sector boundaries
>> Total free space is 6890901949 sectors (3.2 TiB)
>
> I've quoted some information that highlights issues that point to the
> root cause of your problem:
>
> * You've got 2x2TB in a RAID setup, so you should be seeing a
>   disk device on the order of 4TB (~3.6TiB)
> * gdisk says that the disk is 1.8TiB in size -- about the size
>   of ONE of your two disks, NOT a RAID configuration.
> * The partition table indicates that the last usable sector on
>   the disk is 7,812,499,934, which works out to about 3.6TiB --
>   so the original GPT was laid out with RAID active.
>
> Overall, it looks like you're not using RAID from Linux. If this is
> motherboard-based software RAID (aka "fake RAID"), you should NOT be
> directly accessing /dev/sda, /dev/sdb, etc.; you should be using devices
> in /dev/mapper, whose names vary depending on your chipset. Also,
> sometimes Linux and Windows get out of sync on these drivers, so that
> one OS activates the driver and the other doesn't. If you don't see
> devices in /dev/mapper, you'll need to look into activating RAID in
> Ubuntu. See the Ubuntu Community Wiki for advice on this topic:
>
> https://help.ubuntu.com/community/Installation/SoftwareRAID
>
> All that said, if a more up-to-date version of parted produces the
> errors you report, that still constitutes a bug. As Brian Lane said,
> though, your parted is a bit behind the times. This often happens when
> you use a distribution-provided package, particularly for a long-term
> support distribution like an Ubuntu LTS or a CentOS (vs. a non-LTS
> Ubuntu or Fedora).

Note that the most up to date Firmware-RAID ("fake-RAID" is a
misnomer) support is provided by mdadm for Intel platforms, not
dmraid.




Reply sent to Phil Susi <psusi <at> ubuntu.com>:
You have taken responsibility. (Fri, 18 Sep 2015 18:27:02 GMT) Full text and rfc822 format available.

Notification sent to CeDeROM <cederom <at> tlen.pl>:
bug acknowledged by developer. (Fri, 18 Sep 2015 18:27:02 GMT) Full text and rfc822 format available.

Message #25 received at 21070-done <at> debbugs.gnu.org (full text, mbox):

From: Phil Susi <psusi <at> ubuntu.com>
To: CeDeROM <cederom <at> tlen.pl>, 21070-done <at> debbugs.gnu.org
Subject: Re: bug#21070: GPT backup corruption causes parted and linux
 installer to crash
Date: Fri, 18 Sep 2015 14:26:11 -0400
On 7/15/2015 3:34 PM, CeDeROM wrote:
> Hello,
> 
> I have bought 2x2TB disks and set it up for RAID0. I have installed
> Win7 first with UEFI that created GPT partitions. I want to install
> FreeBSD and Linux on it..
> 
> Using Lubuntu AMD64 14.04.02 ISO and UEFI boot I have problem with
> installation. Installer crashes, so I have tried gparted it crashes as
> well, and so parted, below are details.
> 
> Please advise :-)
> Tomek
> 
> root <at> lubuntu:~# parted
> GNU Parted 2.3
> Using /dev/sda

You must not access an individual disk when it is part of a fake raid
array; you must instead partition the array as a whole ( e.g.
/dev/mapper/somethingorther ).  It appears to be a disk that claims to
be larger than it actually is.  That old version of parted refuses to
handle it, so you could also use a more recent release ( Ubuntu 15.04
should do ).





Information forwarded to bug-parted <at> gnu.org:
bug#21070; Package parted. (Fri, 18 Sep 2015 18:30:03 GMT) Full text and rfc822 format available.

Message #28 received at 21070-done <at> debbugs.gnu.org (full text, mbox):

From: CeDeROM <cederom <at> tlen.pl>
To: Phil Susi <psusi <at> ubuntu.com>
Cc: 21070-done <at> debbugs.gnu.org
Subject: Re: bug#21070: GPT backup corruption causes parted and linux
 installer to crash
Date: Fri, 18 Sep 2015 20:29:42 +0200
[Message part 1 (text/plain, inline)]
Yes 15.04 did it. Older cannot. Best regards :-)

--
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info
[Message part 2 (text/html, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 17 Oct 2015 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 245 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.