0

How would I go about changing the address GRUB tries to load my kernel at without using the linker? I would like to do this from GRUB config files.

DrCarnivore
  • 103
  • 6
  • Your question would be considered off-topic on StackOverflow since it is not a programming question. There are other communities like [superuser](http://superuser.com/) [askubuntu](https://askubuntu.com/) and [unix](https://unix.stackexchange.com/) where this question would be more appropiate. – Tin Nguyen Mar 20 '20 at 07:45

1 Answers1

1

Boot your machine. When you get to the grub menu press c. You will go into grub prompt.

With ls you can view your devices and partitions. Look through your partitions until you have the correct one.

ls
ls (hd0,gpt1)/
ls (hd0,gpt2)/
ls (hd1,gpt1)/
ls (hd1,gpt2)/
...

Let's assume the files are located at hd0,gpt2 and it is the only USB device -> /dev/sda2. We also assume at the root folder / there is your kernel vmlinuz and an initial ramdisk initrd.img.

Type into your grub prompt:

set root=(hd0,gpt2)
linux /vmlinuz root=/dev/sda2 rootdelay=10
initrd /initrd.img

When your machine boots correctly you can put this into your grub config files.

Tin Nguyen
  • 5,250
  • 1
  • 12
  • 32