macmesser

Contributor
Original poster
Aug 13, 2012
872
189
Long Island, NY USA
While using Drive Genius 3 to partition an eSATA drive for use with Time Machine, I noticed that the drive contained three tiny partitions which were not visible in Disk Utility. One is an "EFI System Partition" named "disk5s1" and is about 210 MB in size. I've seen names like this in Disk Utility when first installing and formatting drives in my eSATA enclosure. The other partitions, named "Free space #1" and "Free space #2", are "Apple_Free" partitions and are 3KB and 132MB respectively.

What's up with these partitions? Not that they take much space on a 2TB drive, but can they be deleted?
 

Tesselator

macrumors 601
Jan 9, 2008
4,601
4
Japan
On Apple–Intel architecture Macs, the EFI partition is initially blank and not used for booting. However, the EFI partition is used as a staging area for firmware updates specifically, it places a firmware flash utility (EFI binary) and data file (FD – "Firmware Device") in the directory EFI/APPLE/FIRMWARE which is then run when rebooting the system in "flash firmware" mode.

If deleted, the system will still boot, and the boot manager will still allow users to choose whether to start a Boot Camp partition or the default Mac OS X, but firmware updates will fail.

For use as storage or with Time Machine and not as a boot drive which might need to participate in a firmware upgrade procedure, I believe you can safely delete the EFI partition as well. It shouldn't affect anything.



To delete the EFI (ESP) partition:
sudo gpt remove -i 1 disk1
Assuming it's disk1 of course. (be careful!)

To recreate an EFI (ESP) partition:
sudo gpt add -b 40 -i 1 -s 409600 -t C12A7328-F81F-11D2-BA4B-00A0C93EC93B disk1
sudo dd if=/dev/disk0s1 of=/dev/disk1s1
Again assuming it's disk1 you're working on.



The later set of two commands will create the EFI partition on your external drive and clone the EFI partition from your boot drive over to it. The cloning is needed as EFI has a very specific structure as documented here:
http://developer.apple.com/library/...apple_ref/doc/uid/DTS10003927-CH1-SUBSECTION6
 
Last edited:

Weaselboy

Moderator
Staff member
Jan 23, 2005
31,809
11,517
California
On Apple–Intel architecture Macs, the EFI partition is initially blank and not used for booting. However, the EFI partition is used as a staging area for firmware updates specifically, it places a firmware flash utility (EFI binary) and data file (FD – "Firmware Device") in the directory EFI/APPLE/FIRMWARE which is then run when rebooting the system in "flash firmware" mode.

Good point. I wonder if not having an EFI partition on the external would impact a Time Machine drive's ability to boot for a restore?
 

Quad5Ny

macrumors 6502a
Sep 13, 2009
982
19
New York, USA
The EFI System partition is part of the GPT spec.

The 3KB partition is slack space used to align the other partitions.

The 2 other blocks are just free space not partitions, Apple's standard disk layout places that amount of free space between each partition.

Don't mess with it, everything is perfectly normal. Also why the heck aren't you using Disk Utility to partition the drive? :confused:
 

macmesser

Contributor
Original poster
Aug 13, 2012
872
189
Long Island, NY USA
On Apple–Intel architecture Macs, the EFI partition is initially blank and not used for booting. However, the EFI partition is used as a staging area for firmware updates specifically, it places a firmware flash utility (EFI binary) and data file (FD – "Firmware Device") in the directory EFI/APPLE/FIRMWARE which is then run when rebooting the system in "flash firmware" mode.

If deleted, the system will still boot, and the boot manager will still allow users to choose whether to start a Boot Camp partition or the default Mac OS X, but firmware updates will fail.

For use as storage or with Time Machine and not as a boot drive which might need to participate in a firmware upgrade procedure, I believe you can safely delete the EFI partition as well. It shouldn't affect anything.



To delete the EFI (ESP) partition:
sudo gpt remove -i 1 disk1
Assuming it's disk1 of course. (be careful!)

To recreate an EFI (ESP) partition:
sudo gpt add -b 40 -i 1 -s 409600 -t C12A7328-F81F-11D2-BA4B-00A0C93EC93B disk1
sudo dd if=/dev/disk0s1 of=/dev/disk1s1
Again assuming it's disk1 you're working on.



The later set of two commands will create the EFI partition on your external drive and clone the EFI partition from your boot drive over to it. The cloning is needed as EFI has a very specific structure as documented here:
http://developer.apple.com/library/...apple_ref/doc/uid/DTS10003927-CH1-SUBSECTION6


Thanks for sharing your knowledge. Great to know this stuff even for a non-engineer. The drive in question was simply formatted and partitioned for data storage. There was no OS installation. Am I correct in thinking the EFI on it was added during Disk Utility formatting but is empty, and that had an OS installation been done the files and directory structure would be installed along with the OS?
 

Quad5Ny

macrumors 6502a
Sep 13, 2009
982
19
New York, USA
The EFI partition is always empty on OS X, the only time you'll find something on it is during a Firmware update.

Disk utility creates the a EFI partition whenever you initialize a GUID Partition Table (GPT) disk. It does this regardless of whether you install a operating system on it or not.
 

Tesselator

macrumors 601
Jan 9, 2008
4,601
4
Japan
Good point. I wonder if not having an EFI partition on the external would impact a Time Machine drive's ability to boot for a restore?

Nope, it sure wouldn't. Err, shouldn't...



BTW, I have to agree with Quad5Ny, While these things are all perfectly possible it's a much better idea to stick to the prescribed methods and tools. What are you losing, about 220MB all total? compress a few files and you'll get that right back. :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.