how to write new partition table?

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
Message
Author
dacq
Posts: 7
Joined: 04 Apr 2015, 22:33

how to write new partition table?

#1 Post by dacq »

I have an old hard drive, on which I created one extended partition. In order, it contained a 1.7Gb swap partition, 3 partitions for 3 linux operating systems and another partition for my data. Later I removed the first 2 linux partitions, filling its place with a new linx system. I then tried to burn a 1.7Gb linux iso file to my USB stick. However, it wrote the contents to that old hard drive.

I then used testdisk which found a FAT12 volume at the beginning, presumably the contents of that iso file, followed by the 2 linux operating systems and the data partition. I requsted to replace the FAT12 volume with a swap partition and requested to have the new partition table written. This changed nothing, however. What do I need to do to write it? In one of the main menus is the option 'Write Testdisk MBR code to first sector'. Was I supposed to have used this too?

I don't know if the original swap partition was bigger than the contents of the iso file.

User avatar
cgrenier
Site Admin
Posts: 5432
Joined: 18 Feb 2012, 15:08
Location: Le Perreux Sur Marne, France
Contact:

Re: how to write new partition table?

#2 Post by cgrenier »

For each partition found, use 'p' to list the content. If your files are listed, you should be able to access them.
Pleas epost the testdisk.log file content if you have problems.

dacq
Posts: 7
Joined: 04 Apr 2015, 22:33

Re: how to write new partition table?

#3 Post by dacq »

Yes, I've been able to list my files but, as I say, it wouldn't write the new partition table.

http://curezone.com/upload/Doc/cwl/testdisklog.txt

dacq
Posts: 7
Joined: 04 Apr 2015, 22:33

Re: how to write new partition table?

#4 Post by dacq »

Do you understand what happened? I need to know.

dacq
Posts: 7
Joined: 04 Apr 2015, 22:33

Re: how to write new partition table?

#5 Post by dacq »

The original swap partition was smaller than the contents of the burned iso file, which is now a FAT12 volume.

When the 1.7Gb iso file was written to the hard drive it was a bootable drive. I requested Testdisk to replace the FAT12 volume with a swap partition and requested to have the new partition table written. Is anything else needed to change the boot sector?

User avatar
cgrenier
Site Admin
Posts: 5432
Joined: 18 Feb 2012, 15:08
Location: Le Perreux Sur Marne, France
Contact:

Re: how to write new partition table?

#6 Post by cgrenier »

Reinstall Grub on the MBR, this should remove the trace of the FAT12 boot code sector

dacq
Posts: 7
Joined: 04 Apr 2015, 22:33

Re: how to write new partition table?

#7 Post by dacq »

I have recovered my files using Testdisk's copy function. I didn't see it earlier. Thanks.

dacq
Posts: 7
Joined: 04 Apr 2015, 22:33

Re: how to write new partition table?

#8 Post by dacq »

Do you suggest installing grub before or after writing the partition table?

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

Re: how to write new partition table?

#9 Post by Fiona »

TestDisk works partition table standard!
So it makes only one partition bootable.
A bootmanager like GRUB modifies your partition table to boot from another partition too.
That's why you should reinstall GRUB after partition recovery to get your multiboot back.

Fiona

dacq
Posts: 7
Joined: 04 Apr 2015, 22:33

Re: how to write new partition table?

#10 Post by dacq »

If I use partitioning software to create one new partition (which covers the whole hard drive) can I then use Testdisk to recover my original partitions?

Locked