All pastes #1541309 Raw Edit

HFS+ to EFI

public shellscript v1 · immutable
#1541309 ·published 2009-08-24 07:32 UTC
rendered paste body
So you formatted your EFI Partition into a HFS+ Partition using diskutil eraseVolume "HFS+" "EFI" disk0s1 (replace with appropriate disk) and now you want to convert it back. Tried to Google without any success in figuring out how to fix this without backup/partition/restore? Well here is a way to do this... You will want to make sure that you have a backup just in case... but you already do that anyway right?This will make the assumption that the disk that you formatted was disk0.% sudo -s# gpt -r show /dev/disk0      start       size  index  contents          0          1         PMBR          1          1         Pri GPT header          2         32         Pri GPT table         34          6                  40     409600      1  GPT part - 48465300-0000-11AA-AA11-00306543ECAC     409640  547017448      2  GPT part - 52414944-0000-11AA-AA11-00306543ECAC  547427088     262144      3  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC  547689232       1264           547690496   77451264      4  GPT part - EBD0A0A2-B9E5-4433-87C0-68B6B72699C7  625141760        655           625142415         32         Sec GPT table  625142447          1         Sec GPT header We are interested in line "40     409600      1  GPT part - 48465300-0000-11AA-AA11-00306543ECAC". The GUID for Mac OS X, filesystem HFS+ is "48465300-0000-11AA-AA11-00306543ECAC". This is what we want to change back into an EFI filesystem which uses the GUID of "C12A7328-F81F-11D2-BA4B-00A0C93EC93B". So how do we fix this? You do have a backup right? If you do not, and you trash your data, do not blame me!Unmount the disk:# disktool -u /dev/disk0Trash the HFS+ partition (disk0s1)# gpt remove -i 1 /dev/disk0Add the EFI partition# gpt add -b 40 -s 409600 -i 1 -t "C12A7328-F81F-11D2-BA4B-00A0C93EC93B" /dev/disk0That is all there is to it! Hope this works for you. I have done this more than once and it has worked every time!Share this info but please give credit where credit is due: paige@projectsnow.net