You are not logged in.

#1 2020-11-01 23:21:37

860lacov
Member
Registered: 2020-05-02
Posts: 497

EFI partition size and proper setup

I'm going to do fresh Arch install.

Usually I use mbr but this time it's going to be UEFI with GPT way.
Installation manual says that this partition should be at least 260MiB (polish version suggest 260-512)
I could go with 512 without asking this question but I would like to understand this choice.

When should it be bigger?

Maybe this is important:
my mount point is going to be /mnt/efi
For the near future I'll install only linux and linux-lts kernels

Last edited by 860lacov (2020-11-02 11:02:40)

Offline

#2 2020-11-01 23:41:33

kermit63
Member
Registered: 2018-07-04
Posts: 372

Re: EFI partition size and proper setup

I have 2 arch installs on the same computer, plus 2 other efi entries. All of these occupy only a total of 1.7 MB out of the 36 Mb allotted.

For reference, a typical arch EFI entry consist of only a single file (grubx64.efi). This file is only 152 kb on my system.

It's a totally different matter if you intend to store your /boot files into the efi partition. That's where the recommended 260-512 mb kicks in. In my case, I have separate boot partitions for each install, so kernel/boot files don't figure into the size of the efi partition.

Last edited by kermit63 (2020-11-01 23:44:27)


Never argue with an idiot, they will drag you down to their level and then beat you with experience.
It is better to light a candle than curse the darkness.
A journey of a thousand miles begins with a single step.

Offline

#3 2020-11-02 00:00:35

860lacov
Member
Registered: 2020-05-02
Posts: 497

Re: EFI partition size and proper setup

So if I understand correctly.
With standard install procedure /boot files are located on system partition. Is that correct?

p.s.
Maybe I'll not need new topic for this 'extra' question.
I've been thinking about grub installation with --removable option
This installation is on home PC. I've no idea if I'll put hard disk into another computer.
Are there any drawbacks of this option in home pc?

Offline

#4 2020-11-02 00:18:51

kermit63
Member
Registered: 2018-07-04
Posts: 372

Re: EFI partition size and proper setup

no such thing as a standard arch install, it's how you configure your system during install that matters.

Yes, you can choose to include the boot files within the root partition, but that depends on other factors. For example, if you intend to use luks2 encryption on your root partition, then the install won't boot because grub can't handle luks2 encryption.

The choice of boot system is also a factor. I am only conversant about GRUB, but my understanding is other boot systems may require you to place boot files into the efi partition.

The use of the --removable option is sometimes useful for nvme drives and definitely needed for removable drives like usb drives. You can try including it, but if it somehow interferes with the boot process, you can always insert the arch install medium and remove it afterwards.


Never argue with an idiot, they will drag you down to their level and then beat you with experience.
It is better to light a candle than curse the darkness.
A journey of a thousand miles begins with a single step.

Offline

#5 2020-11-02 00:46:24

860lacov
Member
Registered: 2020-05-02
Posts: 497

Re: EFI partition size and proper setup

kermit63 wrote:

no such thing as a standard arch install, it's how you configure your system during install that matters.

Yes, you can choose to include the boot files within the root partition, but that depends on other factors. For example, if you intend to use luks2 encryption on your root partition, then the install won't boot because grub can't handle luks2 encryption.

The choice of boot system is also a factor. I am only conversant about GRUB, but my understanding is other boot systems may require you to place boot files into the efi partition.

The use of the --removable option is sometimes useful for nvme drives and definitely needed for removable drives like usb drives. You can try including it, but if it somehow interferes with the boot process, you can always insert the arch install medium and remove it afterwards.

As standard Arch install I mean install with installation guide step-by-step

And about:

kermit63 wrote:

It's a totally different matter if you intend to store your /boot files into the efi partition.

If I'll go with installation procedure described in guide:
create EFI partiton Fat32 at least 260MiB
mountpoint /mnt/efi

Install grub with:

grub-install --target=x86_64-efi --efi-directory=/mnt/efi --bootloader-id=GRUB

Then where are my /boot files go?

And if I decide that I would like to go with:

grub-install --target=x86_64-efi --efi-directory=esp --boot-directory=esp --removable --recheck

Then is there a difference for /boot files?

On wiki there is information that with installation without --removable GRUB is installed in:

esp/EFI/GRUB/

and with --removable in:

esp/EFI/BOOT/BOOTX64.EFI

But to be honest I couldn'f find information what is the practical difference other than directory change

Last edited by 860lacov (2020-11-02 00:48:43)

Offline

#6 2020-11-02 01:27:07

kermit63
Member
Registered: 2018-07-04
Posts: 372

Re: EFI partition size and proper setup

