Contribute
Register

how to erase and format efi partition?

Status
Not open for further replies.
Last edited:
Code:
diskutil reformat disk0s1

LasVegas
Hi there man ! I was looking for a way to format my EFI partition to start from scratch with Clover and I followed your command but I think I messed up, now it shows as Microsoft Basic Data ! :( How can I make it EFI EFI again? :( I will appreciate your help !!! Thanks in advance
 
Hi there man ! I was looking for a way to format my EFI partition to start from scratch with Clover and I followed your command but I think I messed up, now it shows as Microsoft Basic Data ! :( How can I make it EFI EFI again? :( I will appreciate your help !!! Thanks in advance
You can use gdisk from GPT fdisk to change the type code and name
 
You can use gdisk from GPT fdisk to change the type code and name
Thank you so much !!! I got it installed, would you know how I do that? My EFI is disk0s1.
I suppose I have to change the Type to EFI and Name to EFI but do not know the command lines
Is it correct that it remains as MS-DOS (FAT)?

Thanks Mate !!!
 
Thank you so much !!! I got it installed, would you know how I do that? My EFI is disk0s1.
I suppose I have to change the Type to EFI and Name to EFI but do not know the command lines
Is it correct that it remains as MS-DOS (FAT)?

Thanks Mate !!!
Yes EFI partitions are FAT with a special GUID. Maybe this is the sequence
Code:
$ gdisk /dev/disk0
> t
> 1
> EF00
> c
> 1
> EFI
> w
> y
'w' writes the changes, you can use 'p' any time to view your progress when it asks for a command
 
Yes EFI partitions are FAT with a special GUID. Maybe this is the sequence
Code:
$ gdisk /dev/disk0
> t
> 1
> EF00
> c
> 1
> EFI
> w
> y
'w' writes the changes, you can use 'p' any time to view your progress when it asks for a command
Thank you so much mate !! You are really helping me, I've followed your instructions, it seemed fine but I rebooted then tried to mount but it still fails, Now the Partition is EFI but the Name remains empty even though I renamed it.

I am doing the whole thing again

Code:
sudo gdisk /dev/disk0
Password:
GPT fdisk (gdisk) version 1.0.3

Warning: Devices opened with shared lock will not have their
partition table automatically reloaded!
Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

And this time checked with "p" after changing the type again to EFI and this comes up:

Code:
Command (? for help): p
Disk /dev/disk0: 234441648 sectors, 111.8 GiB
Sector size (logical): 512 bytes
Disk identifier (GUID): BF0A4969-2ED2-4FC1-8254-C83D9093C104
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 234441614
Partitions will be aligned on 8-sector boundaries
Total free space is 13 sectors (6.5 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1              40          409639   200.0 MiB   EF00  EFI
   2          409640       233172071   111.0 GiB   AF00
   3       233172072       234441607   619.9 MiB   AB00
 
Last edited:
@vulgo

Like, do you see anything wrong here?

Code:
sudo gpt -r show /dev/disk0
Password:
      start       size  index  contents
          0          1         PMBR
          1          1         Pri GPT header
          2         32         Pri GPT table
         34          6        
         40     409600      1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
     409640  232762432      2  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
  233172072    1269536      3  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
  234441608          7        
  234441615         32         Sec GPT table
  234441647          1         Sec GPT header
 
@vulgo

Like, do you see anything wrong here?

Code:
sudo gpt -r show /dev/disk0
Password:
      start       size  index  contents
          0          1         PMBR
          1          1         Pri GPT header
          2         32         Pri GPT table
         34          6       
         40     409600      1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
     409640  232762432      2  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
  233172072    1269536      3  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
  234441608          7       
  234441615         32         Sec GPT table
  234441647          1         Sec GPT header
I think that is how it should be. Try mounting with
Code:
$ diskutil mountdisk disk0s1
If it shows up in Finder as Untitled you can rename it to EFI there.
 
I think that is how it should be. Try mounting with
Code:
$ diskutil mountdisk disk0s1
If it shows up in Finder as Untitled you can rename it to EFI there.
Thank you so much ! No Luck :(

Your command worked, it says mounted successfully but it won't show up anywhere.

Code:
sudo diskutil mountdisk disk0s1
Password:
Volume(s) mounted successfully
Code:
diskutil list
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *120.0 GB   disk0
   1:                        EFI                         209.7 MB   disk0s1
   2:                  Apple_HFS HACKINTOSH              119.2 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
Code:
sudo gdisk /dev/disk0
GPT fdisk (gdisk) version 1.0.3

Warning: Devices opened with shared lock will not have their
partition table automatically reloaded!
Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): v

No problems found. 13 free sectors (6.5 KiB) available in 2
segments, the largest of which is 7 (3.5 KiB) in size.

Command (? for help): i
Partition number (1-3): 1
Partition GUID code: C12A7328-F81F-11D2-BA4B-00A0C93EC93B (EFI System)
Partition unique GUID: 3D6A2740-9B94-4ADE-A2BA-D5208B212D99
First sector: 40 (at 20.0 KiB)
Last sector: 409639 (at 200.0 MiB)
Partition size: 409600 sectors (200.0 MiB)
Attribute flags: 0000000000000000
Partition name: 'EFI'

It will not show up in Finder, Not in Disk Utility, and EFI Mounter V3 will come up with this error:

upload_2017-10-2_10-37-31.png


See it even shows Partition Name EFI but in the list it does not have a Name :(:(

Is the "MBR: Protective" normal?

Do you think I'll have to start all over ? :( I had recently started fresh with Sierra :banghead:
 
Thank you so much ! No Luck :(

Your command worked, it says mounted successfully but it won't show up anywhere.

Code:
sudo diskutil mountdisk disk0s1
Password:
Volume(s) mounted successfully
Code:
diskutil list
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *120.0 GB   disk0
   1:                        EFI                         209.7 MB   disk0s1
   2:                  Apple_HFS HACKINTOSH              119.2 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
Code:
sudo gdisk /dev/disk0
GPT fdisk (gdisk) version 1.0.3

Warning: Devices opened with shared lock will not have their
partition table automatically reloaded!
Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): v

No problems found. 13 free sectors (6.5 KiB) available in 2
segments, the largest of which is 7 (3.5 KiB) in size.

Command (? for help): i
Partition number (1-3): 1
Partition GUID code: C12A7328-F81F-11D2-BA4B-00A0C93EC93B (EFI System)
Partition unique GUID: 3D6A2740-9B94-4ADE-A2BA-D5208B212D99
First sector: 40 (at 20.0 KiB)
Last sector: 409639 (at 200.0 MiB)
Partition size: 409600 sectors (200.0 MiB)
Attribute flags: 0000000000000000
Partition name: 'EFI'

It will not show up in Finder, Not in Disk Utility, and EFI Mounter V3 will come up with this error:

View attachment 282569

See it even shows Partition Name EFI but in the list it does not have a Name :(:(

Is the "MBR: Protective" normal?

Do you think I'll have to start all over ? :( I had recently started fresh with Sierra :banghead:
The EFI partition is valid. The mounting script doesn't work for whatever reason. Try this
Code:
$ diskutil mount disk0s1
$ diskutil rename disk0s1 EFI
macOS apparently ignore the name in the partition table and only considers filesystem label, neither of which are required by UEFI (and neither is the partition GUID for that matter)

'MBR: Protective' Normal GPT disks have an old style MBR partition table, alongside the GUID partition table that masks the entire disk as being taken up by a single MBR partition. Without this, legacy software that cannot understand GPT would see the disk as empty creating a potential for confusion and data loss, hence 'protective'.
 
Last edited:
Status
Not open for further replies.
Back
Top