How to stop Calamares installer writing bootloader?

On most Arch-based distributions, (IIRC) the /boot directory is located on the distro’s root (/) partition, and efi is located on the ESP, so in a multi-boot scenario, each distribution on the computer has its own /boot directory, while all distributions mount the ESP partition at the top of the file system tree.

Ernie

1 Like

The Calamares configuration depends on the distribution’s implementation. With distributions that provide an option to not install a bootloader, the option will be found in the screen after you choose custom/manual partitioning. If the option’s available, you should see a section describing where the bootloader will be installed, usually at either the top/bottom of the window. You can click the drop-down at the far right to choose another bootloader, or none at all. Again, that depends on how Artix configured Calamares, so YMMV,

Ernie

2 Likes

Yeah, that is the way today…in Debian as well as Arch based distros.

It was not always like that. /boot used to be a separate partition and it contained the boot images for all distros if there was multiboot. That became an accounting nightmare and it was changed. You can see remnants of the old way in Gentoo where it is common to use a separate /boot, and also in OpenBSD where they keep separate partitions for security reasons.

Part of the motivation for separate partitions in the early days was thst disks were small and you could stop systems filling up /var and /tmp by keeping them on separate disks so that the root filesystem never filled. Filling the root filesystem is a disaster scene… everything stops.

2 Likes

This turns out to be a bit of a non-issue
The Calamares installer does have an option to choose not to install a bootloader. It is on the partitioning screen… I did not expect it there!

See, at the bottom,it says
Install Bootloader on:
and I have chosen ‘Do not install bootloader’
( the other options are on the MBR /bios-grub area and on the ESP.)

So this whole topic is my mistake… I expected it at the end, not in the partition step, but it makes sense now.

So, apologies to Calamares, it is an easy installer to use.

UPDATE:
The above was a VM install
When I tried to repeat the install to a HDD, the option ‘Install bootloader on:’ did not appear on the partitioning screen???
So i let it go ahead… and it said ‘Writing bootloader’ at the end of the install… not what I wanted

After it finished, I looked at the EFI partiton on that disk, and it contained

total 12
drwxr-xr-x 2 root root 4096 Dec 10 17:15 antiX
drwxr-xr-x 2 root root 4096 Dec 14 10:21 Artix
drwxr-xr-x 2 root root 4096 Dec 10 17:15 BOOT
root@trinity:/mnt/EFI# ls -l BOOT/*
-rwxr-xr-x 1 root root 143360 Dec 14 10:21 BOOT/BOOTX64.EFI

So it added the Artix directory with todays date… that is OK
and
it rewrote (BOOT/BOOTX64.EFI) with todays date… that may not be OK
but
the thing is it also changes the entries in the BIOS boot table.

So it looks like Calamares is doing a different thing with a hard install compared to a VM install? … it is assuming that hard installs should always write the bootloader. That implies that a Calamares install to HD will always take over control of grub?

Can anyone explain or justify that?

2 Likes

Hey @nevj

I read last year that the new Calamares ver. 3.3 had added the bootloader options in Partition section as follows:

Calamares 3.3 brings numerous changes, including support for more options in the Bootloader module when building the kernel command line, revamped fstab configuration, and support for skipping the bootloader installation in the Partition module in more scenarios.

Indicating not all scenarios yet? Maybe the distro chooses whether to include options. As seen in several distros I have installed, they almost always try to take over GRUB.

Conversations on Github since 2020 have this issue with different solutions, one being that BIOS vs EFI installs and new partitions vs existing partitions.

"For installations in BIOS mode, it is possible to install without a bootloader. According to your output, you should be able to skip the bootloader installation.

For installations in UEFI mode, it does always install a bootloader."

and

"There should be an option to not to do a GRUB installation, just in case a user needs to do it later (after completing a Calamares install) in a custom way, or doesn’t want to overwrite the existing bootloader which may be not a GRUB. Currently, the only way to skip a GRUB installation is to manually edit a /usr/lib/calamares/modules/bootloader/main.py
and comment out this line near the end of file at “def run()” function:

prepare_bootloader(fw_type)

—>

# prepare_bootloader(fw_type)

To make it more user-friendly, please add this option to UI…"

Not sure if it works in the version you are using, but one conversation showed:

However, it appears user is also using VBox.

Maybe digging further into the newest version and bootloader options could yield solutions.

Sheila

1 Like

Hi Sheila,
I think that is the key to understsnding this
My VM install was MBR, and it allowed me to skipbwriting the bootloader
My HD install was EFi and it did not allow me to skip writing bootloader

I think, for an UEFI install, something has to be written to the EFI partition, ie a directory named after the distro containing a boot file for that distro.
What you dont want it to do is trigger a change in the BIOS boot table… you want the boot table entry for that disk to continue to point to the distro that you choose to control grub on that disk.

Your image says you only get the bootloader install option if you configure a new partition table. You always do that in a VM, but would rarely do that on a HD.
My Calamares is the same as your second image… when I use a VM… ie when I make a new got partition table, I get the 3 choices of where to write the bootloader,

I will see what version of Calamares I have.
Some of that material you read is , I think, meant for developers, rather than users.
Not many people are going to go configure the installer before they start an install… they just want it to work.

2 Likes

Yes, but you would. :grinning:. I found a lot more Github threads but most of these users knew enough about the installer to modify it or were asking if there was a way to get around it. The person assisting did not see Calamares adding that user interface as a high priority. But that was 2022 and by 2023, they had at least allowed for not installing bootloader in “more” scenarios. The user was trying to install Artix without bootloader. Maybe you would get more from the whole conversation with links to guides.

Good Luck!

Sheila

1 Like

I would indeed. Installing to a multiboot HD can be a disaster. I will use all the protection I can get.
Thanks for the link

3 Likes