I am trying to boot my own simple OS kernel using GRUB stage2_eltorito
. However, the compiled ISO simply leads to a GRUB prompt. I looked up online, and I saw I need to load my kernel. However, when I try to load my kernel, it says I need to load a hard disk first, using the root
command. How do I load my ISO file's partition to load my kernel? Thanks in advance!
Add a comment
|
2 Answers
There is your howto:
https://www.linux.com/learn/how-rescue-non-booting-grub-2-Linux
or here:
In short:
grub> set pager=1
grub> ls
(hd0) (hd0,msdos2) (hd0,msdos1)
grub> ls (hd0,1)/
lost+found/ bin/ boot/ cdrom/ dev/ etc/ home/ lib/
lib64/ media/ mnt/ opt/ proc/ root/ run/ sbin/
srv/ sys/ tmp/ usr/ var/ vmlinuz vmlinuz.old
initrd.img initrd.img.old
This is just example, you have to modify it to your situation. You have examples in linked howtos.
-
1Thank you!!
ls (hd0, gptX)
, where X is partition number, worked for me and I finally found out where my OS was located Commented Oct 22, 2021 at 19:25
The grub ls -l
command will show all devices and partitions with their UUID-s.
-
4
ls -l
is not valid because-l
is not a valid option for ls. You will get the errorerror: file '-l' not found
Commented May 21, 2020 at 16:14 -
1@shrewmouse Please check the version of GRUB you are using, I believe this applies to version 2 only.– gregn3Commented May 21, 2020 at 16:20
-
It's grub2 and the documentation that you link to doesn't even have the a -l option. Commented May 21, 2020 at 16:39
-
2It works when in the GRUB command prompt, before booting the OS. I have just checked, I have GRUB version 2.04.– gregn3Commented May 21, 2020 at 17:03
-
1