-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathefi
37 lines (25 loc) · 1.32 KB
/
efi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
UEFI/GPT
https://unix.stackexchange.com/questions/83669/how-to-recreate-efi-boot-partition
https://docs.fedoraproject.org/en-US/Fedora/22/html/Multiboot_Guide/common_operations_appendix.html#common-chroot_from_live
https://docs.fedoraproject.org/en-US/Fedora/22/html/Multiboot_Guide/GRUB-reinstalling.html
https://forums.gentoo.org/viewtopic-t-1002254-start-0.html
#####################################################################
init 3
su - root
modprobe efivarfs
mkdosfs -F 32 -n EFI /dev/sdEFIx # !!!!!!!!!!!!!! CAREFUL WITH NUMBER if needed to create EFI partition from scratch
mkdir /mounted
mount /dev/sdOSx /mounted
mount /dev/sdEFIx /mounted/boot/efi
for i in /dev /dev/pts /proc /sys /sys/firmware/efi/efivars /run; do sudo mount -B $i /mounted$i; done
mkdir -p /mounted/boot/efi/EFI/fedora/
cp -R /boot/efi/EFI/fedora/* /mounted/boot/efi/EFI/fedora/
cp /etc/resolv.conf /mounted/resolv.conf
sudo chroot /mounted
yum install grub2-efi-x64 shim-x64 && yum reinstall grub2-efi-x64 shim-x64
efibootmgr -D
efibootmgr -B -b 000X ## clear old entries
blkid -s UUID -o value /dev/sdX # disk_uuid
echo 'LABEL=EFI /boot/efi vfat defaults 0 2' >> /etc/fstab ## check for existing efi entry; replace UUID or remove
efibootmgr -c -w -L Fedora -d /dev/sdz -p 1 -l \EFI\fedora\shimx64.efi
grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg