Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.unix.admin > #105

GPT repair tools?

From Ivan Shmakov <oneingray@gmail.com>
Newsgroups alt.os.linux.debian, comp.unix.admin
Subject GPT repair tools?
Date 2012-02-07 00:27 +0700
Organization Aioe.org NNTP Server
Message-ID <86ty33hnyk.fsf@gray.siamics.net> (permalink)

Cross-posted to 2 groups.

Show all headers | View raw


	I wonder, how do I fix a suddenly broken GPT partition table?
	(See below for Linux and GNU Parted error messages.)

	Shouldn't there be a command similar to # sfdisk -d to dump an
	ASCII representation of the table, so that it could be
	hand-edited and reloaded back to the media?

	TIA.

	Curiously enough, gptsync(8) is still capable of reading the
	table in question:

# gptsync /dev/sdc 

Current GPT partition table:
 #      Start LBA      End LBA  Type
 1             34        32768  BIOS Boot Partition
 2          32769      2097152  EFI System (FAT)
 3        2097153     33554432  Basic Data
 4       33554433    268435456  Basic Data
 5      268435457    536870912  Linux LVM
...

Current MBR partition table:
 # A    Start LBA      End LBA  Type
 1              1           33  ee  EFI Protective
 2             34        32768  da  Non-FS data
 3          32769      2097152  83  Linux
 4 *      2097153     33554432  0b  FAT32 (CHS)

Status: Analysis inconclusive, will not touch this disk.

# 

	(Thus, with a bit of dmsetup(8) magic, I can access the contents
	of the media.  But did I also fail to make the partitions above
	properly align to 4 KiB, BTW?)

	That being said, the last partition of the table now spans for
	some 1040 KiB after the device's own end.

# dmesg 
...
[    2.916257]  sdc: unknown partition table
[    2.931302] sd 4:0:0:0: [sdc] Attached SCSI disk
...
# parted /dev/sdc print
Error: Invalid argument during seek for read on /dev/sdc
Retry/Ignore/Cancel? i
Error: The backup GPT table is corrupt, but the primary appears OK, so that will
be used.
OK/Cancel? o
Backtrace has 8 calls on stack:
  8: /lib/libparted.so.0(ped_assert+0x31) [0x7fa423cd0351]
  7: /lib/libparted.so.0(+0x444c1) [0x7fa423d014c1]
  6: /lib/libparted.so.0(ped_disk_new+0x75) [0x7fa423cd7505]
  5: parted() [0x4070de]
  4: parted(non_interactive_mode+0x8c) [0x40ce2c]
  3: parted(main+0x63) [0x40b1b3]
  2: /lib/libc.so.6(__libc_start_main+0xfd) [0x7fa4234f0c4d]
  1: parted() [0x405709]


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:718 in function _parse_header() failed.

Aborted
# 

-- 
FSF associate member #7257

Back to comp.unix.admin | Previous | NextNext in thread | Find similar | Unroll thread


Thread

GPT repair tools? Ivan Shmakov <oneingray@gmail.com> - 2012-02-07 00:27 +0700
  suddenly shrunk HDD?! Ivan Shmakov <oneingray@gmail.com> - 2012-02-07 00:57 +0700
    Re: suddenly shrunk HDD?! Aragorn <stryder@telenet.be.invalid> - 2012-02-07 01:13 +0100
      Re: suddenly shrunk HDD?! Ivan Shmakov <oneingray@gmail.com> - 2012-02-07 10:22 +0700
        Re: suddenly shrunk HDD?! Aragorn <stryder@telenet.be.invalid> - 2012-02-07 08:20 +0100
          Re: suddenly shrunk HDD?! Ivan Shmakov <oneingray@gmail.com> - 2012-02-07 16:51 +0700
            Re: [RESOLVED] suddenly shrunk HDD?! Ivan Shmakov <oneingray@gmail.com> - 2012-02-07 17:18 +0700

csiph-web