The officially official Devuan Forum!

You are not logged in.

#1 Yesterday 03:56:49

wolfdaemon
Member
Registered: 2025-12-26
Posts: 7  
Website

How to actually install Devuan (on UEFI, esp. desktop-live Install)

IMPORTANT: This guide has helped countless users recover from boot failures. Remember: the --removable flag is your friend when EFI variables are inaccessible!

## The Problem: "No Bootable Device" After Installation

If you have attempted to install Devuan following the Live Install Guide for the desktop-live ISO using the refractainstaller, you've probably encountered this issue. The installation process appears to finish successfully, but when you remove the USB drive and reboot, you've likely encountered a warning similar to:

grub-install: warning: EFI variables cannot be set on this system.
You will have to complete the GRUB setup manually.

This guide explains exactly why this happens, why it is not an issue with your physical system, and how the --removable flag provides a universal fix.

## The Core Concept (UEFI vs. Legacy)

To understand the error, you must understand the two ways computers boot:

  1. Legacy BIOS (Old Way): The computer looks at the very first sector of your hard drive (MBR) to find the bootloader. It's simple and doesn't require a special partition.

  2. UEFI (New Way): Modern computers (almost all made since 2012) use UEFI. Instead of looking at the first sector, the motherboard has a small internal database (NVRAM) that stores a Boot List. This list tells the computer exactly which file on which partition to load (e.g., \EFI\devuan\grubx64.efi).

  3. The Catch: To add an entry to this internal Boot List, the operating system installer must have special access to the motherboard's firmware settings via something called EFI Variables.

## Why the Installation Failed

When you run the Devuan installer (refractainstaller) or the grub-install command from a Live USB, one of two things usually happens to block access to these EFI Variables:

### Scenario A: Devuan booted the Live USB install in "Legacy/CSM" Mode

Even if your laptop supports UEFI, many ISO creators default to "Legacy" compatibility mode.

  • What happens: The Linux kernel sees it is running in Legacy mode. It disables all UEFI features because it thinks they aren't available.

  • The Result: When grub-install tries to talk to the UEFI firmware to add your new Devuan entry to the boot list, the firmware says, "I can't hear you," or the kernel says, "I don't have the tools to talk to it."

  • The Error: EFI variables cannot be set on this system.

### Scenario B: The efivarfs Filesystem is Missing

Even if you booted the USB in UEFI mode, the Live environment might not have automatically mounted the special virtual filesystem (efivarfs) that allows software to talk to the UEFI chip.

The Result: The installer copies the bootloader files to your hard drive successfully, but fails at the very last step: registering the boot entry in the motherboard's memory.

## The Consequence

The installer copies the necessary files (like grubx64.efi) to your hard drive's EFI partition, but it fails to tell your motherboard that these files exist. When you reboot, the motherboard looks at its empty Boot List, finds no instruction to load Devuan, and gives up with "No Bootable Device."

## The Solution (The --removable Flag)

You don't need to re-partition or fix the Live USB boot mode. You can force the bootloader to install in a way that bypasses the need for EFI Variables entirely.

### How It Works

UEFI standards mandate a fallback path. If the motherboard's Boot List is empty or broken, it is required to look for a specific file at a specific location:

/efi/boot/bootx64.efi

By using the --removable flag, you tell grub-install:

"Don't try to write to the motherboard's internal database (which is failing). Instead, copy the bootloader to the fallback location that every UEFI computer checks automatically."

## Step-by-Step Repair Guide

