Linux – How to resize the EFI System Partition

arch linuxlinuxpartitioninguefiwindows 10

I want to increase the size of the EFI System Partition to 750MiB so.i can install Arch Linux alongside Windows 10 because EFI System Partition Windows gave me which is only 100MiB is too small. Arch Linux recommends you mount the ESP at /boot instead of /boot/efi and 100MiB is too small for /boot. I don't want to touch the Recovery Partition.

Best Answer

This question is among the top results on Google for "How to resize the EFI System Partition" (unsurprising, given that's the question title), however the current answers here, though containing good advice for the OP's situation and generally useful information, do not actually attempt to answer that question as stated. My previous rather terse (now deleted) attempt to answer that question was downvoted, so here's a more thorough one.

There's a good chance that you're reading this because you've tried the obvious thing (use gparted) and got the error "GNU Parted cannot resize this partition to this size. We're working on it!". You may have also tried doing it from within Windows (using Disk Management), only to discover that Windows refuses to perform any operations with the ESP at all.

Well, the next best thing to actually resizing the partition is to recreate it. Here are the detailed steps for doing this:

  1. If you are resizing the ESP of the disk you're booting on, ensure you have some bootable rescue media on hand that you can use to repair your system in case things go wrong. Having a backup of your data before doing any disk partitioning operations is a good idea in general.

  2. If you are enlarging the ESP, make room by moving or resizing any partitions directly following it, using your favorite partitioning tool (e.g. gparted).

  3. Mount the ESP, if it's not mounted already:

     # mount /dev/sdx1 /mnt # replace sdx1 with ESP
    
  4. Make a backup of its contents:

     # mkdir ~/esp
     # rsync -av /mnt/ ~/esp/
    
  5. Unmount the ESP:

     # umount /mnt
    
  6. Delete and recreate the ESP:

     # gdisk /dev/sdx # replace sdx with disk containing ESP
     p (list partitions)
     (ensure the ESP is the first partition)
     d (delete partition)
     1 (select first partition)
     n (create partition)
     Enter (use default partition number, should be 1)
     Enter (use default first sector, should be 2048)
     Enter (use default last sector, should be all available space)
     EF00 (hex code for EFI system partition)
     w (write changes to disk and exit)
    
  7. Format the ESP:

     # partprobe /dev/sdx
     # mkfs.fat -F32 /dev/sdx1
    
  8. Restore the ESP's contents:

     # mount /dev/sdx1 /mnt
     # rsync -av ~/esp/ /mnt
    
  9. Update EFI entry in /etc/fstab

     # blkid | grep EFI
     # nano /etc/fstab
     UUID=XXXX-XXXX /boot vfat umask=0077 0 2 # Replace with UUID from blkid
    

That should be everything. I've successfully used the above procedure to resize the ESP for a Windows installation whose ESP was too small (50 MB) to allow Windows to upgrade to Fall Creators' Update (before resizing the ESP, Windows Update failed with error 0x8E5E03FB, and the Update Assistant with error 0xc1900200).

Related Question