Then where are my /boot files go?

grub-install doesn't direct where to put the boot files. The initial steps, partitioning and mounting of partitions are what specifies which files go where. The grub-install directive merely points grub to where it can locate those files. By the time you install and configure grub, the files are already in place, depending on how you installed the system.

If you did not create and mount a separate /boot partition at the start, or did not use the efi partition to store the /boot files, then there is no need to specify a "--boot-directory" option during grub-install. GRUB will assume that it is part of the root {/) partition.

That is precisely what I mean by "no such thing as a standard install".

Also, you may be reading the arch wiki in a narrow way. The wiki provides options and examples on how to configure your system. It doesn't tell you exactly which way to go, i.e. no standard arch install. No such thing as a step-by-step arch install because every step of the way, you are presented with choices. Each choice will determine what you need to do on the succeeding steps.

------

If I were you I'd install without the --removable option first. You can always add it later on if necessary and in most cases it's not.


Never argue with an idiot, they will drag you down to their level and then beat you with experience.
It is better to light a candle than curse the darkness.
A journey of a thousand miles begins with a single step.

Offline

#7 2020-11-02 11:19:32

860lacov
Member
Registered: 2020-05-02
Posts: 497

Re: EFI partition size and proper setup

Ok
For now, I decided to go without --removable

To be sure that I did everything by the book
I did:

grub-install --target=x86_64-efi --efi-directory=esp --bootloader-id=GRUB

Should It look like this?

/efi
└── EFI
    └── GRUB
        └── grubx64.efi

And a little doubt with

--bootloader-id=GRUB

Could I use anything else then GRUB? Is it as easy as

--bootloader-id=ARCH

Delete everything from /efi and do new grub-install?

p.s.
On this PC I had different disk with Manjaro.
Now, during boot process when I press ESC (shortcut to list of bootable devices) I have a list with grub AND manjaro.
And I don't have Manjaro any more. In UEFI/Bios there is manjaro but I cant delete it. I can only disable it is still shown on the list

Last edited by 860lacov (2020-11-02 11:31:39)

Offline

#8 2020-11-02 11:46:14

kermit63
Member
Registered: 2018-07-04
Posts: 372

Re: EFI partition size and proper setup

Could I use anything else then GRUB?

Yes. The folder containing the file grubx64.efi will then be named to whatever name you supplied, as long as there is no existing efi boot entry with the same name. You can verify which existing entries are present by:

efibootmgr

while booted into the arch installation iso.

Should It look like this?

I need some context on how you mounted the partitions in the first place. If you mounted the efi partition as /mnt/esp during installation (before arch-chroot), then your grub-install command is correct. Unfortunately you mentioned earlier your intention is to mount the efi partition as /mnt/efi, so the command should be:

grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=<whatever> --recheck

Your grub-install command must be consistent with how you created and mounted the partitions. One thing I always do before writing out the grub-install command is to issue this command:

lsblk

This is so you can double-check if you are really using the correct mounts.

----

Removing obsolete efi entries is easy enough with the efibootmgr command. I suggest you create a new thread for this topic after installing arch, otherwise this thread will be meandering from one topic to another. It has already wandered from efi partition size to actual grub installation.

Last edited by kermit63 (2020-11-02 11:56:51)


Never argue with an idiot, they will drag you down to their level and then beat you with experience.
It is better to light a candle than curse the darkness.
A journey of a thousand miles begins with a single step.

Offline

#9 2020-11-02 12:04:36

860lacov
Member
Registered: 2020-05-02
Posts: 497

Re: EFI partition size and proper setup

kermit63 wrote:

I need some context on how you mounted the partitions in the first place. If you mounted the efi partition as /mnt/esp during installation (before arch-chroot), then your grub-install command is correct. Unfortunately you mentioned earlier your intention is to mount the efi partition as /mnt/efi, so the command should be:

grub-install target=x86_64-efi --efi-directory=/efi --bootloader-id=<whatever>" --recheck

On disk
I created sda1 and sda2 partitions
sda1 - 260MiB formatted as FAT32
sda2 - btrfs with subvolumes @, @home, @cache

Next I did:
I mounted sda2 subvol=@ in /mnt
Created dirs efi, home, /var/cache
mounted sda1 with: mount /dev/sda1 /mnt/efi
mounted rest of my btrfs subvolumes

I've been wondering if I could mount sda1 with
mount /dev/sda1 /mnt
so the tree would lokk like this:

/EFI
   └── GRUB
        └── grubx64.efi

instead of

/efi
└── EFI
    └── GRUB
        └── grubx64.efi

Offline

#10 2020-11-02 12:09:03

