Bad partition table

Using TestDisk to repair the filesystem
Forum rules
When asking for technical support:
- Search for posts on the same topic before posting a new question.
- Give clear, specific information in the title of your post.
- Include as many details as you can, MOST POSTS WILL GET ONLY ONE OR TWO ANSWERS.
- Post a follow up with a "Thank you" or "This worked!"
- When you learn something, use that knowledge to HELP ANOTHER USER LATER.
Before posting, please read https://www.cgsecurity.org/testdisk.pdf
Locked
Message
Author
ra1110laptop
Posts: 4
Joined: 10 Jul 2012, 19:25

Bad partition table

#1 Post by ra1110laptop »

I'm trying to put four operating systems on my laptop and have extended partitions to make room. I've also installed Windows XP which looks like it damaged my filesystem. There are two problems with my filesystem that I wonder if testdisk can fix.

1) The extended partition seems to extend beyond the size of the disk.
2) There seem to be skipped sectors, in more than one place it looks as if the first sector of one partition is not directly after the last sector of the previous sector. I'd like to recover them if possible.

Code: Select all

fdisk -l

    Disk /dev/sda: 320.1 GB, 320072933376 bytes
    255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x8556dbfc

       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *        2048      409599      203776    7  HPFS/NTFS/exFAT
    /dev/sda2          409600   466876415   233233408    7  HPFS/NTFS/exFAT
    /dev/sda3       466878447   625153409    79137481+   f  W95 Ext'd (LBA)
    /dev/sda5       466878464   489406463    11264000   83  Linux
    /dev/sda6       489408512   511932415    11261952    7  HPFS/NTFS/exFAT
    /dev/sda7       511934464   616951807    52508672   83  Linux
    /dev/sda8       616953856   625141743     4093944   82  Linux swap / Solaris
I will be installing and running testdisk from a linuxmint 13 livecd.

I appreciate any help I can get.

User avatar
Fiona
Posts: 2835
Joined: 18 Feb 2012, 17:19
Location: Ludwigsburg/Stuttgart - Germany

Re: Bad partition table

#2 Post by Fiona »

I'd need some infos from Analyse (it's your current partition table) Quick Search and if no partition is found from Deeper Search also.
If a partition is found, you can check it and press p to have a try to list data.
TestDisk creates a logfile in your testdisk folder.
You can open it and copy and paste the content here.

Fiona

ra1110laptop
Posts: 4
Joined: 10 Jul 2012, 19:25

Re: Bad partition table

#3 Post by ra1110laptop »

Thanks. I've attached the entire log as a zip file, and the part that displays the partition table here.

Code: Select all

Analyse Disk /dev/sda - 320 GB / 298 GiB - CHS 38913 255 63
Geometry from i386 MBR: head=255 sector=63
NTFS at 0/32/33
NTFS at 25/126/38
NTFS at 30464/69/6
get_geometry_from_list_part_aux head=8 nbr=1
get_geometry_from_list_part_aux head=16 nbr=1
Current partition structure:
 1 * HPFS - NTFS              0  32 33    25 126 37     407552 [SYSTEM]
 2 P HPFS - NTFS             25 126 38 29061 181 48  466466816
 3 E extended LBA         29061 214  1 38913 254 63  158274963
 5 L Linux                29061 214 18 30464  36 36   22528000
   X extended             30464  68  1 31866  81 23   22523972
 6 L HPFS - NTFS          30464  69  6 31866  81 23   22523904
   X extended             31866 112  1 38403 120 53  105017462
 7 L Linux                31866 113 56 38403 120 53  105017344
   X extended             38403 152  1 38913  69 52    8187973
 8 L Linux Swap           38403 153 23 38913  69 52    8187888
Attachments
testdisk.log.zip
Testdisk log with analyze deeper search
(2.94 KiB) Downloaded 547 times

ra1110laptop
Posts: 4
Joined: 10 Jul 2012, 19:25

Re: Bad partition table

#4 Post by ra1110laptop »

testdisk and fdisk seem to disagree about the size of my hard drive.

Is there a way I can get reliable information from either some software or from hp?

ra1110laptop
Posts: 4
Joined: 10 Jul 2012, 19:25

Re: Bad partition table

#5 Post by ra1110laptop »

I ended up manually adjusting the size of the extended partition so that it is one more than the end of the last logical partition. I used a different editor and the calculator but followed these linux instructions.

Code: Select all

sudo sfdisk -d /dev/sda > temp
sudo vi temp
sudo sh -c "cat temp | sfdisk /dev/sda"
Thanks for your help.

Locked