Does there exist a native UEFI disk/partition manager

bootable-mediaefihard drivepartitioninguefi

UEFI has the infrastructure to support complex applications at boot-time. One of the most urgent needs of the hour is a UEFI application for GPT disk management.

A lot of partition management cannot be done by an OS because of how tied it is to the files on the disk. A UEFI boot manager that can exist on the ESP would have only a single requirement of the ESP not being deleted.

Also, keeping it directly in the ESP is the most convenient way to deal with disk and partition problems, as opposed to having a boot disk. In fact, having 2 separate hard disks with their own ESPs and identical copies of the diskmgmt.efi (let's call it that) will render the computer fully flexible.

Are there any such projects/products?

Best Answer

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.

Related Question