LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 04-24-2013, 12:10 AM   #1
rupeshforu
Member
 
Registered: Dec 2012
Posts: 97

Rep: Reputation: Disabled
how to recover partition table using gpart


Sir yesterday while I was operating suse12.2 power failure occurred at that time I was accessing another internal harddisk finally I opened gparted and found no partitions. In gparted I have selected the option create partition table and also I ran the tool testdisk but no use.After that I ran the command gpart /dev/sda and found four partitions. Can you please describe how to recover partition table using gpart.

Actually I am having two harddisks one 500GB on which I have installed suse and another harddisk of size 160GB on which I have installed Windows7.

Regards,
Rupesh.
 
Old 04-24-2013, 02:38 AM   #2
heinblöd
Member
 
Registered: May 2004
Location: France
Distribution: Slackware Gentoo
Posts: 182

Rep: Reputation: 30
Hello,
I would use testdisk to restore partitions.

If it didn't find anything it's maybe because you created a new partition table which logically DELETED your old one.

Never write anything to a disk you want to restore sth on .

But you migth be able to still find it with testdisk using the deep (or long) scan .
You may have to switch testdisk to expert mode

Also if you have a copy of the partitioning scheme and if you know exactly the partition boundaries, you could simply recreate the old settings manually

Last edited by heinblöd; 04-24-2013 at 02:44 AM.
 
Old 04-24-2013, 03:01 AM   #3
rupeshforu
Member
 
Registered: Dec 2012
Posts: 97

Original Poster
Rep: Reputation: Disabled
Sir yesterday I have ran testdisk three to four times on opensuse12.2 and each and every time it is showing errors like cylinders are not in correct position etc., so can I trust that tool and also I think it has destroyed my disk completely. At present I have gparted live disk.If you don't mind can you please describe the procedure of recovering mbr using testdisk.
 
Old 04-24-2013, 03:15 AM   #4
heinblöd
Member
 
Registered: May 2004
Location: France
Distribution: Slackware Gentoo
Posts: 182

Rep: Reputation: 30
I think it is telling you that the partition is not ending on cylinder boundaries which often happens when you partition disks with windows.

the manual says:
Quote:
How to find the correct number of heads?

If the HD geometry mismatches the geometry used when creating the partition table, warning messages such as: Bad sector count, Bad relative sector or Bad ending head are displayed when Analyse is selected from the main menu. If you see such errors, you may need to use the Geometry menu to change the logical number of heads. Try 255, 16, 32, 64, 128 and 240 heads until TestDisk finds all your partitions. 255 and 240 are the most common head values. If you installed Linux as the only OS on your hard drive, it tends to default to only 16 heads.
Everything else you need to know is described here:

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

look into the "Documentation" section in the middle of the page, they even have a step by step tutorial

Quote:
Originally Posted by rupeshforu View Post
and also I think it has destroyed my disk completely
Sorry to say,but if sth has destroyed anything then it was gparted when creating a new Partition table ...

Last edited by heinblöd; 04-24-2013 at 03:17 AM.
 
Old 04-24-2013, 03:28 AM   #5
heinblöd
Member
 
Registered: May 2004
Location: France
Distribution: Slackware Gentoo
Posts: 182

Rep: Reputation: 30
Maybe save the present mbr before doing anything , so you have a copy of the situation :

dd if=/dev/sda of=/somewhere/on/a/usb/stick bs=512 count=1
 
Old 04-24-2013, 04:32 AM   #6
rupeshforu
Member
 
Registered: Dec 2012
Posts: 97

Original Poster
Rep: Reputation: Disabled
gpart main functionality is to find lost partitions. So kindly can you give suggestions on how to use gpart.
 
Old 04-25-2013, 03:16 AM   #7
heinblöd
Member
 
Registered: May 2004
Location: France
Distribution: Slackware Gentoo
Posts: 182

Rep: Reputation: 30
Sorry I can't help with gpart, never used it
 
Old 04-27-2013, 10:06 AM   #8
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Gentoo
Posts: 15,412
Blog Entries: 2

Rep: Reputation: 3995Reputation: 3995Reputation: 3995Reputation: 3995Reputation: 3995Reputation: 3995Reputation: 3995Reputation: 3995Reputation: 3995Reputation: 3995Reputation: 3995
All the info you need can be found on the Gpart website: http://www.brzitwa.de/mb/gpart/index.html
 
Old 04-28-2013, 10:41 AM   #9
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 14,205

Rep: Reputation: 2472Reputation: 2472Reputation: 2472Reputation: 2472Reputation: 2472Reputation: 2472Reputation: 2472Reputation: 2472Reputation: 2472Reputation: 2472Reputation: 2472
Quote:
Originally Posted by rupeshforu View Post
gpart main functionality is to find lost partitions. So kindly can you give suggestions on how to use gpart.
You may also want to try the replies in your other, very similar, thread:
http://www.linuxquestions.org/questi...fs-4175452092/
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to recover partition table! Kirfew Linux - Software 8 09-15-2010 11:33 AM
Recover partition table? Xmas777 Linux - Newbie 5 12-10-2008 10:10 AM
how to recover partition table ariadneN Linux - General 3 07-26-2006 02:13 PM
Recover partition table djib Linux - Software 2 05-14-2005 07:07 AM
Recover the partition table yogeshwar_s Linux - Hardware 1 09-22-2004 02:02 AM


All times are GMT -5. The time now is 02:18 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration