For a UEFI Linux rescue environment, especially when you want to chroot into your installed Gentoo or Debian system, you should mount the following virtual filesystems:
Mount point | Purpose |
|---|---|
| Device files |
| Pseudo-terminals |
| Process and kernel information |
| Hardware and kernel device information |
| Runtime system information |
The most important ones are /dev, /proc, and /sys.
For a UEFI rescue, I recommend this setup (assuming your installed system is mounted at /mnt):
1. Mount virtual filesystems
mount -t proc proc /mnt/proc
mount --rbind /sys /mnt/sys
mount --make-rslave /mnt/sys
mount --rbind /dev /mnt/dev
mount --make-rslave /mnt/dev
mount --bind /dev/pts /mnt/dev/pts
mount --rbind /run /mnt/run
mount --make-rslave /mnt/run2. Mount UEFI variables
If the rescue USB was booted in UEFI mode:
mount -t efivarfs efivarfs /sys/firmware/efi/efivarsIf already mounted, don't mount it again.
Make sure the EFI variables are accessible inside the chroot:
mount --bind \
/sys/firmware/efi/efivars \
/mnt/sys/firmware/efi/efivarsCheck:
ls /sys/firmware/efi/efivars3. Enter the installed system
chroot /mnt /bin/bash4. Verify
Inside the chroot:
mount | grep -E 'proc|sys|dev|run|efivarfs'
efibootmgr -vImportant: The EFI System Partition (ESP), usually FAT32, must also be mounted at the correct location (/boot/efi, /boot, or /efi, depending on your /etc/fstab).
References:
One recommendation: If you're rescuing your Gentoo installation, I can give you a complete Gentoo-specific UEFI rescue procedure, including EFI variables, GRUB and kernel/initramfs recovery.