Hi,
I personally don't really like Boot-Repair and prefer to use my own methods. I've reposted this from another forum.. Yes, it is my post!!
You can create this flashdrive using a Linux Mint live system. Once your system has booted, you can use the normal system tools to repair your Grub installation. All you need is the UUID of your Linux filesystem and the full filenames of your kernel & initrd.
Note: if your system doesn't use an initrd, then you'll need to use the partition UUID (instead of the filesystem UUID) on the kernel load line in your grub.cfg. Just ask here if you need specific details.
Rescue Grub Flashdrive for UEFI or Legacy.
Useful for those who dual boot with Windows.
Typical Uses: For when your computer now only boots into Windows. You cannot boot Linux.
Or, you have managed to damage your EFI partition contents.
It might be an idea to create a flashdrive **before** any Windows update borks Grub..
This creates a simple flashdrive boot device. Allows a booting choice of either using your system's 'grub.cfg' or a direct kernel boot.
It's often easier to fix Grub problems from within a running system.
Install UEFI and Legacy Grub to a flashdrive:
Format a flashdrive to fat32 and set the 'boot' and 'esp' flags. Note: Don't use GPT here. Use Gparted for everything.
I'll assume here that your flashdrive is seen as 'sda'. Use 'fdisk -l' to check.
Install UEFI & Legacy Grub:
EDIT: You may need to install these Grub packages into your Live system.. These will be lost on a reboot!!
Code:
sudo su
mount /dev/sda1 /mnt
grub-install --boot-directory=/mnt/EFI/boot --efi-directory=/mnt --target=x86_64-efi /dev/sda
grub-install --boot-directory=/mnt/EFI/boot --target=i386-pc /dev/sda
sync
exit
sudo xed /mnt/EFI/boot/grub/grub.cfg
Copy & paste the following sample 'grub.cfg':
You'll need the filesystem UUID of your Linux installation and the full filenames of your kernel & initrd.
You can create a text file containing these using:
Code:
blkid > myFilenames.txt
ls /boot/vmlinuz* >> myFilenames.txt
ls /boot/initrd* >> myFilenames.txt
Copy & paste the required UUID, kernel and initrd names. I recommend that you use the full kernel/initrd name, just in case the local kernel & initrd symlinks are incorrect. There is an entry here which should help when you've forgotten to update this 'grub.cfg' after upgrading your kernel.
The full kernel and initrd file names are similar to: 'vmlinuz-5.11.16-051116-generic' and 'initrd.img-5.11.16-051116-generic'.
Sample 'grub.cfg' using an example UUID and kernel/initrd names.
Code:
menuentry "Boot using the system's grub.cfg." {
search --set=root --fs-uuid e8ab7adf-e4b4-43cc-8c43-bbef6d53f6f1
set prefix=($root)/boot/grub
configfile $prefix/grub.cfg
}
menuentry "Direct kernel boot." {
search --set=root --fs-uuid e8ab7adf-e4b4-43cc-8c43-bbef6d53f6f1
linux /boot/vmlinuz-5.11.16-051116-generic root=UUID=e8ab7adf-e4b4-43cc-8c43-bbef6d53f6f1
initrd /boot/initrd.img-5.11.16-051116-generic
}
menuentry "Direct kernel boot. Kernel & initrd symlink" {
search --set=root --fs-uuid e8ab7adf-e4b4-43cc-8c43-bbef6d53f6f1
linux /boot/vmlinuz root=UUID=e8ab7adf-e4b4-43cc-8c43-bbef6d53f6f1
initrd /boot/initrd
}
Save and exit.
Unmount the flashdrive with:
This should be enough to boot your system.
Bodge99.