# Lost Mac Partition HFS+



## AlphaWolf13 (Feb 11, 2009)

I lost a Mac Partition HFS+ on my external hard drive by accidentally formatting over it. I was wondering if anyone knew of the best way to retrieve the partition? 

I ran a recovery program and it detected the lost items but wanted me to pay to recover them. I also ran testdisk and it found the partition, but unfortunately I can't use testdisk to recover the partition, it says for me to use pdisk, but I am at a lost as to how to use pdisk.

Any suggestions would be greatly appreciated!!


----------



## sinclair_tm (Mar 11, 2005)

The help wiki for testdisk tells you how to use pdisk to recover the partition.


----------



## AlphaWolf13 (Feb 11, 2009)

sinclair_tm said:


> The help wiki for testdisk tells you how to use pdisk to recover the partition.


The help disk is kind of hard to understand completely. They give an example of the pdisk commands to run, but don't give anything more specific. Wouldn't the commands they want to run just create a new partition instead of recreating the lost one though? Sorry, I just want to be sure because I don't want to risk losing the data...


Repairing/Rewriting Your Drive's Partition Map
To rewrite the partition map given by TestDisk, use the command pdisk. If pdisk reports, "No partition map exists," it may be necessary to initialize the disk. Once the disk is initialized, the numeric entries defining the partition may completed and a name may be assigned to the partition ("rec_part" in the example below). Given the following information from TestDisk,

Disk /dev/rdisk1 - 160 GB / 149 GiB - CHS 312581808 1 1 
Partition Start End Size in sectors 
P HFS 262208 312581791 312319584 

Start pdisk: sudo pdisk /dev/rdisk1
In this example, the required pdisk commands are:

pdisk: No valid block 1 on '/dev/rdisk1'
Edit /dev/rdisk1 -
Command (? for help): c
No partition map exists
Command (? for help): i
Command (? for help): c
First block: 262208
Length in blocks: 312319584
Name of partition: rec_part
Command (? for help): w
Command (? for help): q


----------



## AlphaWolf13 (Feb 11, 2009)

Also, pdisk states that I must initialize the disk before I can use pdisk on it. Are you sure this will still work properly?


----------



## sinclair_tm (Mar 11, 2005)

i've never used it, so i'm not sure. i've only recovered fat32 disks with testdisk. sorry.


----------

