First you either have /boot mounted on its own partition or as a sub-folder to / partition.
This affects the linux and initrd lines in examples below.
Next you either have a msdos partition table or a GPT one. This affects defining the boot partition with examples of (and its hd zero not hd O for orange) and you may have setup logical volume management (lvm)
set root=(hd0,msdos1)
set root=(hd0,gpt1)
set root=(lvm,<string>)
Don't worry if you can not remember this lvm string as ls command "should" reveal it.
There is no gap between comma and msdos1 or gpt1 or lvm string
Now leaping ahead, you may remember what your linux (kernel) line defined root was.
A number of people also have UUID strings which I regard as "error prone" to type in grub command mode, so use /dev/sdX please
examples include.
root=/dev/sda1
root=/dev/mapper-<string>
Assuming you can not boot and see grub but not grub rescue, you have grub in MBR/GPT and have some broken link to your balance of your boot files for grub.
Before we begin, the TAB key is important, it will offer many options of directories or files and depending on which line you are actioning.....might autocomplete your kernel name or initrd name etc....it will also autocomplete end of brackets if you are lazy to type it
Grub counts hard drives from zero but partitions from one. That is stupid IMHO, they should either both count from zero or both from one.
At grub prompt........ to find what drives and partitions are visible to grub
#########
type
Code: Select all
ls
Now lets pretend you can not remember which drive grub is on, and you have 2 drives.
I have W10 on drive 2 as example.
type
Code: Select all
ls (hd1,msdos1)
Ok so I now remember my MX is on drive 0

# define my boot partition
#####################
remember the examples above may differ to you.
Code: Select all
set root=(hd0,msdos1)
####################
linux /boot/vml (and now press TAB key to either autocomplete kernel name or offer kernel names)
(lines becomes)
Code: Select all
linux /boot/vmlinuz-5.10.0-17-amd64 root=/dev/sda1 ro quiet
initrd /boot/initrd.img-5.10.0-17-amd64
####################
Code: Select all
boot
2) input my kernel line and initrd where boot is a different partition from /
####################
linux vml (and now press TAB key to either autocomplete kernel name or offer kernel names)
(lines becomes)
Code: Select all
linux vmlinuz-5.10.0-17-amd64 root=/dev/sda5 ro quiet
initrd initrd.img-5.10.0-17-amd64
####################
Code: Select all
boot
good luck
3) Once you are in, check your /etc/default/grub and any manual edits you made to /etc/grub.d/40_custom and try
Code: Select all
sudo update-grub