Differences between revisions 1 and 3 (spanning 2 versions)
Revision 1 as of 2021-10-26 19:20:28
Size: 1163
Editor: SamatJain
Comment:
Revision 3 as of 2025-12-02 05:50:18
Size: 1368
Editor: SamatJain
Comment:
Deletions are marked like this. Additions are marked like this.
Line 10: Line 10:
mount --bind /dev/ $CHROOT_ROOT/dev
mount --bind /dev/pts $CHROOT_ROOT/dev/pts
# mount --bind /dev/ $CHROOT_ROOT/dev
# mount --bind /dev/pts $CHROOT_ROOT/dev/pts
# OR
mount --rbind /dev/ $CHROOT_ROOT/dev
Line 14: Line 16:
mount --bind /run $CHROOT_ROOT/run mount --rbind /run $CHROOT_ROOT/run
Line 28: Line 30:

== Links ==

 * [[https://maple52046.github.io/2017/11/03/Install-Ubuntu-in-UEFI-mode-with-debootstrap/|Install Ubuntu in UEFI mode with debootstrap]]

Notes related to Extensible Firmware Interface (EFI).

Repair for Linux

To reinstall UEFI entries, check what's installed with efibootmgr --verbose which will list all boot entries, and the default. If the entry for the OS is missing (usually "debian" or "ubuntu"), the entry may need to be re-added. Rather than manipulating EFI variables, it's easiest to reinstall grub which ensures all files/etc are in the right place.

If using a chroot to reinstall entries, first setup various bind mounts outside the chroot:

CHROOT_ROOT=/mnt
# mount --bind /dev/ $CHROOT_ROOT/dev
# mount --bind /dev/pts $CHROOT_ROOT/dev/pts
# OR
mount --rbind /dev/ $CHROOT_ROOT/dev
mount --bind /sys $CHROOT_ROOT/sys
mount --bind /proc $CHROOT_ROOT/proc
mount --rbind /run $CHROOT_ROOT/run

modprobe efivarfs
mount -o bind /sys/firmware/efi $CHROOT_ROOT/sys/firmware/efi

Also ensure the EFI partition is mounted at the correct location (e.g. usually /boot/efi).

After entering the chroot, reinstall grub with:

grub-install --target=x86_64-efi --efi-directory=/boot/efi 

Afterwards, double-check the boot entry shows up with efibootmgr.


CategoryCheatSheet

SamatsWiki: CheatSheet/EFI (last edited 2025-12-03 04:39:13 by SamatJain)