bug-parted
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need help with "Alternate GPT header not at the end of the disk."


From: Jim Meyering
Subject: Re: Need help with "Alternate GPT header not at the end of the disk."
Date: Tue, 24 Nov 2009 09:10:31 +0100

Ralph Pursifull wrote:
> Please help.   At boot time, we get:  "Alternate GPT header not at the end
> of the disk."
>
> Google shows some situations like this are resolved by running parted and
> using "print" to trigger an offer of "Fix/Cancel". I don't get such an
> offer.
>
> We have parted 1.8.8 on Fedora 10. There is an important XFS file system of
> 17TB spanning sdc (healthy) and sdd (sick). The only recent change was to
> add sde to scsi interface shared with sdd. Output from /var/log/messages and
> parted diagnostic print commands is below.
>
> What should I do now to resolve this?  I would believe it is critical to
> resolve before I grow the file system to 25TB. Is it?

I suggest that you use the very latest parted-2.x, built from sources here:

    git clone git://git.debian.org/git/parted/parted.git

Follow the build instructions in the cloned file, README-hacking.
There have been a few GPT-related improvements even since parted-2.0.

In case this helps, here's a quick demo script you can use to see
if your version of parted does the right thing.

-----------------------------------------------------------
#!/bin/sh

sector_size_=512
ss=$sector_size_
n_sectors=200

dev=dev-file
set -e

dd if=/dev/null of=$dev bs=$ss seek=$n_sectors
parted -s $dev mklabel gpt

# zero out the final sector (GPT's backup header).
dd if=/dev/zero of=$dev bs=$ss seek=$(($n_sectors - 1)) conv=notrunc count=1

parted $dev u s p
-----------------------------------------------------------

When I run it, it does this:

  $ bash ./sample-test-gpt-corrupt-no-header-at-end-of-disk.sh
  0+0 records in
  0+0 records out
  0 bytes (0 B) copied, 6.8515e-05 s, 0.0 kB/s
  1+0 records in
  1+0 records out
  512 bytes (512 B) copied, 7.5855e-05 s, 6.7 MB/s
  WARNING: You are not superuser.  Watch out for permissions.
  Error: The backup GPT table is corrupt, but the primary appears OK, so that 
will
  be used.
  OK/Cancel? ok             <<<======= I typed this "ok"
  Model:  (file)
  Disk /.../dev-file: 200s
  Sector size (logical/physical): 512B/512B
  Partition Table: gpt

  Number  Start  End  Size  File system  Name  Flags

Running parted against that test file one more time shows that
the GPT backup header has indeed been restored (no warning or prompt):

  $ parted dev-file u s p
  WARNING: You are not superuser.  Watch out for permissions.
  Model:  (file)
  Disk /.../dev-file: 200s
  Sector size (logical/physical): 512B/512B
  Partition Table: gpt

  Number  Start  End  Size  File system  Name  Flags




reply via email to

[Prev in Thread] Current Thread [Next in Thread]