meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux:grub:uefi [2025/03/24 10:15] niziaklinux:grub:uefi [2025/03/24 10:28] (current) niziak
Line 21: Line 21:
 Add new partitions to fstab: Add new partitions to fstab:
 <file ini /etc/fstab> <file ini /etc/fstab>
-UUID=D12D-CBBD  /boot/efi0       vfat    umask=0077      0       1 +UUID=xxxx-xxxx  /boot/efi        vfat    umask=0077,nofail,noauto      0       1 
-UUID=D150-1EE7  /boot/efi1       vfat    umask=0077      0       1+UUID=D12D-CBBD  /boot/efi0       vfat    umask=0077,nofail,noauto            1 
 +UUID=D150-1EE7  /boot/efi1       vfat    umask=0077,nofail,noauto            1
 </file> </file>
  
Line 37: Line 38:
  
 read -r DEV BOOTDIR <<< "$(echo "${DEVLINE}" | tr ',' ' ')" read -r DEV BOOTDIR <<< "$(echo "${DEVLINE}" | tr ',' ' ')"
-grub-install --efi-directory=/boot/"${BOOTDIR}" "${DEV}"+grub-install --target=x86_64-efi --efi-directory=/boot/"${BOOTDIR}" "${DEV}"
  
 done done
 +</file>
 +
 +According to [[https://wiki.debian.org/UEFI#RAID_for_the_EFI_System_Partition|RAID for the EFI System Partition]]:
 +
 +<file bash /etc/grub.d/90_copy_to_boot_efi2>
 +#!/bin/bash
 +
 +# https://wiki.debian.org/UEFI#RAID_for_the_EFI_System_Partition
 +set -e
 +
 +# $1 - dest efi mount point
 +copy_efi_to() {
 +if mountpoint --quiet --nofollow /boot/efi; then
 +    mount "$1" || :
 +    rsync --times --recursive --delete /boot/efi/ "$1"/
 +    # Being FAT it is even better when not mounted, won't be damaged in case of computer crash or power outage.
 +    # Ref: https://forums.debian.net/viewtopic.php?p=759692&sid=ff62e9207a064b027f041d2cd0a612a4#p759692
 +    umount "$1"
 +fi
 +}
 +
 +copy_efi_to /boot/efi0
 +copy_efi_to /boot/efi1
 +exit 0
 +
 </file> </file>