Let's see. I have done it two ways, depending on the machine. /boot is a
separate partition, and /boot is part of / while /boot/EFI is a
separate. I'll post both.
/boot is EFI partition:
/dev/cdrom /mnt/cdrom auto noauto,ro 0 0
/dev/sda1 /boot vfat defaults 1 2
/dev/sda2 / xfs defaults,noatime 1 1
/boot is part of /:
/dev/sda1 /boot/EFI vfat
defaults,noatime 1 2
/dev/sda3 / xfs defaults,noatime 1 1
/dev/sda2 none swap defaults
0 0
As for parted, I still use fdisk myself. I know the way I created each
was simple enough.
fdisk> g
fdisk> n
1
<just hit enter>
+128M
t
<ENTER>
1
<create other partitions>
The way this works is the g command creates a new gpt table, destroying
any other partition table, then your usual N for new, 1 for partition 1,
enter to start at the first available point, and +128M to select a 128
MB partition. If you're looking for the prompt for primary vs extended
vs logical, those don't exist in gpt tables. EVERYTHING is primary. The
t 1 changes the partition type to EFI System Partition. It's technically
not needed as I neglected to do it to one of my virtual machines. But
it's not a bad idea.
Now format as fat32: mkfs.vfat -F32 /dev/sda1
Still, here's parted output for the /boot is ESP (EFI System Partition):
(parted) print
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sda: 68.7GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 135MB 134MB fat32 boot, esp
2 135MB 68.7GB 68.6GB xfs
and here's the output for the one where /boot is one partition and
/boot/EFI is a different one (and I didn't change the partition type):
(parted) print
Model: ATA VBOX HARDDISK (scsi)
Disk /dev/sda: 34.4GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 68.2MB 67.1MB fat32
2 68.2MB 8658MB 8590MB linux-swap(v1) swap
3 8658MB 34.4GB 25.7GB xfs
EFI really isn't THAT complicated once you remember the restrictions.
For example, on the first instance, using fdisk, the following is
exactly what I did:
Command (m for help): g
Created a new GPT disklabel (GUID: 448CFABB-EBB6-AF44-8A36-A5679DB2EF76).
Command (m for help): n
Partition number (1-128, default 1):
First sector (2048-134217694, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-134217694, default
134217694): +128M
Created a new partition 1 of type 'Linux filesystem' and of size 128 MiB.
Command (m for help): n
Partition number (2-128, default 2):
First sector (264192-134217694, default 264192):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (264192-134217694, default
134217694):
Created a new partition 2 of type 'Linux filesystem' and of size 63.9 GiB.
Command (m for help): t
Partition number (1,2, default 2): 1
Partition type (type L to list all types): 1
Changed type of partition 'Linux filesystem' to 'EFI System'.
Command (m for help): w
# mkfs.vfat /dev/sda1 -F32
#mkfs.xfs /dev/sda2
mount /dev/sda2 /mnt/gentoo
mkdir /mnt/gentoo/boot
mount /dev/sda1 /mnt/gentoo/boot
Then once grub is emerged and the kernel compiled:
# grub-install --target=x86_64-efi --efi-directory=/boot
# grub-mkconfig -o /boot/grub/grub.cfg
That's it, I swear. If you still have questions, you can keep asking the
list, or write to me off the list and I'd be happy to help. Your choice.
--
Dan Egli
From my Test Server