kermit63
Member
Registered: 2018-07-04
Posts: 372

Re: EFI partition size and proper setup

I've been wondering if I could mount sda1 with
mount /dev/sda1 /mnt

Definitely NOT. Your root partition is and should be mounted as /mnt. Anything else should be a child directory of /mnt.

I'm not an expert on btrfs, but you should check if you need to tell GRUB that your boot partition is inside a btrfs volume. For context, I use lvm on a luks-encrypted partition. I had to manually specify some parameters in /etc/default/grub to reflect that. You may have to do some manual intervention too. I'm not sure if grub can handle btrfs by default.

Last edited by kermit63 (2020-11-02 12:18:19)


Never argue with an idiot, they will drag you down to their level and then beat you with experience.
It is better to light a candle than curse the darkness.
A journey of a thousand miles begins with a single step.

Offline

#11 2020-11-02 12:27:51

860lacov
Member
Registered: 2020-05-02
Posts: 497

Re: EFI partition size and proper setup

Thank you very much for all your time.

I would like to summarize something

I would like to change my bootloader name from GRUB to something else after installation. Do I have to reinstall grub? Before reinstall should I remove everything from /efi directory?

Just to be sure
Arch Installation Guide says:
UEFI with GPT mount point:

/mnt/boot or /mnt/efi

Partition

/dev/efi_system_partition

So I did everything correctly with
sda1 mounted into /mnt/efi

And that's why I have directories:

/efi/EFI/GRUB/grubx64.efi

What I want to know is if the double efi

/efi/EFI/ 

is correct

Offline

#12 2020-11-02 12:32:38

kermit63
Member
Registered: 2018-07-04
Posts: 372

Re: EFI partition size and proper setup

yes. the double efi is correct.

Right now I'm more concerned about your using btrfs. Did you include all the necessary packages you need to support btrfs with your pacstrap command? Also take note my earlier comment about editing /etc/default/grub and possibly /etc/mkinitcpio.conf.

Unfortunately I can't give you specifics when it comes to btrfs. I dabbled with it years ago. All I know is I had to manually edit a bunch of config files to make it work. If you haven't done anything to tell the installer that you're using btrfs, you are bound to end up with a non-booting install.

Last edited by kermit63 (2020-11-02 12:40:45)


Never argue with an idiot, they will drag you down to their level and then beat you with experience.
It is better to light a candle than curse the darkness.
A journey of a thousand miles begins with a single step.

Offline

#13 2020-11-02 12:51:46

860lacov
Member
Registered: 2020-05-02
Posts: 497

Re: EFI partition size and proper setup

kermit63 wrote:

yes. the double efi is correct.

Right now I'm more concerned about your using btrfs. Did you include all the necessary packages you need to support btrfs with your pacstrap command? Also take note my earlier comment about editing /etc/default/grub and possibly /etc/mkinitcpio.conf.

I don't know if I have all the necessary packages.

I know that I could install grub-btrfs to have posibility to choose btrfs snapshot during boot. I don't need it right now.
I have btrfs-progs

On my laptop with MBR disk I use btrfs. No special settings.

And about mkinitcpio.conf
I read:

You must include either the udev hook or the btrfs hook in /etc/mkinitcpio.conf in order to use multiple Btrfs devices in a pool. See the Mkinitcpio#Common hooks article for more information

udev was there by default. I also deleted fsck hook

I've found also:

To overwrite the existing partition table with Btrfs, run the following command:

# mkfs.btrfs /dev/sdX

For example, use /dev/sda rather than /dev/sda1. The latter would format an existing partition instead of replacing the entire partitioning scheme. Because the root partition is Btrfs, make sure btrfs is compiled into the kernel, or put btrfs into mkinitcpio.conf#MODULES and regenerate the initramfs. 

But I use standard sdaX not sdX for my btrfs, so I think that I don't need btrfs module in mkinitcpio

I read btrfs documentation, many tutorials how to  install Arch on btrfs with subvolumes.
There is a lot of reading so it is possible that I missed something.
If you could give me advice about most important thing in btrfs I would be grateful

Offline

#14 2020-11-02 13:18:55

kermit63
Member
Registered: 2018-07-04
Posts: 372

Re: EFI partition size and proper setup

As far as this forum is concerned, the only authoritative resource you need is the arch wiki. In fact, it can be confusing to mix the instructions from 3rd party tutorials with instructions from the wiki.

You should post a separate thread if you need help with btrfs. Someone more authoritative on the subject can help you.


Never argue with an idiot, they will drag you down to their level and then beat you with experience.
It is better to light a candle than curse the darkness.
A journey of a thousand miles begins with a single step.

Offline

Board footer

Powered by FluxBB