Have been reading that as well as --help and not sure I understand if you are saying I should be using and am not or that in this instance you are NOT to use that parameter. Could you explain?
grub-install /dev/sda
grub-install /dev/sda1
Both return cannot find EFI (uppercase)
/dev/sda1 is mounted to /efi (lowercase)
I tried this in using the parameter:
grub-install --efi-directory=/boot/efi --target=x86_64-efi /dev/sda
It returned error: failed to get canonical path of /boot/efi
But when I added /mnt before /boot/efi it started installing and gave
warning: disk does not exist so falling back to partition device dev/sda1
and 2 more lines of the same, then
error: disk ‘hostdisk//dev/sda1’ not found
OK… I just reread the grub manual
My mistake… for uefi boot, you dont specify a disk at all with grub install
so
grub-install --efi-directory= /mnt/boot/efi
warning: disk does not exist so falling back to partition device dev/sda1
and 2 more lines of the same, then
error: disk ‘hostdisk//dev/sda1’ not found
Not sure, but can you use Boot Repair from live session to reinstall grub for this restored OS? Or can we get a report from it maybe that might point out the issue?
I think it might need to be mounted to a mount point that is in the active linux… ie in the live system
So
umount /mnt/boot/efi
and mount it to /mnt in the live system
mount /dev/sda1 /mnt
then
grub-install --efi-directory=/mnt
Just consulted some examples in my PC
You need to mount /dev/sda2 as well
because grub needs to write stuff in /boot of the root filesystem
So
leave that mount you have
and add
mount /dev/sda2 /media
then
grub-install --efi-directory=/mnt --boot-directory=/media/boot
–target=x86_64-efi
This copy-on-write seems to be a recent issue in live sessions, though I am not convinced yet it is our issue. They are saying trying to udpate grub throws it, but we are installing.
I printed a report from the live session Boot Repair and it shows no errors found in the Boot Parameter Block for sda1. It also shows no OS nor any boot files.
Whereas sda2 shows the correct version of LM (21.2) that we restored and boot files on:
/boot/grub/grub.cfg
/etc/fstab
/etc/default/grub
That is why I had just been thinking we needed to include sda2, but still it hasn’t helped.
At this point I guess we have two options:
Use Boot Repair tool to install grub, but am not sure yet how that works on the non-running OS–needs research
Install LM and then try restore again so that at least sda1 has what it needs. We would still need to edit fstab after restore. And fresh install should wipe the disk prior so nothing residual remains to mess things up.
Unless you have a different option, let’s see what we can find out and I will try again tomorrow (when my eyes are not crossed…lol)
Thanks so much for all of your help. I am learning so much and since I cannot copy/paste to my Linux notebook right now, I have LOTS of photos documenting this process.
Well that was the first time I got that /cow error when I attempted sudo with grub-install. Is that relevant? I thought it always throws a Permission Denied if sudo is needed?
I need to understand that error… ie what is grub-install trying to do.?
Have your sleep. I will look into it. The error must come from using a live cd linux. What I gave you works for a linux running from an internal disk… you dont have one of those
Yes you might be able to use systemrescuecd to install grub, instead of the live cd. It is not much different.
I keep a Rescatux CD with Super Grub2 handy, if there is a bootable vmlinuz somewhere, it will find it, it has saved me a few times. This CD was made in January of 2020 and still works quite well.