Partition wrote as "Primary Bootable" seems messed up my HD

How to use TestDisk to recover lost partition
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
jrfernan
Posts: 3
Joined: 16 Aug 2015, 14:59

Partition wrote as "Primary Bootable" seems messed up my HD

#1 Post by jrfernan »

Hello all,

I had Ubuntu 12.04 installed with dual boot with Windows.

Due to a failure on the notebook, I removed the hard disk.

Connecting the disk via USB, I tried to access the partitions in Ubuntu 14.04, but they did not appear in the file manager. They appeared only using Gparted, as “ext4”, as unmounted, but I could not mount them. Everything looked OK, as I could see my partitions as they were before notebook crash, but no way to mount them. The partition with important data was one ext4 (158 GB).

When running testdisk, trying to solve the problem, the Linux and windows partitions could be seen there, but when by pressing “P” to see the files, no file could be seen (although I'm sure they are there).

Then I did what I'm afraid has been the big mistake: I changed a partition that had no indication of partition type to “*=Primary bootable”, and wrote the partition table with testdisk.

After that, even with Gparted the partitions do not appear as ext4 anymore. They appear as partition and file system “unallocated” and partition as /dev/sdc1 and file system “unknown”.

Currently, the analyse with testdisk states:

____________________________________________________________________________
TestDisk 6.14, Data Recovery Utility, July 2013
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

Disk /dev/sdc - 320 GB / 298 GiB - CHS 38913 255 63
Current partition structure:
Partition Start End Size in sectors

No ext2, JFS, Reiser, cramfs or XFS marker
1 * Linux 12304 211 4 19599 57 42 117184512
1 * Linux 12304 211 4 19599 57 42 117184512


and, with “Quick Search”:


Disk /dev/sdc - 320 GB / 298 GiB - CHS 38913 255 63
Partition Start End Size in sectors
HPFS - NTFS 0 32 33 25 126 37 407552 [SYSTEM]
HPFS - NTFS 25 126 38 12183 53 30 195313664
Linux Swap 12183 53 31 12304 178 34 1951744
> Linux 12304 211 4 19599 57 42 117184512
Linux 19599 90 12 38900 4 16 310065152
FAT32 LBA 38900 4 17 38913 70 5 212992 [HP_TOOLS]


The most important partition to me is the Linux 19599 one.

I have the testdisk log file, but I'm not sure whether it logged everything from the beginning of my attempts.
I've also tried to move the hard disk to another notebook, but the results have been the same...

Can anyone help me please?

Thanks!

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

Re: Partition wrote as "Primary Bootable" seems messed up my

#2 Post by Fiona »

Your current partition structure ( current partition table) contains only one partition.
Your message "No ext2, JFS, Reiser, cramfs or XFS marker" indicates, that you've probably a problem with your superblock.
Some info on how you can repair your superblock:
http://www.cgsecurity.org/wiki/Advanced ... SuperBlock
It should work on ext4 partitions also.
After Quick Search you should have another try to list your files.
If it's not successful, you can consider to run Deeper Search too?

Intel partition table supports up to 4 primary partitions.
In most cases 3 primary are used and 1 extended for logical partitions.
It's only necessary to set up 3 partitions as primary and only one partition can be active and bootable.
The extended partition can't be set and appears automatically at the menu "Write", where you write your partitions into your partition table.
TestDisk recognizes it, after you were setting your remained important partitions to L for logical.
You always have to write your complete partitions (partition structure) into your partition table.
TestDisk works Intel Standard and overrides modifications of a boot manager like Grub.
That's why Grub must be repaired or reinstalled after partition recovery.
It's only in case, if you've had a bootmanager installed?
Also some Info:
http://ubuntuforums.org/showthread.php?t=1643891

Fiona
jrfernan
Posts: 3
Joined: 16 Aug 2015, 14:59

Re: Partition wrote as "Primary Bootable" seems messed up my

#3 Post by jrfernan »

Hello Fiona,

Thank you very much for your attention.
I ran Testdisk as your said, and here are the results:

____________________________________________________________________________________
TestDisk 6.14, Data Recovery Utility, July 2013
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

Disk /dev/sdc - 320 GB / 298 GiB - CHS 38913 255 63

Partition Start End Size in sectors

> Linux 12304 211 4 19599 57 42 117184512
superblock 32768, blocksize=4096 []
superblock 98304, blocksize=4096 []
superblock 163840, blocksize=4096 []
superblock 229376, blocksize=4096 []
superblock 294912, blocksize=4096 []
superblock 819200, blocksize=4096 []
superblock 884736, blocksize=4096 []
superblock 1605632, blocksize=4096 []
superblock 2654208, blocksize=4096 []
superblock 4096000, blocksize=4096 []

To repair the filesystem using alternate superblock, run
>fsck.ext4 -p -b superblock -B blocksize device
____________________________________________________________________________________

It seems that my guess would be:
fsck.ext4 -p -b 32768 -B 4096 dev/sdc

correct?

Before trying to use the fsck, I just need to ask:
should I make an image of the disk before? Do you think there is a significant risk to my data?

Thanks again!
Best regards!
sudhir
Posts: 1
Joined: 18 Aug 2015, 06:55

Re: Partition wrote as "Primary Bootable" seems messed up my

#4 Post by sudhir »

i did write in reservabale memory on my laptop from testdisk on windows 8.1 and it said reboot to take place and i restarted my pc .But it's not opening showing something c:/> in last word .
Please help me .
User avatar
Fiona
Posts: 2835
Joined: 18 Feb 2012, 17:19
Location: Ludwigsburg/Stuttgart - Germany

Re: Partition wrote as "Primary Bootable" seems messed up my

#5 Post by Fiona »

It seems that my guess would be:
fsck.ext4 -p -b 32768 -B 4096 dev/sdc

correct?
Yes, it's correct.
To create an image or to clone your disk is a good idea.
Current partition structure:
Partition Start End Size in sectors

No ext2, JFS, Reiser, cramfs or XFS marker
1 * Linux 12304 211 4 19599 57 42 117184512
1 * Linux 12304 211 4 19599 57 42 117184512
Is this your most important partition?
The next partition starts at cylinder 19599 too.
If you'd like to write your current partition structure it should look like this:
and, with “Quick Search”:


Disk /dev/sdc - 320 GB / 298 GiB - CHS 38913 255 63
Partition Start End Size in sectors
* HPFS - NTFS 0 32 33 25 126 37 407552 [SYSTEM]
P HPFS - NTFS 25 126 38 12183 53 30 195313664
P Linux Swap 12183 53 31 12304 178 34 1951744
L Linux 12304 211 4 19599 57 42 117184512
L Linux 19599 90 12 38900 4 16 310065152
L FAT32 LBA 38900 4 17 38913 70 5 212992 [HP_TOOLS]
Please let me know, have you been able to list your files on the other partitions?
Can you try to run Deeper Search too and have another try to list your files?
Currently a solution would be to write your partitions like I've suggested above.
I suppose that your first system partition would be your windows boot partition?
Did you use a boot manager like Grub?
It probably has to be reinstalled or repaired.

Fiona
Locked