how to write new partition table?

How to use TestDisk to recover lost partition
Message
Author
dacq
Posts: 7
Joined: 04 Apr 2015, 22:33

how to write new partition table?

#1 Post by dacq » 05 Apr 2015, 15:19

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.

Sponsored links

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

Re: how to write new partition table?

#2 Post by cgrenier » 07 Apr 2015, 07:14

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 » 07 Apr 2015, 20:57

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 » 10 Apr 2015, 19:48

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 » 11 Apr 2015, 18:41

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: 3505
Joined: 18 Feb 2012, 15:08
Location: Le Perreux Sur Marne, France
Contact:

Re: how to write new partition table?

#6 Post by cgrenier » 15 Apr 2015, 06:53

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 » 15 Apr 2015, 21:28

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 » 15 Apr 2015, 22:35

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

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

Re: how to write new partition table?

#9 Post by Fiona » 19 Apr 2015, 09:34

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 » 22 Apr 2015, 12:30

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?

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests