Gentoo Archives: gentoo-user

From: Dan Egli <dan@×××××××××××.site>
To: gentoo-user@l.g.o, Walter Dnes <waltdnes@××××××××.org>
Subject: Re: [gentoo-user] UEFI install noob questions
Date: Sat, 26 Dec 2020 21:22:04
Message-Id: 92b8f204-d9eb-875f-444b-cb59880e8317@newideatest.site
In Reply to: Re: [gentoo-user] UEFI install noob questions by Walter Dnes
1 Let's see. I have done it two ways, depending on the machine. /boot is a
2 separate partition, and /boot is part of / while /boot/EFI is a
3 separate. I'll post both.
4
5 /boot is EFI partition:
6 /dev/cdrom              /mnt/cdrom      auto noauto,ro               0 0
7 /dev/sda1               /boot           vfat defaults                1 2
8 /dev/sda2               /               xfs defaults,noatime        1 1
9
10 /boot is part of /:
11 /dev/sda1       /boot/EFI       vfat
12 defaults,noatime                                                1 2
13 /dev/sda3       /               xfs defaults,noatime         1 1
14 /dev/sda2       none            swap            defaults                
15                                      0 0
16
17
18 As for parted, I still use fdisk myself. I know the way I created each
19 was simple enough.
20
21 fdisk> g
22 fdisk> n
23            1
24            <just hit enter>
25         +128M
26     t
27     <ENTER>
28    1
29 <create other partitions>
30
31 The way this works is the g command creates a new gpt table, destroying
32 any other partition table, then your usual N for new, 1 for partition 1,
33 enter to start at the first available point, and +128M to select a 128
34 MB partition. If you're looking for the prompt for primary vs extended
35 vs logical, those don't exist in gpt tables. EVERYTHING is primary. The
36 t 1 changes the partition type to EFI System Partition. It's technically
37 not needed as I neglected to do it to one of my virtual machines. But
38 it's not a bad idea.
39
40 Now format as fat32: mkfs.vfat -F32 /dev/sda1
41
42 Still, here's parted output for the /boot is ESP (EFI System Partition):
43 (parted) print
44 Model: ATA VBOX HARDDISK (scsi)
45 Disk /dev/sda: 68.7GB
46 Sector size (logical/physical): 512B/512B
47 Partition Table: gpt
48 Disk Flags:
49
50 Number  Start   End     Size    File system  Name  Flags
51  1      1049kB  135MB   134MB   fat32              boot, esp
52  2      135MB   68.7GB  68.6GB  xfs
53
54 and here's the output for the one where /boot is one partition and
55 /boot/EFI is a different one (and I didn't change the partition type):
56 (parted) print
57 Model: ATA VBOX HARDDISK (scsi)
58 Disk /dev/sda: 34.4GB
59 Sector size (logical/physical): 512B/512B
60 Partition Table: gpt
61 Disk Flags:
62
63 Number  Start   End     Size    File system     Name  Flags
64  1      1049kB  68.2MB  67.1MB  fat32
65  2      68.2MB  8658MB  8590MB  linux-swap(v1)        swap
66  3      8658MB  34.4GB  25.7GB  xfs
67
68
69 EFI really isn't THAT complicated once you remember the restrictions.
70 For example, on the first instance, using fdisk, the following is
71 exactly what I did:
72
73 Command (m for help): g
74 Created a new GPT disklabel (GUID: 448CFABB-EBB6-AF44-8A36-A5679DB2EF76).
75
76 Command (m for help): n
77 Partition number (1-128, default 1):
78 First sector (2048-134217694, default 2048):
79 Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-134217694, default
80 134217694): +128M
81
82 Created a new partition 1 of type 'Linux filesystem' and of size 128 MiB.
83
84 Command (m for help): n
85 Partition number (2-128, default 2):
86 First sector (264192-134217694, default 264192):
87 Last sector, +/-sectors or +/-size{K,M,G,T,P} (264192-134217694, default
88 134217694):
89
90 Created a new partition 2 of type 'Linux filesystem' and of size 63.9 GiB.
91
92 Command (m for help): t
93 Partition number (1,2, default 2): 1
94 Partition type (type L to list all types): 1
95
96 Changed type of partition 'Linux filesystem' to 'EFI System'.
97
98 Command (m for help): w
99
100 # mkfs.vfat /dev/sda1 -F32
101
102 #mkfs.xfs /dev/sda2
103 mount /dev/sda2 /mnt/gentoo
104 mkdir /mnt/gentoo/boot
105 mount /dev/sda1 /mnt/gentoo/boot
106
107
108 Then once grub is emerged and the kernel compiled:
109 # grub-install --target=x86_64-efi --efi-directory=/boot
110 # grub-mkconfig -o /boot/grub/grub.cfg
111
112
113 That's it, I swear. If you still have questions, you can keep asking the
114 list, or write to me off the list and I'd be happy to help. Your choice.
115
116 --
117
118 Dan Egli
119 From my Test Server

Replies

Subject Author
Re: [gentoo-user] UEFI install noob questions Walter Dnes <waltdnes@××××××××.org>
Re: [gentoo-user] UEFI install noob questions Walter Dnes <waltdnes@××××××××.org>