Thursday, November 11, 2010

EFI Partition

How to format EFI partition on Mac OS X (use it for boot partition)?
- This is useful if the hard disk is formatted with GUID/GPT partition table.
- On Mac OS X Leopard (10.5 to 10.5.X)
diskutil eraseVolume "HFS+" "EFI" /dev/diskXs1
- On Mac OS X Snow Leopard (10.6 to 10.6.X)
newfs_hfs -v EFI /dev/diskXs1
- Note: change the "X" with hard disk number (e.g. 0, 1, etc). Check with diskutil list.

How to restore or recover EFI partition?
- This is useful if your EFI partition auto-mounted (it is not supposed to) whenever boot into Mac OS X.
- This happen when you use "diskutil eraseVolume "HFS+" "EFI" /dev/diskXs1" on Snow Leopard to format the EFI partition.
- Steps are:-
1) Boot with Windows Vista or 7 installation DVD if Windows is not installed or corrupted.
2) Follow on-screen instruction, just like you're going to install Windows.
3) Select Custom.
4) You will see the hard disk partitions. Delete or remove the first 200MB partition. Sometime there are more than one 200MB partition at the beginning of the hard disk partitions, delete all of it (at the beginning only). Reboot.
5) Boot into OSX.
6) Execute these commands (assuming it only one hard disk - /dev/rdisk0. Press enter for each commands):-
fdisk -e /dev/rdisk0
Enter 'help' for information
fdisk: 1> p
Disk: /dev/rdisk0    geometry: 19457/255/63 [312581808 sectors]
Offset: 0    Signature: 0xAA55
         Starting       Ending
 #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
------------------------------------------------------------------------
 1: EE 1023 254  63 - 1023 254  63 [         1 -     409639]
 2: AF 1023 254  63 - 1023 254  63 [    409640 -  156290904] HFS+       
*3: 07 1023 254  63 - 1023 254  63 [ 156962688 -  155356936] HPFS/QNX/AUX
 4: 00    0   0   0 -    0   0   0 [         0 -          0] unused     
fdisk: 1> e 1
         Starting       Ending
 #: id  cyl  hd sec -  cyl  hd sec [     start -       size]
------------------------------------------------------------------------
 1: EE 1023 254  63 - 1023 254  63 [         1 -     409639]
Partition id ('0' to disable)  [0 - FF]: [EE] (? for help) EE
Do you wish to edit in CHS mode? [n] n
Partition offset [0 - 312581808]: [63] 1
Partition size [1 - 312581807]: [312581807]
fdisk:*1>  w

(just enter these)
y
u
q
y
7) Reboot
- Now the EFI partition should be look like this (Type = EFI):-
diskutil list/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *160.0 GB   disk0
   1:                        EFI                         209.7 MB   disk0s1
   2:                  Apple_HFS OSX                     80.0 GB    disk0s2
   3:       Microsoft Basic Data                         79.5 GB    disk0s3


- Use this command to format the EFI partition:-
newfs_hfs -v EFI /dev/disk0s1

Good luck! :D
 

7 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. Just to inform that this stuff didn't work for me.
    Messed with it for test purposes, trying to find if
    there's a way to restore the ESP to the EFI specification.
    Pm me at one of the scene forums if you need any info.

    Stay safe...

    p.s.: sorry for the post/delete, post/delete,... no edit option :-/

    ReplyDelete
  4. Hey man, sorry for writing my question as a comment but couldnt find a way to reach you. I saw your post about hd 4570 here : http://www.insanelymac.com/forum/index.php?showtopic=218706&st=20&p=1655710&#entry1655710 and tried to make dual screen work in my studio 1555 laptop but couldnt manage it. Everything is working now except this. Could you give me a hand? Please shout me whenever you want : geryit@gmail.com , www.geryit.com

    ReplyDelete
  5. Hi Azimutz,

    Sorry for replying late. I'm currently rarely active in the scene.

    BTW, thank you for letting me know. :) Sorry it doesn't work for you. I'll contact you in one of the scene forum later.

    ReplyDelete
  6. This comment has been removed by the author.

    ReplyDelete
  7. This comment has been removed by the author.

    ReplyDelete