LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-22-2006, 07:32 AM   #1
Thoddy
Member
 
Registered: Jul 2003
Location: Bremen, Germany
Distribution: Ubuntu 9.10
Posts: 106

Rep: Reputation: 15
Question Recovering partition table !?


Hi guys,

I lost my partition table (at least I hope it's only the table and the data is still there) - most probably during a reset after my system crashed...

So I did not create any partitions or format anything - the data should still be on the disk, right? It is a 300GB disk containing one primary ext3 partition.

What I did so far is:
  • dmesg: 'dmesg | grep partition' gives me "hdg: unknown partition table".
  • gpart: scanned the disk for like an hour and didn't find anything but "unused space".
  • fdisk: 'fdisk -l' tells me "Disk /dev/hdg doesn't contain a valid partition table". Starting 'fdisk /dev/hdg' gives me some output - amoung others "Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)". Writing the partition table does not seem to correct this - the same error occurs every time I start fdisk.
  • hdparm: 'hdparm /dev/hdg' gives me a correct output of the disks geometry - so it still works properly I hope.

Any suggestions?
PLEASE!!

Last edited by Thoddy; 06-22-2006 at 07:33 AM.
 
Old 06-22-2006, 07:35 AM   #2
Sm1ler
Member
 
Registered: Apr 2004
Location: UK
Distribution: Fedora Core (all), Knoppix, RHEL, Centos, Debian
Posts: 100

Rep: Reputation: 16
Not 100% sure but I think parted gives some options to recover partiton tables, It should be well worth a try..
Hope this helps
Sm1ler
 
Old 06-22-2006, 08:13 AM   #3
Thoddy
Member
 
Registered: Jul 2003
Location: Bremen, Germany
Distribution: Ubuntu 9.10
Posts: 106

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Sm1ler
Not 100% sure but I think parted gives some options to recover partiton tables, It should be well worth a try...
Hm, just tried 'parted /dev/hdg' and then 'print', which gives me "Error: unable to open /dev/hdg - unrecognised disk label". The same output for the 'rescue' option...

I thought it might be a good idea to create a new disk label (partition table), so typed 'mklabel msdos'. No report (which hopefully means no problem), but still the same error message when I want to print the partition table after that...

Seems to be a good tool! But also seems there is some more severe problem with my disk!?

Anyone: can clearing the MBR and then re-adding a partition table help??
 
Old 06-22-2006, 09:53 AM   #4
Sm1ler
Member
 
Registered: Apr 2004
Location: UK
Distribution: Fedora Core (all), Knoppix, RHEL, Centos, Debian
Posts: 100

Rep: Reputation: 16
I used parted last week and it does take a bit of getting used to, I will search around for some web help and post if I find anything further. Don't give up just yet and I would recomend doing some web searches on recovered disks with parted etc.. You might turn up something very helpful.
 
Old 06-22-2006, 10:46 AM   #5
binary_y2k2
Member
 
Registered: Jul 2005
Location: England, UK
Distribution: Ubuntu 8.04 Server, Kubuntu 12.04
Posts: 698
Blog Entries: 1

Rep: Reputation: 31
In the parted help the only reference to rescueing a partition is
Quote:
rescue START END rescue a lost partition near START and END
 
Old 06-22-2006, 08:06 PM   #6
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 87
I don't know if this will help, but if you kill your partition table (without reformatting, etc) then Yes, you can recover your data. In order to do so however, you need to recreate the same partitions, using the same sizes as they were previously. Obviously, this may be easier said than done, and if you don't know what exact sizes they were in the past, it might not be possible.

However, thinking optimistically, if you know that (for example) hda1 was swap and it was 512Mg, and that hda2 was root and was 50G, and that hda3 was /home and was the rest of the drive, then if you just redefine those partitions, you should be up and running. FWIW, I've found myself in this exact situation more than once, but fortunately I had written up some notes about my system so I was able to recover.

Good luck with it. There are a number of other existing threads on this topic; check them out if you haven't already for other suggestions
 
Old 06-22-2006, 08:40 PM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
If there was just the one partition on it, use fdisk to create a partition. Take all the defaults - start at the start, use the whole disk.
Doesn't matter if it winds up bigger than you had before - the filesystem will be intact and usable so long as your previous partition was at the beginning of the disk. As it will almost certainly have been.
 
Old 06-23-2006, 01:57 AM   #8
Thoddy
Member
 
Registered: Jul 2003
Location: Bremen, Germany
Distribution: Ubuntu 9.10
Posts: 106

Original Poster
Rep: Reputation: 15
Smile

Quote:
Originally Posted by syg00
If there was just the one partition on it, use fdisk to create a partition. Take all the defaults - start at the start, use the whole disk.
That's what I was hoping all the time - and I was sure to be able to simple re-create that one partition (without formating).

But then all the time (using both fdisk and parted) I received the message that my partition table was corrupt (see my post #2 - post #3 all together in this thread) and couldn't even make an empty new one. And without a partition table - of course - you can not create a partition...

For whatever reason today I could?!?!?!?

So now I could create an ext3 partition using the whole drive and... TA-DA... I can do an 'fsck /dev/hdg1', which means it is there and currently checking the file system!!

So - I have no idea what is different today!! But it works... thanks all!

Last edited by Thoddy; 06-23-2006 at 01:59 AM.
 
Old 06-23-2006, 02:11 AM   #9
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Quote:
Originally Posted by Thoddy
So - I have no idea what is different today!! But it works...
You probably rebooted in the interim.
 
Old 06-23-2006, 03:04 AM   #10
Thoddy
Member
 
Registered: Jul 2003
Location: Bremen, Germany
Distribution: Ubuntu 9.10
Posts: 106

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by syg00
You probably rebooted in the interim.
Yes. But I am pretty sure I did that yesterday, too...

But anyway: do you have to reboot for being able to read a new partition table? I thought this could be done "on the fly"...
 
Old 06-23-2006, 03:22 AM   #11
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Of course you can do it on the fly - and generally you (probably) don't need to reboot.

I always reboot (just in case) - old habits die hard.
 
Old 06-26-2006, 06:19 AM   #12
Sm1ler
Member
 
Registered: Apr 2004
Location: UK
Distribution: Fedora Core (all), Knoppix, RHEL, Centos, Debian
Posts: 100

Rep: Reputation: 16
I have noticed this in the past when using parted and "fdisk -l" updates are not displayed till a full reboot is completed, This can be a bit of a pain for me as I always forget and my laptop always fails to boot with external devices connected! D'Oh!

Anyway glad you got data back mate.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
recovering the partition table (ReiserFs) oskar Linux - General 4 05-11-2006 07:18 AM
Recovering a deleted partition table while partitions still mounted suger Linux - General 5 01-02-2006 01:31 AM
Slack 10: S-ATA = "No partition table or unknown signature on partition table"? dissolved soul Slackware - Installation 11 08-05-2004 02:12 PM
[B]PARTITION TABLE TOASTED - NEED help recovering data!!![/B] Daddio Linux - General 0 06-30-2004 08:05 PM
need help recovering partition table hank43 Linux - General 12 11-29-2003 11:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:59 AM.

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