Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mariotpc/6a8e8d25d1410958c779da3892b87c11 to your computer and use it in GitHub Desktop.
Save mariotpc/6a8e8d25d1410958c779da3892b87c11 to your computer and use it in GitHub Desktop.
Can't resize boot-EFI partition with GParted
Creating an EFI System Partition
If you are manually partitioning your disk in the Ubuntu installer, you need to make sure you have an EFI System Partition (ESP) set up. This partition holds EFI-mode boot loaders and related files.
If your disk already contains an ESP (eg if your computer had Windows 8 preinstalled), it can be used for Ubuntu too. Do not format it. It is strongly recommended to have only 1 ESP per disk.
An ESP can be created via a recent version of GParted (the Gparted version included in the 12.04 disk is OK), and must have the following attributes:
Mount point: /boot/efi (remark: no need to set this mount point when using the manual partitioning, the Ubuntu installer will detect it automatically)
Size: minimum 100Mib. 200MiB recommended.
Type: FAT32
Other: needs a "boot" flag.
Comes from: https://help.ubuntu.com/community/UEFI#Creating_an_EFI_System_Partition
[SOLVED] Can't resize boot/EFI partition with GParted
I had the same problem, sought for a loyal solution and found only this one (manual, but very simple).
Just save manually the EFI folder from your efi partition (your sda1), or better make an image of this partition via Disks Utility,
then delete the EFI partition,
create the new bigger one (in fat32),
flag it as boot/esp in Gparted,
and COPY MANUALLY there your EFI folder.
That's all! It works OK with Ubuntu_20 and Windows_8.
My Gparted (v.1.0 on Live USB Ubuntu20) can neither shrink directly a small EFI partition nor shrink it via repair command (after deleting the partition, creating the new bigger one and restoring of original EFI partition with Disks).
So I tried the Russian way (the most simple and direct decision) -- and it has worked momently like the simple pencil in Space.
Source: http://gparted-forum.surf4.info/viewtopic.php?id=17904
Finding UUID with blkid:
You can find the UUID of all the disk partitions on your Linux system with the blkid command. The blkid command is available by default on most modern Linux distributions.
To find the UUIDs of your disk partitions, run the following command:
$ sudo blkid
[root@fedora mlopez]# blkid
/dev/mapper/fedora-var: UUID="f39e6bdd-1030-4c46-80ab-e91046cce18d" BLOCK_SIZE="4096" TYPE="ext4"
/dev/nvme0n1p7: UUID="iu2Nvg-NIcs-4tbo-pyIX-8Fzn-YSMJ-rHGBIC" TYPE="LVM2_member" PARTUUID="cab931a3-47f1-4a3f-a3bc-990a63543e4b"
/dev/nvme0n1p5: BLOCK_SIZE="512" UUID="76EEEC80EEEC39CF" TYPE="ntfs" PARTUUID="40bc7de8-21ff-46bd-a324-81985de92ff0"
/dev/nvme0n1p3: LABEL="MAIN" BLOCK_SIZE="512" UUID="64B63FB9B63F8B16" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="92990e4f-ed94-466f-8d98-d6fce5b6d80a"
/dev/nvme0n1p1: UUID="7D99-17FC" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="13e30504-8bab-4ccc-b845-4e20a9fd4e35"
/dev/nvme0n1p6: UUID="2399e5ae-7999-4cc6-9b2c-0b8b50104d3d" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="a6e09268-351c-4f57-88d3-41c66de738d5"
/dev/nvme0n1p4: LABEL="DATOS" BLOCK_SIZE="512" UUID="D84CA5204CA4FA80" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="b2b3e6b1-5585-4dc4-a3af-bb61c2f3ebf7"
/dev/nvme0n1p2: PARTLABEL="Microsoft reserved partition" PARTUUID="9aab5e25-cfe7-4199-bc00-39791391d7a8"
/dev/mapper/fedora-home: UUID="e1ad6eca-2b0f-4719-9f87-0a6cec1c18dd" BLOCK_SIZE="4096" TYPE="ext4"
/dev/mapper/fedora-root: UUID="abd9782b-b0a8-427f-8fa1-cf6c87f7fd27" BLOCK_SIZE="4096" TYPE="ext4"
/dev/zram0: LABEL="zram0" UUID="1ca504a6-c3f5-4eac-b3d2-cb996665e9e9" TYPE="swap"
Add the new /boot/efi partition to fstab
[root@fedora mlopez]# cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Fri Mar 17 19:56:49 2023
#
# Accessible filesystems, by reference, are maintained under '/dev/disk/'.
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info.
#
# After editing this file, run 'systemctl daemon-reload' to update systemd
# units generated from this file.
#
/dev/mapper/fedora-root / ext4 defaults 1 1
UUID=2399e5ae-7999-4cc6-9b2c-0b8b50104d3d /boot ext4 defaults 1 2
UUID=7D99-17FC /boot/efi vfat umask=0077,shortname=winnt 0 2
/dev/mapper/fedora-home /home ext4 defaults 1 2
/dev/mapper/fedora-var /var ext4 defaults 1 2
#/dev/nvme0n1p8 /mail ntfs-3g defaults 1 2
#/dev/nvme0n1p4 /run/media/mlopez/DATOS ntfs-3g defaults 1 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment