It's highly specialized and limited, but gptsync
runs as an EFI application. This program was originally part of the now-abandoned rEFIt project. I've updated it for rEFInd, though. Note that gptsync
is exclusively used to create hybrid MBRs, which are ugly, dangerous, and of limited utility, so I don't recommend gptsync
for general use; but for certain specialized use cases (such as dual-booting Windows and OS X on a Mac), it can be a useful tool.
MariusMatutiae suggested using my gdisk
, but it's not available as a native EFI application. It probably won't be in the near future, either, because gdisk
is written in C++ and I know of no affordable C++ compiler for EFI. Most EFI applications are written in C, and it's possible to build C applications under Linux with GCC and either the GNU-EFI or Tianocore toolkits. C++ can theoretically be compiled for EFI with GCC, but most of the C++ library is not supported, and gdisk
relies heavily on the C++ library. There's an Intel C++ compiler for EFI, but it's ridiculously expensive (roughly $1,000, IIRC), so I'm not going to buy it. If somebody with access to that compiler would care to try to build gdisk
for EFI, I'd be happy to help out or accept patches, but for the moment that won't happen.
An easier solution might be to port parted
or fdisk
to EFI. (Until recently, fdisk
didn't support GPT; but the latest versions do.) I haven't looked into this possibility, though.
For the moment, partitioning can be done by booting a live CD/DVD/USB flash drive. Granted, this isn't as fast as launching a partitioning tool from an EFI shell or EFI boot manager, but it's not that slow to get up and running. Disk partitioning is a task that shouldn't need to be performed very often, except perhaps in a lab that does testing of hardware or OS configurations or the like.
UPDATE:
As alluded to in the comments, the project to port GPT fdisk to EFI has borne fruit, in the form of the UEFI GPT fdisk project. This is basically an add-on library that provides a subset of C++ features for EFI -- enough to build the gdisk
binary for EFI.