Resizing small EFI partition ############################ :category: Misc :date: 2023-04-17 15:46:00 +0300 :tags: efi, fat32, parted, linux, windows, til It started with the firmware failing to update because the EFI partition was low on free space. (Dell, why do you need 70 MB on the EFI while also making it as small as 150 MB at the same time?) Well, resizing the partition is the obvious solution except it ended in a wonderful error message: .. code-block:: GNU parted cannot resize this partition to this size. We're working on it! (spoiler: `they're not `__) .. _bug: https://bugzilla.gnome.org/show_bug.cgi?id=649324#c7 In my case the GPT partition was resized, just the filesystem was not grown, I only needed to reformat it. .. TEASER_END .. warning:: Even if the final result in my case was a success, the operation is still dangerous. In case something happens in the middle of this, your PC may become unbootable and will require additional rescue steps. .. note:: Assuming you have Linux + GRUB (Fedora 38 in my case) and Windows 11 installed. More exotic EFI loaders may not survive the procedure. The checklist for this is relatively simple and obvious, it's just quite scary to forget something before rebooting: * Backup ``/boot/efi``: .. code-block:: bash sudo tar cvzf /boot/efi.tgz /boot/efi * Unmount and format ``/boot/efi`` using parted. (I use gparted) * Get the new filesystem UUID from the partition properties: .. image:: /images/misc/efi-fat32-parted/properties.avif :width: 559 * Update UUID record for ``/boot/efi`` in ``/etc/fstab`` and mount it: .. code-block:: bash sudo mount /boot/efi * Restore ``/boot/efi`` content: .. code-block:: bash sudo tar xvf /boot/efi.tgz -C /boot * (Only if you have dualboot with Windows. This step can be safely done later) Find and update UUID in the Windows section of ``/boot/grub2/grub.cfg`` .. note:: The location may vary depending on a distro, ``/boot/efi/EFI/$distroname/grub.cfg`` is another likely location * Reboot. Unless you forgot something, the system should boot successfully Moral of the story for me is: if you do a manual partitioning, make EFI partition at least 256 MB, 300+ MB to be safe, 512 MB is a good choice.