LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 12-31-2009, 11:14 PM   #1
j-jock
LQ Newbie
 
Registered: Dec 2007
Posts: 6

Rep: Reputation: 0
how do I use fdisk to correct a partition table overwritten by windows


I have 2 hard drives on my older computer, the older one with windows ME, and Mandrake, and the newer drive which has Kubuntu. What has happened, is that the id10ts that write the updates for Kubuntu started modifying the grub list.menu, and as a result they wrote over my boot menu before I was aware they had modified my grub conf menu.
The next time I booted up winME, it did a disk scan and completely over wrote my partitions and made one big C partition. I have not written to this disk since, and I have my original partition table saved and would like to re-write it to the hard-drive to recover my photos. ( I have photos on my fat 32 and my ext3 partitions )
My original partition table looks like this:
type name size start and end
/hda1 win95 fat32 C 2.9gig Cyl 0-382
/hda 5 " D 11gig Cyl 383-1877
/hda8 " E 11gig Cyl 3373-4865
/hda6 Ext2 Boot 2gig Cyl 1878-2139 ( 83 )
/hda9 ext3 /root 5.3gig cyl 2149-2849
/hda11 ext3 /home 3.7gig cyl 2881-3372

This is the table I want to restore, can someone give me a step by step of the commands I need to use to do the re-write. I know that it isn't that difficult to do, but it has been so long since I have had to do a repair that I want to ensure that I do it correctly the first time. All I want to do is recover my pictures and data, or maybe even get the Mandrake linux working again so that I can extract everything of value before the drive dies.
Thanks and Happy New Year,
Bob
 
Old 01-01-2010, 03:04 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,137

Rep: Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122
If t'was me I'd use testdisk to do all the grunt work, but if you insist on fdisk...
Just run it (as root), then as it says, use "m" to see the commands you need. "n" to add a new partition - you may be able to give non-sequential partition numbers, I can't remember - then follow the prompts to use cylinder allocation.
"w" to write the disk, "yes" to confirm.
Reboot, and see what happens.

If it's wrong, no harm done, do it all again.

Note my sigline ...
 
1 members found this post helpful.
Old 01-01-2010, 05:32 AM   #3
gregorian
Member
 
Registered: Apr 2006
Posts: 509

Rep: Reputation: 34
I was wondering if you could use a live disc to recover your pictures?
 
Old 01-01-2010, 08:10 AM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
That data is not just one partition table....

The first 4 partitions are in the MBR (1st sector of the disk), and then each logical partition (#5 and higher) is defined in a linked list using another partition table for each of the logical partitions.

Given that you have the data, it is certainly possible to re-construct things, but it will take a bit of hand work. It **might** be easier to just use Photorec.

One thing to consider is to clone the disk before starting to do anything.
 
1 members found this post helpful.
Old 01-01-2010, 07:41 PM   #6
j-jock
LQ Newbie
 
Registered: Dec 2007
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks All for the replies. I didn't think it was worth while to attempt to back up the corrupted contents because it is possible that winders has already overwritten my data. I'll have a look at test disk right now before I attempt the re-write.
Thanks for the ideas, and Happy New Year
Bob
 
  


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
fdisk ruined my partition table hefi Linux - Software 2 12-17-2009 06:26 AM
fdisk partition table representation vofka Linux - General 3 06-27-2009 03:20 PM
fdisk will not write partition table winter_wizzerd Slackware 5 01-06-2007 11:08 AM
fdisk said my HD didn't have valid partition table??? bombman Linux - Newbie 6 08-28-2006 11:53 AM
Suse 9.3: Partition Table overwritten on multi-boot system ChillyWillie Linux - Hardware 4 08-24-2005 04:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 01:26 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