I’ve made a fedora system in a virtual machine (virt manager, Q35 chipset, UEFI) using the live installer and GUI. Then, I converted the qcow2 image to raw and then I dd’d it to my /dev/sda. Made the following steps:
sudo mount /dev/sda2 /mnt
sudo mount /dev/sda1 /mnt/boot
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo mount --bind /run /mnt/run
sudo chroot /mnt
Then I figured I’d run grub2-mkconfig and be testing this system, but:
# grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
/usr/bin/grub2-editenv: error: cannot open `/boot/grub2/grubenv.new': No such file or directory.
/sbin/grub2-mkconfig: line 268: /boot/efi/EFI/fedora/grub.cfg.new: No such file or directory
# grub2-mkconfig -o /boot/grub2/grub.cfg
/usr/bin/grub2-editenv: error: cannot open `/boot/grub2/grubenv.new': No such file or directory.
/sbin/grub2-mkconfig: line 268: /boot/grub2/grub.cfg.new: No such file or directory
Edit: grub2-mkconfig -o /boot/grub2/grub.cfg is working on the virtual machine.
You must be root to use grub2-mkconfig (either with sudo or logged in as root)
Your list of commands does not show that you ever shifted to become root or that you used sudo with the grub2-mkconfig command.
What you are attempting sounds like it ought to work. I thought Fedora’s default install created separate partitions for /boot and /boot/efi though. You appear to have only mounted /boot. Have you configured the system differently?
When I do a chroot like that I always try and run a mount -a command after doing the chroot so I can be certain all the appropriate filesystem/partitions are mounted before doing any other commands.
I overlooked the missing /boot/efi in the steps posted by the OP above.
Thanks. It gave me some weird errors (not being able to access /var/log/dnf.log I think?). But On the second attempt the guide took me there, it’s booting. Thanks for the help!