[Solved]GPT partition size issue

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

[Solved]GPT partition size issue

Postby xboxboy » Nov 23rd, '14, 12:56

Hi all.
A bit of an interesting one. I have an image for an ARM device that I've dd'ed to a usb flash drive. It boots, but gets stuck during boot with the following:

Code: Select all
GPT:Primary header thinks Alt. header is not at the end of the disk.
GPT:31116287 !=31266815
GPT:Alternate GPT header not at the end of the disk
GPT:31116287 !=31266815
GPT: Use GNU Parted to correct GPT errors.
 sda: sda6 sda7
sd 0:0:0:0: [sda] Attached SCSI removable disk


Now, I've tried to run GUI gparted, but it wont run properly: I have to shutdown, and on shutdown it flashes some partition error quickly.

Next I run:
Code: Select all
[root@localhost Downloads]# gdisk /dev/sdj
GPT fdisk (gdisk) version 0.8.8

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): v

Problem: The secondary header's self-pointer indicates that it doesn't reside
at the end of the disk. If you've added a disk to a RAID array, use the 'e'
option on the experts' menu to adjust the secondary header's and partition
table's locations.

Identified 1 problems!



So, I believe this is just an issue from dd'ing an image on to a different size drive: I just need to correct the GPT and it wil be fine. I'm unsure what/where to go to from here.

Many thanks
Last edited by xboxboy on Nov 25th, '14, 13:45, edited 1 time in total.
xboxboy
 
Posts: 401
Joined: Jun 2nd, '13, 06:41

Re: GPT partition size issue

Postby jiml8 » Nov 24th, '14, 00:43

Look at the tool gdisk.
jiml8
 
Posts: 1254
Joined: Jul 7th, '13, 18:09

Re: GPT partition size issue

Postby doktor5000 » Nov 24th, '14, 01:05

That's what he used to query the disk :) - maybe he should press ? ...
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18061
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: GPT partition size issue

Postby xboxboy » Nov 24th, '14, 02:08

Thanks for looking at this guys. GPT is totally new to me, and TBH, I can't make sense of it. Diskdrak can see the partitions fine. There are three partitions on the usb.

I've looked at:
http://www.rodsbooks.com/gdisk/
http://manpages.ubuntu.com/manpages/lucid/man8/gdisk.8.html

And, yes, pressing entering ? does bring up the same options. I just find the manual pages and descriptions very broad. ie. I don't understand how my situation fits the options available, and what the process is for repairing this header issue.
xboxboy
 
Posts: 401
Joined: Jun 2nd, '13, 06:41

Re: GPT partition size issue

Postby martinw » Nov 24th, '14, 21:53

I think gdisk is suggesting the right option to use, but the message is a bit misleading. What it refers to as the experts' menu is probably this option:
Code: Select all
r   recovery and transformation options (experts only)

The 'e' option inside this menu is described as
Code: Select all
e   load main partition table from disk (rebuilding backup)

Rebuilding backup sounds like what you need to do (backup = alternate = secondary - would be nice if they used the same word everywhere!)

Try it. The worst that can happen is that you'll have to copy the image onto your flash drive again.
martinw
 
Posts: 608
Joined: May 14th, '11, 10:59

Re: GPT partition size issue

Postby xboxboy » Nov 24th, '14, 23:48

@martinw

Thanks, I will try that: I have a fresh copy on the USB to try: I'll have a go when I get home.
xboxboy
 
Posts: 401
Joined: Jun 2nd, '13, 06:41

Re: GPT partition size issue

Postby xboxboy » Nov 25th, '14, 12:01

@MartinW

That worked perfect!

Code: Select all
Problem: The secondary header's self-pointer indicates that it doesn't reside
at the end of the disk. If you've added a disk to a RAID array, use the 'e'
option on the experts' menu to adjust the secondary header's and partition
table's locations.

Identified 1 problems!

Command (? for help): r

Recovery/transformation command (? for help): e
Warning! This will probably do weird things if you've converted an MBR to
GPT form and haven't yet saved the GPT! Proceed? (Y/N): y

Recovery/transformation command (? for help): w
Warning! Secondary header is placed too early on the disk! Do you want to
correct this problem? (Y/N): y
Have moved second header and partition table to correct location.

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/sdj.
The operation has completed successfully.


It didn't boot completely: But I've got another problem: I think the image is for a SD card, but I've got it on usb, so once the usb drive mounts it crashes.
xboxboy
 
Posts: 401
Joined: Jun 2nd, '13, 06:41


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest

cron