Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 19/20 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 7th December 2011, 12:02 AM
splatt Offline
Registered User
 
Join Date: Dec 2011
Location: the states
Posts: 11
windows_7firefox
FC16: corrupted disk GPT table, how to recover/repair?

I have a corrupted hard drive and when I run parted to try and fix it, I see:
#parted /dev/sda print
Warning: /dev/sda contains GPT signatures, indicating that it has a GPT table. However, it does not have a valid fake msdos partition table, as it should. Perhaps it was corrupted -- possibly by a program that doesn't understand GPT partition tables. Or perhaps you deleted the GPT table, and are now using an msdos partition table. Is this a GPT partition table?
Yes/No? Yes
[correct partition table details then printed here]

It seems to me that the information can be retrieved (since it is printed out). I would like to save that information in a repaired GPT table so that it can be used. The next time I invoke any kind of parted print, I get the same thing (which can be recovered again but is not saved).

I think (maybe for no good reason) that it needs a label -- when I invoke parted mklabel it warns me that all the data on the disk will be lost ... so I opt out of that.

I believe all the data is still on the drive uncorrupted (except some reference to that GPT stuff). I want to recover/fix this so that I can boot to FC16 again. To clarify, I do not have any vital data on this disk. I just think something must be wrong that I can not recover when the information is clearly available (either something wrong with documentation in that I can't find how to do it -- or something is lacking in the tools being unable to do something more subtle than wipe the data from the drive). Since I couldn't find out how to do this after expending some substantial amount of time, I'm hoping that I can find an answer for others to reference in the future, as well as gaining some understanding of how to use some basic system tools.

I tried parted rescue (and I have the partition data to feed it), but that apparently did not address the GPT issue. I want to recover my GPT table and get GRUB working to be able to boot again.


I don't think this stuff makes a difference, but:
I'm on an x86_64 system w/ x86_64 install.
I corrupted the disk attempting to install FreeBSD (and failing to install that as well).
Before attempting the install of FreeBSD, I checked that I could boot into FC16 (as I have done using this FC16 install several time before).
The FreeBSD install was attempted on unused disk space and failed to complete with some warning about not being able to find the (FreeBSD) swap partition.
Reply With Quote
  #2  
Old 7th December 2011, 12:24 AM
stevea Online
Registered User
 
Join Date: Apr 2006
Location: Ohio, USA
Posts: 8,762
linuxfedorafirefox
Re: FC16: corrupted disk GPT table, how to recover/repair?

You want to use the gdisk utility.
You'll want to start with the 'v' verify command. You can recover 'r' your config from either the main or backup GPT table. - examine both before trying recovery

Read the man page carefully.

===

I *HOPE* you are correct that the FreeBSD just mucked up the MSDOS partition table, but if it started installing it may have corrupted the dsk content.
__________________
None are more hopelessly enslaved than those who falsely believe they are free.
Johann Wolfgang von Goethe

Last edited by stevea; 7th December 2011 at 12:28 AM.
Reply With Quote
  #3  
Old 8th December 2011, 12:24 AM
splatt Offline
Registered User
 
Join Date: Dec 2011
Location: the states
Posts: 11
windows_7firefox
Re: FC16: corrupted disk GPT table, how to recover/repair?

o.k., I was not sure how I should best get use of gdisk. I was using the install disk ==> Troubleshooting ==> Rescue a Fedora system. ... (fails in attempt to find Linux installation -- "No usable disks have been found) ... shell Start shell

Downloading and installing to the troubleshooting shell didn't seem like a very good idea.

I decided to plug into a system running fc14 after installing gdisk there (doesn't appear to be on the install dvd). I ran the minimal set I could manage -- because I'm a bit nervous about it. Verify showed everything is great. When loading gdisk, there was some confusion about whether to use the MBR or GPT -- I picked GPT. I checked information indicated by GPT and the numbers all look correct, so I wrote to disk and rebooted. Now boot from this disk doesn't look too pretty. ... however, when I go through the "Troublshooting" boot route from the install disk, the drive is found. When the disk is (automatically) mounted in this troubleshooting shell, I can see all my data from the drive.

Thanks very much stevea !

I now need to figure out how to clean up operation of grub ... or boot cycle in general including MBR? I guess I'll go fish; unless someone gives me another great tip.

---------- Post added at 03:57 PM ---------- Previous post was at 03:20 PM ----------

I guess I'll repost asking about use of grub2 tools ...

---------- Post added at 04:24 PM ---------- Previous post was at 03:57 PM ----------

Here is the grub2 fix:
http://forums.fedoraforum.org/showth...71#post1537071
Happy ending.
Reply With Quote
  #4  
Old 8th December 2011, 12:30 AM
stevea Online
Registered User
 
Join Date: Apr 2006
Location: Ohio, USA
Posts: 8,762
linuxfedorafirefox
Re: FC16: corrupted disk GPT table, how to recover/repair?

Picking GPT seems correct esp since you visually checked the partitioning.

What does "boot from this disk doesn't look too pretty" mean ? Be specific.

I *suspect* your BSD installation re-wrote the MBR and maybe bootloader block and MAY have setup BSDlabels and filesystems and started to write to them. If that's the case you can try a 'fsck' on the umounted file systems, but there is excellent chance that there are missing and damaged files.

If you can get to it via troubleshoot then follow the directions and chroot /mnt/sysimage (IIRC), make sure /boot is prsent or mounte, and then run grub2-install /dev/sda (whatever the disk name is).
__________________
None are more hopelessly enslaved than those who falsely believe they are free.
Johann Wolfgang von Goethe
Reply With Quote
  #5  
Old 8th December 2011, 11:25 PM
srs5694 Offline
Registered User
 
Join Date: Jan 2011
Location: Woonsocket, RI
Posts: 521
linuxfirefox
Re: FC16: corrupted disk GPT table, how to recover/repair?

I'm the author of gdisk, so I feel compelled to post.

It sounds like you're on the right track, splatt, and it sounds like re-installing GRUB may fix your remaining problems.

I do want to caution anybody who might read this in the future that the initial symptoms splatt reported (parted complaining about a lack of a protective MBR, or a "fake msdos partition table," as it calls it) are usually caused by the presence of two incompatible partition tables -- MBR and GPT. You should not blindly use one over the other, since either could be the correct one. You, splatt, indicated that your GPT table was correct, so recovering it with gdisk was appropriate. Sometimes, though, the MBR table is the correct one, in which case it's better to use FixParts to wipe the old GPT data. (gdisk can do this, too, but FixParts is easier to use for this task.) Doing the wrong thing will lose your data, so if some future reader has this problem, be sure to figure out which partition table holds your real data before you do anything you can't undo!
Reply With Quote
  #6  
Old 9th December 2011, 02:49 AM
splatt Offline
Registered User
 
Join Date: Dec 2011
Location: the states
Posts: 11
windows_7firefox
Re: FC16: corrupted disk GPT table, how to recover/repair?

stevea, I have a more specific account of what the not too pretty specifics are in my other post (about getting grub fixed). See my link right above your last comment. Recount here: it started right in with spewing # symbols on the screen and didn't stop. There was no corruption and it works great now (per my post referenced above). Thanks again for pointing me in the right direction for the gdisk step.
Reply With Quote
Reply

Tags
corrupted, corrupted disk, disk, fc16, gpt, parted, recover or repair, table

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] f16 gpt corrupt header, repair it and later the other one gets corrupted rtguille Using Fedora 30 12th June 2012 07:15 AM
Mutter 3.1.3.1-2.fc16 has corrupted Gnoe shell in F15 netwidget F17 Development Forum 4 8th October 2011 09:46 AM
Repair/restore partition table Beralus Using Fedora 17 8th August 2010 01:50 AM
chattr command corrupted. how to repair it? henrym Servers & Networking 0 3rd September 2008 09:49 AM
Repair corrupted ext3 cyclonmaster Using Fedora 2 23rd May 2007 08:18 AM


Current GMT-time: 06:51 (Wednesday, 20-08-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat