#!/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