archinstall icon indicating copy to clipboard operation
archinstall copied to clipboard

Is it possible to have an /efi partition and NO /boot partition with grub ?

Open HanM23 opened this issue 11 months ago • 7 comments

This is not clear for me of what it's possible to do and not possible with archinstall.

I have tried many times manual partitioning with /efi (in fat32 unencryped of course) partition (and no /boot partition) with btrfs (@ and @home encrypted) with grub as bootloader.

I always end up with issue during grub installation saying I must have "GRUB_ENABLE_CRYPTODISK=y" in /etc/default/grub, what i do in custom commands part of user_configuration.json

 "bootloader": "Grub",
    "config_version": "2.7.2",
    "custom-commands": [
        "echo 'GRUB_ENABLE_CRYPTODISK=y' >>/etc/default/grub"
    ],

Before to go further in the investigation, could you please telle me if this kind of setup is possible ? Many thanks

HanM23 avatar Mar 20 '24 02:03 HanM23

EDIT : it does not work either with no encryption. I got the following error during grub installation : /efi/grub/grub.cfg : no such file or directory.

grub.cfg should not be there, it should be in the root filesystem /boot/grub/grub.cfg

My partition layout is simple, in manual mode :

  1. /efi partition with boot and esp flags
  2. btrfs filesystem with recommanded sub layout

How do you manager that have this setup ?

  • /efi partition
  • btrfs filesystem with /boot directory
  • grub
  • luks optionally

Below is my actual json

{
    "additional-repositories": [],
    "archinstall-language": "English",
    "audio_config": {
        "audio": "pipewire"
    },
    "bootloader": "Grub",
    "config_version": "2.7.2",
    "custom-commands": [
        "echo 'GRUB_ENABLE_CRYPTODISK=y' >>/etc/default/grub"
    ],
    "debug": false,
    "disk_config": {
        "config_type": "manual_partitioning",
        "device_modifications": [
            {
                "device": "/dev/sda",
                "partitions": [
                    {
                        "btrfs": [],
                        "dev_path": null,
                        "flags": [
                            "Boot",
                            "ESP"
                        ],
                        "fs_type": "fat32",
                        "mount_options": [],
                        "mountpoint": "/efi",
                        "obj_id": "ad3ea5b1-a146-40ec-af8a-9370465425d1",
                        "size": {
                            "sector_size": {
                                "unit": "B",
                                "value": 512
                            },
                            "unit": "B",
                            "value": 499982592
                        },
                        "start": {
                            "sector_size": {
                                "unit": "B",
                                "value": 512
                            },
                            "unit": "sectors",
                            "value": 34
                        },
                        "status": "create",
                        "type": "primary"
                    },
                    {
                        "btrfs": [
                            {
                                "compress": true,
                                "mountpoint": "/",
                                "name": "@",
                                "nodatacow": false
                            },
                            {
                                "compress": true,
                                "mountpoint": "/home",
                                "name": "@home",
                                "nodatacow": false
                            }
                        ],
                        "dev_path": null,
                        "flags": [],
                        "fs_type": "btrfs",
                        "mount_options": [],
                        "mountpoint": null,
                        "obj_id": "b7f6d781-bd31-467e-abc4-12a6008df7a2",
                        "size": {
                            "sector_size": {
                                "unit": "B",
                                "value": 512
                            },
                            "unit": "B",
                            "value": 8711776416
                        },
                        "start": {
                            "sector_size": {
                                "unit": "B",
                                "value": 512
                            },
                            "unit": "MB",
                            "value": 501
                        },
                        "status": "create",
                        "type": "primary"
                    }
                ],
                "wipe": false
            }
        ]
    },
    "disk_encryption": {
        "encryption_type": "luks",
        "partitions": []
    },    
    "hostname": "archlinux",
    "kernels": [
        "linux"
    ],
    "locale_config": {
        "kb_layout": "us",
        "sys_enc": "UTF-8",
        "sys_lang": "en_US"
    },
    "mirror_config": {
        "custom_mirrors": [],
        "mirror_regions": {
            "Germany": [
                "https://pkg.fef.moe/archlinux/$repo/os/$arch"                
            ]
        }
    },
    "network_config": {
        "type": "nm"
    },
    "no_pkg_lookups": false,
    "ntp": true,
    "offline": false,
    "packages": [
        "firefox",
        "networkmanager",
        "btrfs-progs",
        "linux-headers",
        "e2fsprogs"
    ],
    "parallel downloads": 0,
    "profile_config": {
        "gfx_driver": "Nvidia (proprietary)",
        "greeter": "sddm",
        "profile": {
            "custom_settings": {
                "Kde": {}
            },
            "details": [
                "Kde"
            ],
            "main": "Desktop"
        }
    },
    "script": "guided",
    "silent": false,
    "skip_ntp": false,
    "skip_version_check": false,
    "swap": true,
    "timezone": "Europe/Paris",
    "uki": false,
    "version": "2.7.2"
}

