Restoring disk/partition image to usable form

How to use TestDisk to recover lost partition
Post Reply
User avatar
Posts: 1
Joined: 14 May 2012, 22:44

Restoring disk/partition image to usable form

Post by hunger » 14 May 2012, 23:20


I'm not sure if what I want can actually be done, nor if testdisk is necessarily the best tool for the job, but I'm counting on this community's expertise, so here goes...

I'm currently in the process of migrating some systems from physical to virtual existence (p2v).
One such case is a Linux system located on a gpt disk with hybrid mbr. The disk belongs to a macbook, which triple boots to macosx,linux and windows 8-)

Here's my problem: I've 'extracted' the Linux partition with 'dd' and converted the resulting image into form usable with VirtualBox.(though obviously not bootable)
What I get is a 'non-partitioned media' when viewed with testdisk, which does however contain the correct (ext4) filesystem (I can even list files and so on).
Now in theory, all I need is a fresh mbr for this 'virtual disk' referencing this single partition, so that I can install a bootloader and boot. I'm in search of a way to achieve this.

To sum up, I've got a working image of my system, fs is intact and can be viewed with testdisk, but only when selecting 'non partitioned media' for the partition type(which means I cannot write what td finds), when using 'Intel' it searches and eventually finds multiple references to 'something', nothing restoreable though. ds yields no further results.

Thanks for any pointers or fixes!

Sponsored links

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

Re: Restoring disk/partition image to usable form

Post by Fiona » 15 May 2012, 06:58

I didn't test such situation before! :o
You should test it on a disk with no valuable data.
On partition table type none, write the values like your disk is listed under the menu Analyse down.
You only need the values from heads and sectors.
The amount of heads using partition table type Nonte is often 1 and sectors 1 also.
In TestDisk select your image and choose partition table type intel.
Befor you go to Analyse, go to geometry and edit the value of heads and sectors to the values of partition table type None.
TestDisk will count your cylinder automatically.
That's why there is no necessity to change anything about the amount of the cylinder.
Repeat your diagnose using analyse.
Now it might be possible to diagnose your image using partition table type intel and you could have a try to write a partition table.
Test it.
In case if you experience problems, you would be able to write an mbr code (it's only the bootloader and signature that your mbr is valid) and writing then your partition table.
But try the other suggestion first.

It's only intended for testing purposes!


Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests