LinuxQuestions.org
Review your favorite Linux distribution.
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 07-16-2010, 06:02 AM   #1
julkwiec
LQ Newbie
 
Registered: Jul 2010
Posts: 1

Rep: Reputation: 0
Recovering partition table using TestDisk and sfdisk


Hi. Something bad happened to my partition table, so right now I'm working from a Live CD. My partition table is completely screwed, although the data on the lost partitions hasn't been overwritten. I've been messing around with TestDisk for about an hour, but I still didn't figure out how to fix my problem.
Before the crash, I had 5 partitions:
NTFS - 30GB
NTFS - 8GB
ext4 - 20GB
and here comes the extended partition:
linux swap - 8 GB
NTFS - 400GB

TestDisk can see all those five partitions. I can mark swap as Logical, but I can't do so with the 400GB NTFS partition - there is just no selection. Turning on "expert mode" didn't help. I have read about using sfdisk to fix partition table, but I don't think I'm able to do it by myself. I would really appreciate your help



Here's how it looks in TestDisk:

Code:
Disk /dev/sda - 500 GB / 465 GiB - CHS 60802 255 63
     Partition               Start        End    Size in sectors
D HPFS - NTFS              0   1  1  3915 254 63   62910477
D HPFS - NTFS           3916   0  1  4959 254 63   16771860 [Windows XP]
D Linux                 4960   0  1  7539 254 63   41447700
L Linux Swap            7540   1  1  8583 254 63   16771797
D HPFS - NTFS           8584   0  1 60800 254 63  838866105 [Reszta]


and, here is my slightly modified sfdisk table dump:


Code:
# partition table of /dev/sda
unit: sectors

/dev/sda1 : start=         63, size= 62910477,  Id= 7
/dev/sda2 : start=   62910540, size= 16771860,  Id= 7
/dev/sda3 : start=   79682400, size= 41447700,  Id=83
/dev/sda4 : start=          , size=         ,  Id= 5   //extended partition
/dev/sda5 : start= 	     , size= 16771797, Id=82	//8gb swap
/dev/sda6 : start=           , size= 838866105, Id= 7   //400gb ntfs

I've filled sizes according to TestDisk's findings. First 3 partitions were OK, the problem
lies in the extended partition holding 2 logical ones.
By the way, TestDisk is able to enter the 400gb partition and see the files.
 
Old 07-17-2010, 12:07 AM   #2
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 testdisk can't work it out, I'm betting you (us) won't either.
It won't let you mark it as a logical, because the allocation doesn't look like a logical - it doesn't have a room for the linked list to the next logical (effectively a sector zero).
Personally I wouldn't be rooting around with sfdisk unless I knew I had a decent backup to fall back on.
 
Old 07-17-2010, 03:58 AM   #3
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,669

Rep: Reputation: 498Reputation: 498Reputation: 498Reputation: 498Reputation: 498
Quote:
Hi. Something bad happened to my partition table, so right now I'm working from a Live CD. My partition table is completely screwed, although the data on the lost partitions hasn't been overwritten. I've been messing around with TestDisk for about an hour, but I still didn't figure out how to fix my problem.
Try using GParted, you might be able to control every partition there.

Quote:
TestDisk can see all those five partitions. I can mark swap as Logical, but I can't do so with the 400GB NTFS partition - there is just no selection. Turning on "expert mode" didn't help. I have read about using sfdisk to fix partition table, but I don't think I'm able to do it by myself. I would really appreciate your help
Try use "cfdisk" or "fdisk" commands in the terminal. You have better control there. Just be careful.

If you have important data on that NTFS partition you should back them up first before using those powerful commands.

Goodluck.
 
  


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
Partition Table Help, SATA HD, TestDisk, and Gparted ap0091 Linux - Newbie 2 03-08-2010 08:47 AM
Restoring partition table. 'Testdisk' not working. jrb0234 Linux - General 4 01-28-2010 12:52 AM
testdisk can't fix my partition table :( dmedhora Linux - General 7 11-28-2007 03:02 AM
Recovering partition table !? Thoddy Linux - Software 11 06-26-2006 06:19 AM
need help recovering partition table hank43 Linux - General 12 11-29-2003 11:04 PM

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

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