HanM23 avatar Mar 20 '24 13:03 HanM23

EDIT : it does not work either with no encryption. I got the following error during grub installation : /efi/grub/grub.cfg : no such file or directory. grub.cfg should not be there, it should be in the root filesystem /boot/grub/grub.cfg

If you're specifying a boot flag, and an efi partition for grub, like you have done:

"bootloader": "Grub",
    "config_version": "2.7.2",
    "custom-commands": [
        "echo 'GRUB_ENABLE_CRYPTODISK=y' >>/etc/default/grub"
    ],
    "debug": false,
    "disk_config": {
        "config_type": "manual_partitioning",
        "device_modifications": [
            {
                "device": "/dev/sda",
                "partitions": [
                    {
                        "btrfs": [],
                        "dev_path": null,
                        "flags": [
                            "Boot",
                            "ESP"
                        ],
                        "fs_type": "fat32",
                        "mount_options": [],
                        "mountpoint": "/efi",

Then it's going to install grub there.

But your issue is different, you're asking if you can away with the boot partition, which doesn't align with what you're saying:

grub.cfg should not be there, it should be in the root filesystem /boot/grub/grub.cfg

grub.cfg should be in /efi if you want to away with /boot - but it's not recommended this way. /boot is for handling boot related behaviour, not efi entries. I recommend you do basic manual partitioning and then configure the rest from the cli.

Xeckt avatar Mar 20 '24 17:03 Xeckt

Hi @Xeckt

I think there is a confusion. Look, my current system i have (installed years ago)

  1. ESP partition mounted in /boot/efi (with both esp and boot flags) because it was recommended in arch wiki
  2. Boot folder within the btrfs filesystem where there is grub, kernel, initram and so on.

i want to keep this kind of setup because with a esp fat32 partition mounted in /boot, it causes problems with btrfs snapshot, kernel and initram are not 'embedded' in a snapshot, so you could have issue when you restore such a snapshot.

Now, in arch wiki, instead of having an esp partition mounted in /boot/efi, they recommend /efi, that is why there is the /efi mountpoint in my json.

What do i have to modify in my json ? Remove the boot flag from the /efi partition ? Or keep having /boot/efi esp partition with both boot and esp flags ?

Thanks

HanM23 avatar Mar 20 '24 18:03 HanM23

You would just mount the EFI partition and have it marked as an EFI partition with the boot flag, that EFI will point to the grub inside /boot

Xeckt avatar Mar 21 '24 16:03 Xeckt

What you are attempting is not supported by archinstall. See https://github.com/archlinux/archinstall/issues/2428#issuecomment-2044045229

codefiles avatar Apr 09 '24 02:04 codefiles

What you are attempting is not supported by archinstall. See #2428 (comment)

I really wonder what is the usefulness of the installer, it should be much more better to have a Calamares installation, instead of this kind of text-mode installation with few possibilities

HanM23 avatar Apr 09 '24 02:04 HanM23

The official Arch Linux installation image utilizes the Linux console and Calamares does not have support for that, does it?

codefiles avatar Apr 09 '24 03:04 codefiles