Since you already have Devuan installed and just need to repair GRUB, follow these steps to chroot correctly and reinstall the bootloader. The "no directory" error you saw earlier usually happens because the virtual filesystems (/dev, /proc, /sys) were not bound before entering the chroot.

  1. Boot from your Live USB/CD.

  2. Login as superuser:

    su -
  3. Mount Partitions and Bind Filesystems

    Use lsblk to identify the root / partition (TYPE... part) that you set with refractainstaller for your permanent (non-live) install on your device's drive. It should be the one that IS NOT the mountpoint for the /run/live* directories.
       
    In the example output below, this is what typical user's setup might look like:

    NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
    loop0    7:0    0   1.5G  1 loop /run/live/rootfs/filesystem.squashfs
    sda      8:0    0   1.8T  0 disk 
    └─sda1   8:1    1   1.7G  0 part /run/live/medium
    └─sda2   8:2    1   1.4M  0 part
    sdb
    └─sdb1   9:1    1   476M  0 part /boot/efi
    └─sdb2   9:2    1   69.4G 0 part /

    In this example case, the partition identified within /dev/sdb2 would be root /, and the EFI partition for UEFI setups would be /dev/sdb1.
    `
    |---
    | NOTE: The commands in below will use this example scenario, your input/commands will vary.
    |---
         
    - Mount root partition:

    mount /dev/sdb2 /mnt

    - (UEFI use only) Mount EFI partition:

    mount /dev/sdb1 /mnt/boot/efi

    - Bind virtual filesystems (CRITICAL STEP):

    mount --rbind /dev /mnt/dev
    mount --rbind /proc /mnt/proc
    mount --rbind /sys /mnt/sys
    mount --rbind /run /mnt/run

    - Copy DNS settings to allow network access inside chroot:

    cp /etc/resolv.conf /mnt/etc/
  4. Enter the Chroot

    Now enter the environment:

    chroot /mnt /bin/bash
  5. Reinstall and Update GRUB

    Once inside the chroot, determine your boot mode. Run this command to check:

    ls /sys/firmware/efi/efivars

       
    If the directory is missing or empty, you are in BIOS/Legacy mode.
    If the directory exists and contains files, you are in UEFI mode.
       
    - For BIOS/Legacy Systems:

    apt update
    apt install --reinstall grub-pc
    grub-install /dev/sdX
    update-grub

    |---
    | NOTE: Replace /dev/sdX with your disk, e.g., /dev/sda, NOT a partition like /dev/sda1)
    |---
    `
    - For UEFI Systems:

    apt update
    apt install --reinstall grub-efi-amd64
    grub-install --target=x86_64-efi --efi-directory=/boot/efi --removable
    update-grub

       
    |---
    | NOTE: We removed --bootloader-id=Devuan long option in the grub-install command
    | because it is ignored when using --removable).
    |---
       
    |---
    | NOTE: If update-grub fails to detect other operating systems, ensure os-prober is installed and uncomment
    | GRUB_DISABLE_OS_PROBER=false in /etc/default/grub.
    |---
    `

  6. Exit and Reboot

    umount -R /mnt
    reboot

Last edited by wolfdaemon (Yesterday 16:28:54)


"An idiot admires complexity, a genius admires simplicity." - Terry A. Davis

Offline

#2 Yesterday 13:38:52

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,974  

Re: How to actually install Devuan (on UEFI, esp. desktop-live Install)

Booting a usb in uefi mode varies depending on the motherboard. I usually bring up the boot device menu to boot from usb, and some motherboards give a choice of booting it either way. The devuan-live isos when imaged to a usb stick (using dd or cat) should boot whichever way the bios is set to boot the hard disk, but that doesn't always work out. Again, that depends on how the motherboard implements uefi (i.e. how it deviates from standards.)

A simpler way to install to the removable media path is to edit /etc/refractainstaller.conf to uncomment the media_opt line.

# UEFI Removable Media Path
# Uncomment to force installation to the removable media path also.
# This option is only available on EFI.
# Default is commented out.

#media_opt="--force-extra-removable"

Offline

#3 Yesterday 16:58:39

wolfdaemon
Member
Registered: 2025-12-26
Posts: 7  
Website

Re: How to actually install Devuan (on UEFI, esp. desktop-live Install)

Thanks for the quick reply, fsmithred.

Problem: The Live Install Guide doesn't distinguish between standard UEFI install and the buggy-firmware workaround.

I think the confusion (at least for me) comes from the Live Install Guide not drawing a clear line between two different things:

  1. Standard UEFI install -- the installer already auto-detects a UEFI environment, finds the ESP, and installs GRUB to the vendor-specific path (/EFI/devuan/). This "just works" on well-behaved firmware and needs no user intervention.

  2. Workaround for buggy firmware -- the media_opt="--force-extra-removable" option installs an additional copy of GRUB to the fallback path (/EFI/BOOT/BOOTX64.EFI) for motherboards whose firmware doesn't properly read NVRAM boot variables or only looks at the removable-media path.

I agree the opt-in design is correct -- always forcing it would cause multiple OS installers to fight over \EFI\BOOT\BOOTX64.EFI and destroy proper boot-order control. That's well documented on the Debian wiki ("Force grub-efi installation to the removable media path" section - UEFI article).

Solution A: Implementing a Devuan option force grub-efi installation to the removable media path

However, in that same citation, Debian Trixie has now added a middle ground that I think would work well for Devuan's Refracta Installer (I'm not sure if the other ISOs' installers do something similar).

The background: UEFI firmware looks for a bootloader in two places, in order:

  1. NVRAM boot variables -- the firmware's internal boot menu. Each OS registers itself here under its own name (e.g., "Devuan"). This is the correct, standard path.

  2. The fallback path -- \EFI\BOOT\BOOTX64.EFI on the ESP. A single, generic file that firmware checks only if NVRAM is empty or unreadable.

The problem with the fallback path: it's a single file. Only one OS can own it at a time. If two OSes both install there, the second overwrites the first. That's why Debian doesn't install there by default.

But some motherboards are buggy and only look at the fallback path -- they never read NVRAM. On those systems, a standard install produces "Boot device not found" after reboot.

Trixie's solution is a conditional check at install time:

1. Mount the ESP.
2. Check whether \EFI\BOOT\BOOTX64.EFI already exists.
3. If it does NOT exist:
     → Install GRUB to the vendor path (\EFI\debian\grubx64.efi)   [always done]
     → ALSO install GRUB to the fallback path (\EFI\BOOT\BOOTX64.EFI)
4. If it DOES exist:
     → Install GRUB to the vendor path only.
     → Leave the fallback path alone.

Why this is safe:

  • Fresh install, no other OS -> fallback is empty -> gets populated -> even buggy firmware can find the bootloader.

  • Dual-boot, Windows or another Linux already installed -> fallback is occupied -> gets left alone -> the other OS keeps working.

For Refracta, the logic would be something like:

# During the UEFI bootloader install step:
if [ ! -f "$ESP_MOUNT/EFI/BOOT/BOOTX64.EFI" ]; then
    grub_install_params="$grub_install_params --force-extra-removable"
fi

This is a small, safe change -- it only kicks in when the fallback path is empty, so it can't clobber an existing bootloader. It would mean that on the majority of UEFI systems (fresh install, no other OS), the user just works out of the box without being forced to manually edit the refractainstaller.conf configuration file at all.

Solution B: Adding a "Troubleshooting UEFI Boot" section/admonition in the Live ISO Install Guide

As for the Live Install Guide, I think it would still be worth adding a short troubleshooting paragraph like:

If your system boots in UEFI mode, the installer will handle the bootloader automatically. If, after installation, the system does not boot and drops to a UEFI shell or "Boot device not found", your firmware may have a non-standard UEFI implementation. In that case, edit /etc/refractainstaller.conf to uncomment the media_opt line:

# UEFI Removable Media Path
# Uncomment to force installation to the removable media path also.
# This option is only available on EFI.
# Default is commented out.

#media_opt="--force-extra-removable"

This covers the remaining edge cases (e.g., the fallback path was occupied by something non-bootable, or the firmware is broken in a way that even the fallback path doesn't help).

Happy to put together a commit (especially for admonition on Excalibur's Live Install Guide on the website), and/or wiki edit (if that's a thing yet) if that's the right place for it. I just need permissions/the direction as to how to actually do that.

Last edited by wolfdaemon (Yesterday 17:25:16)


"An idiot admires complexity, a genius admires simplicity." - Terry A. Davis

Offline

#4 Yesterday 18:52:04

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,974  

Re: How to actually install Devuan (on UEFI, esp. desktop-live Install)

I gave a link to this discussion to our webmaster and we can add the information to the guide. I also made a note in my TODO list for refractainstaller. Thanks!

Offline

Board footer