LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-09-2014, 02:57 AM   #1
Sunghost
LQ Newbie
 
Registered: May 2014
Posts: 24

Rep: Reputation: Disabled
How to Repair GPT Partitiontable


Hello,
i have done a mistake and overwriten a gpt ext4 partition table of my 3tb disk. I wanted to add the disk to my raid, but exchanged target and source in sgdisk command. After that i take a similar disk, same model, size and partition table, and copied the partition table over the sdb disk. Afterthat i could mount the disk, but its shown as empty disk.

I actually backup the sdb1 disk via ddrescue to an image. How can i recover the correct partition table and rescue my data? System is Debian Wheezy...
 
Old 07-09-2014, 04:18 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,286

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Is testdisk up to GPT? I would check that. It probably is by now.

http://www.cgsecurity.org/wiki/TestDisk

There's a static binary that will run on a very basic system up there for download in case you're running from an install cd.Let it search. Have guesses where your partitions were. Usually works.
 
Old 07-09-2014, 04:56 AM   #3
Sunghost
LQ Newbie
 
Registered: May 2014
Posts: 24

Original Poster
Rep: Reputation: Disabled
Hi,
ok installed that and tried it, but which type msdos, efi, none.... should i choose?
 
Old 07-09-2014, 09:42 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,286

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Hmmm. I would chance EFI. Whether it's EFI or not (EFI has a couple of set partitions which will be missing if you are not EFI). If it was formatted with fdisk, I'd say msdos. But I've been wrong before.
 
Old 07-09-2014, 09:52 AM   #5
Sunghost
LQ Newbie
 
Registered: May 2014
Posts: 24

Original Poster
Rep: Reputation: Disabled
re

Hello,
i choosed EFI and got 2 Partitions from Raid i used the disk before. First with 8TiB and second with 14TiB ?! What next? I can only say continue?
 
Old 07-09-2014, 12:09 PM   #6
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,286

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
let it search the whole disk and restore the partitions you believe in, That's what's next. We hope you know what your partitions were. 8 & 14 TB sound a bit big.

If you had raid running on the disk, mark this solved, open another thread with raid in the title and see what you get from that. That way, people with decent raid experience may look at it. In the meantime finish scanning the disk.
 
Old 07-09-2014, 03:18 PM   #7
Sunghost
LQ Newbie
 
Registered: May 2014
Posts: 24

Original Poster
Rep: Reputation: Disabled
re

Hello,
no disk is not on raid, but was before. After that i formated it with ext4 on a new single partition. i think testdisk found the partition which was before on the disk.
 
Old 07-09-2014, 03:26 PM   #8
Sunghost
LQ Newbie
 
Registered: May 2014
Posts: 24

Original Poster
Rep: Reputation: Disabled
Testdisk is done and i found only this:
P ext4 0 0 1 364801 33 32 5860530176
Can't open filesystem. Filesystem seems damaged.
 
Old 07-10-2014, 03:57 AM   #9
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,286

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
The figures in testdisk mean very little to me. It's been a long time. If it only found one non raid partition, consider whether you want to restore it or run away to professionals to try to recover your data. I was worried that it was going to find seven partitions when you know you had only one or two. That has happened to me.

Take it that whatever you write to disk now will probably destroy something. I take it you want your data before the overwrite. It doesn't sound very hopeful.

From here your path is
1. Restore the partition; you will have no files; set photorec loose on the disk and it will produce data fragments of various sizes. Nothing on linux can recover an overwritten directory, so you have to stitch together the data fragments into files yourself. If these are text documents, you could do this yourself. If large images, forget it.
2. Go to professionals who will run software that examines the disk much more closely. The idea is that if some spot was magnetised as a '0' for a long time, it will be more inclined to be '0' that '1', even if it's '1' now. You pay them money for the service, but you get most of your data. If they manage to recover directories, they can unlock the key to the data fragments puzzle. You pay even if they get very little.
 
Old 07-10-2014, 04:01 AM   #10
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Fedora, OpenSUSE, FreeBSD, OpenBSD, macOS (hack). Past: Debian, Arch, RedHat (pre-RHEL).
Posts: 1,335
Blog Entries: 7

Rep: Reputation: 402Reputation: 402Reputation: 402Reputation: 402Reputation: 402
I have successfully recovered GPT partitions by following the instructions at Rod's Books. I once accidentally wrote some input from /dev/zero to the wrong device and ended up ruining my main GPT (fortunately none of the partitions nor their data were harmed). The below site helped me get every partition back.

Start here: http://www.rodsbooks.com/gdisk/repairing.html and move on to the rest of the site if this does not help.
 
Old 07-10-2014, 04:53 AM   #11
Sunghost
LQ Newbie
 
Registered: May 2014
Posts: 24

Original Poster
Rep: Reputation: Disabled
Hello,
found this page too, but didnt helped so far. gdisk says with option verify "No problems found" but disk is empty. Should i run with a recovery option, but which one?
 
Old 07-10-2014, 04:58 AM   #12
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Fedora, OpenSUSE, FreeBSD, OpenBSD, macOS (hack). Past: Debian, Arch, RedHat (pre-RHEL).
Posts: 1,335
Blog Entries: 7

Rep: Reputation: 402Reputation: 402Reputation: 402Reputation: 402Reputation: 402
Have you tried loading the backup table (under the recovery menu)? See the section entitled "Manual Recovery" on that page.
 
Old 07-10-2014, 05:01 AM   #13
Sunghost
LQ Newbie
 
Registered: May 2014
Posts: 24

Original Poster
Rep: Reputation: Disabled
After Run Option c for backup with partition 1 verify shows 5569 problems.
 
Old 07-10-2014, 05:02 AM   #14
Sunghost
LQ Newbie
 
Registered: May 2014
Posts: 24

Original Poster
Rep: Reputation: Disabled
Short question i make a image from sdb1 with ddrescue, should i do that for the whole disk sdb ?

edit: ok i backup the whole disk now not only sdb1

Last edited by Sunghost; 07-10-2014 at 05:53 AM.
 
Old 07-10-2014, 07:10 AM   #15
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Fedora, OpenSUSE, FreeBSD, OpenBSD, macOS (hack). Past: Debian, Arch, RedHat (pre-RHEL).
Posts: 1,335
Blog Entries: 7

Rep: Reputation: 402Reputation: 402Reputation: 402Reputation: 402Reputation: 402
Yes, the whole disk as that would copy everything including any partition data.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Slackware 13.37 - gdisk choices, MBR, GPT or Blank GPT CFet Slackware - Installation 3 04-01-2011 04:46 PM
Dual Boot MBR/PartitionTable issue bkeeper Linux - Laptop and Netbook 5 07-28-2009 09:32 AM
Fdisk can't show my partitiontable... anti.corp Slackware 9 11-12-2005 05:26 PM
messed up partitiontable -help with gpart jackren Linux - General 0 05-22-2004 06:45 AM
partitiontable erased. Linux can still read disk? EyesOnly Linux - Software 8 01-17-2004 04:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration