Hello,
I want to install TW from scratch (or if I need to reinstall grub). GPT partitions and UEFI
I need a little help with boot-efi, please.
I read openSUSE doc, ArchLinux and Gentoo.
openSUSE - grub2-install --target=x86_64-efi
Arch and Gentoo - grub-install --target=x86_64-efi --efi-directory=/boot/efi (arch prefer /boot instead of /boot/efi).
If I understand right, openSUSE grub2 = grub from Arch and Gentoo because oS keep both package “grub” and “grub2”.
Is it necessary to add efi-directory: grub2-install --target=x86_64-efi --efi-directory=/boot/efi, on oS install?
Another question: /boot and /boot/efi partitions
Is it necessary to make two different partitons: /boot - ext4 and /boot/efi - vfat or is enough a single partiton /boot/efi - vfat?
I ask this because today I read a discution on Mailing list about Leap 15.0 /boot/efi partition. The kernels are in /boot and /boot/efi is only for bootloader. So, is it better to keep kernels on an Linux system that Windows one (two partitons /boot and /boot/efi than only one /boot/efi)?
Kernels always go in boot, whether boot is on a separate filesystem or not. On my systems, separate boot is sometimes used, and when it is, I always make it EXT2. /boot does not get written to very often, mostly only when a new kernel is installed, so I don’t like to waste space for a journal.
The VFAT EFI partition is intended for use by UEFI system components, the UEFI BIOS, and the bootloader. Usually it has an overabundance of space, so other things could be put there, but remember that VFAT does not support native ownerships and permissions. Mine is 320MB and almost entirely freespace even though the disk has 4 installed operating systems. I haven’t yet needed to run grub2-install myself. I only have it on my UEFI system, always using Grub 0.97 on MBR disks.
Whether /boot is a separate filesystem from / or not, /boot/EFI is always intended to be a VFAT filesystem distinct from its native parent filesystem.
Thank you for the answer. I read your post on mailinglist.
I thought that, if I will not make a separate /boot partition, only a /boot/efi, the kernel will be on /boot and bootloader on /boot/efi, both with vfat.
Now I understand: if a make a separate /boot partition, kernels will be on that partition, if I not, kernels will be in directory boot on partition /. Never on /boot/efi (vfat).
Some linux distros use systemd-boot instead of grub. For those distros, the kernel is in the EFI partition. But most distros use grub (or grub2-efi), which uses partitions exactly as you describe.
erlangen:~ # gdisk -l /dev/sda
GPT fdisk (gdisk) version 1.0.1
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 976773168 sectors, 465.8 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): BEEDF98F-DA82-4488-A275-F581FA13B9F8
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 976773134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)
Number Start (sector) End (sector) Size Code Name
1 2048 206847 100.0 MiB EF00
2 206848 63121407 30.0 GiB 8300
3 63121408 976773134 435.7 GiB 8300
erlangen:~ #
Cloned the system partition from /dev/sdc1 to /dev/sda2 and installed grub2 efi on /dev/sda. The new system would readily boot, but only when booting into /dev/sda2 from disk /dev/sdc. Only after installing legacy grub2 and switching back to grub2 efi the system now boots from /dev/sda. Any idea?
In particular, I am not clear on whether you are now booting grub2 (legacy booting) or with grub2-efi (UEFI booting). And if it is the latter, then I don’t know what it is that you are asking.
I copied a working instance of Tumbleweed from /dev/sdc1 (MBR) to /dev/sda2 (GPR) and installed grub efi on /dev/sda Then I updated the boot loader of the old system (/dev/sdc1) and got a nice menu. Upon rebooting the machine from disk /dev/sdc (MBR) I selected the entry /dev/sda2 and got a working system (as expected). The I tried to boot from disk /dev/sda. But I only got an error message from efi: no bootable disk (puzzling).
After some trial and error I booted from disk /dev/sdc into /dev/sda2 and switched that partition from grub efi to grub and back again to grub efi. Now I was able to boot from disk /dev/sda.
The system now does exactly what I want. However I am wondering for what reason the first attempt failed. And I am pretty clueless why switching the bootloader back and forth fixed the problem.
It’s hard to know. In spite of the detail you have given, I’m still not sure on exactly what you did.
You have to keep in mind that the UEFI firmware (BIOS) mostly only runs during boot. So you could make a lot of changes, and the BIOS would not be aware of them until it next scanned the system and update whatever records it keeps in NVRAM. So possibly you had a system with everything in place, but the BIOS did not yet know about it.
I had used YAST > Boot Loader for performing the switch to efi. However when removing the old disk I got error messages. I had a closer look and found that Boot Manager claimed to create a new initrd. But actually it didn’t. The following fixed the problem:
On the smaller of the machines adding, removing and moving disks together with switching from grub mbr to efi created a mess. On the larger machine I first moved disks and made sure the system would properly update the kernel while still using grub mbr.