You are not logged in.

#1 2018-01-30 17:39:21

Annoyingduck
Member
Registered: 2016-08-02
Posts: 179

How To Realign FAT32 EFI Partition To Use All Space

I'm looking to realign my FAT32 EFI partition to use all the available space after an error re-sizing with Gparted.

My current setup is Arch & Windows10.  Win10 was installed first and I added Arch to the Windows created 100mb EFI partition. I'm currently booting and working fine, but I cannot install any more kernels because I'm out of room on the EFI partition.  So I booted Gparted live, and deleted the Windows 450mb recovery partition and increased the size of the EFI partition to use that space, but Gparted gave an error due to a bug that doesn't allow resizing of FAT32 partitions under 256mb (https://bugzilla.gnome.org/show_bug.cgi?id=649324). So the partition is now 550mb, but still "locked" in at 100mb with Gparted showing 550mb, 80mb used, 20mb available...the remaining 450mb cannot be used even though it's there.  I'm still able to boot Arch grub, and everything works, but I cannot install any more kernels due to the size issue.

How can I realign the FAT32 EFI partition to register the full space in the partition and still have it boot and work properly?

Offline

#2 2018-01-30 17:46:21

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,560

Re: How To Realign FAT32 EFI Partition To Use All Space

Back everything up, reformat the partition, put everything back.

You resized the partition but not the filesystem on the partition.

Offline

#3 2018-01-30 17:53:06

Annoyingduck
Member
Registered: 2016-08-02
Posts: 179

Re: How To Realign FAT32 EFI Partition To Use All Space

Scimmia wrote:

Back everything up, reformat the partition, put everything back.

You resized the partition but not the filesystem on the partition.

I'm a bit unclear on how to backup the contents on that partition.  When I tried to do it in Gparted, I kept getting errors when copying. Thunar doesn't show the efi partition.  What's the best way to back up the contents and move them back?  And after that's done, I assume I have to either change the UUID of that partition back to what it was or update my fstab & grub, correct?

Offline

#4 2018-01-31 14:14:26

Annoyingduck
Member
Registered: 2016-08-02
Posts: 179

Re: How To Realign FAT32 EFI Partition To Use All Space

I copied the EFI partiton contents & formatted the EFI partition, but I could not figure out how to copy the items back to the EFI.  Tried everything I could think of (cp, clone, partition move) and all ended with some error or failure to boot.  I ended up just reformatting the EFI partition, reinstalling the Windows bootloader, chrooting into Arch and reinstalling the kernel and grub and changing the UUID in fstab of the EFI partition. I'm fully up and running. 

I still want to know the exact easier process of doing this.  Just backing up and copying back did not work for me.

Offline

#5 2018-01-31 14:53:37

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,740

Re: How To Realign FAT32 EFI Partition To Use All Space

Backing up and copying should just work, you might want to elaborate on the errors you got.

Offline

#6 2018-01-31 18:26:21

Annoyingduck
Member
Registered: 2016-08-02
Posts: 179

Re: How To Realign FAT32 EFI Partition To Use All Space

V1del wrote:

Backing up and copying should just work, you might want to elaborate on the errors you got.

What method of backing up and copying would you use?  I did:

cp -R /boot/EFI /home/cn/Documents

Which backed it up fine.  Then to copy back I did:

mkdir /boot
cp -R /home/cn/Documents/boot/EFI /boot/EFI

Which failed to copy correctly (don't recall the error).  Then I tried a few variations of those commands, all failing to copy.  I eventually tried just using Thunar by booting a live Manjaro usb (for full GUI) and copied to entire backed up folder of boot/EFI to /boot, but the regeneration of grub failed.  I also used the copy/pasted option in Gparted, but because the backup was still linked to the original 100mb size, it had the same failure it originally had.

What would be your recommended way?  The Gparted >256mb bug stinks because that would have been simple without having to modify UUID's or reinstall the Win10 bootloader.  Fortunately repairing Arch's boot is very easy either way.

Offline

#7 2018-01-31 18:35:42

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,560

Re: How To Realign FAT32 EFI Partition To Use All Space

Wow.

You mount the partition, copy the files, unmount, format, mount, copy the files back. You seem to be copying to things to random locations.

Offline

#8 2018-01-31 19:58:02

Annoyingduck
Member
Registered: 2016-08-02
Posts: 179

Re: How To Realign FAT32 EFI Partition To Use All Space

Scimmia wrote:

Wow.

You mount the partition, copy the files, unmount, format, mount, copy the files back. You seem to be copying to things to random locations.

I know...seriously this should be simple, but for some reason I get confused when dealing with the EFI partition.  It is it's own partition, but it's read in the root of your Linux directory.  After formatting it, my understanding was that just copying items into /boot on your primary root does not register them within the EFI partition. What command would you use to copy and to paste back the contents of the EFI partition?  Would you do it from the command line using an Arch ISO or boot into a full GUI ISO and use a file manager?  I know how stupid this sounds, but there is something I'm not grasping with this, especially because I couldn't get it to work.

Last edited by Annoyingduck (2018-01-31 19:58:40)

Offline

#9 2022-07-11 13:42:59

eclairevoyant
Member
Registered: 2022-07-11
Posts: 2

Re: How To Realign FAT32 EFI Partition To Use All Space

Let's say you have a drive /dev/sdx with ESP on /dev/sdx1 and root on /dev/sdx3.
Now let's also assume you're booting into a live disk environment to try to fix this setup.

What you'll want to do is mount /dev/sdx1 into, say, /mnt/boot (technically you can mount it to any empty folder, but I'm suggesting this folder name to avoid confusion):

mount /dev/sdx1 /mnt/boot

Now you can back up its contents

cp -R /mnt/boot {backup location}

Then you'll want to unmount the ESP:

umount /mnt/boot

After this, once you delete and recreate your ESP, you'll also want to mark it as an ESP using some utility like fdisk.
Then you can run the following to restore its contents:

mount /dev/sdx1 /mnt/boot
cp -R {backup location} /mnt/boot

My guess is your confusion arised from the name of the folder /boot/EFI.
However I want to note that this is NOT the EFI system partition (ESP). The ESP that's mounted to /boot just happens to have a folder in it called "EFI".
The ESP is not "read in the root of your Linux directory" - it's a separate partition that's mounted to /boot, as you can confirm by looking at your /etc/fstab.
So using the device identifiers I mentioned above, if you're booted into an Arch install that's located on /dev/sdx3, then /dev/sdx3 corresponds to the root (/) and /dev/sdx1 (the ESP) is mounted to /boot automatically based on the fstab.

Offline

#10 2022-07-11 13:52:34

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: How To Realign FAT32 EFI Partition To Use All Space

Thanks for the contribution.

Closing this old thread.

Offline

Board footer

Powered by FluxBB