Grub2 file loading help

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
moonsheep
Posts: 4
Joined: Sat Oct 26, 2019 1:04 pm

Grub2 file loading help

Post by moonsheep »

Hello everyone,
so I have been developing a 32-bit (it later will switch into 64-bit mode) kernel that is multiboot2 compilant.
Now everything works amazingly on a grub-rescue iso image that's booted in qemu, however, when I use grub
to boot the system from my actual computer it seems to fail to load the file for some reason.
Here is the grub command sequence:

Code: Select all

set root='(hd0,9)'
search --no-floppy --fs-uuid --set=root 5a59c03c-d0a7-4677-b166-a7caebc87b0a
multiboot2 /jnix
boot
It seems as though it finds the file just fine, however on the "multiboot2" command it errors out saying:
error: not a regular file
Now I don't quite understand this, since my kernel is clearly not a symlink or a directory, and it boots
fine from the rescue ISO.
Am I misisng something here?
Thank you in advance!
Octocontrabass
Member
Member
Posts: 5580
Joined: Mon Mar 25, 2013 7:01 pm

Re: Grub2 file loading help

Post by Octocontrabass »

Which filesystem on your computer has the UUID 5a59c03c-d0a7-4677-b166-a7caebc87b0a? Is it the one where your kernel is located?
moonsheep
Posts: 4
Joined: Sat Oct 26, 2019 1:04 pm

Re: Grub2 file loading help

Post by moonsheep »

Yeah, I'm sorry I didn't clarify that.
It's on /dev/sda9 and as said, it seems to be nicely found by the search command.
Do you have any ideas why would grub not load my kernel?
The weirdest thing really is grub recognizing it as not a "regular file", because it IS indeed a regular file and works pretty well with a rescue disk (in the rescue disk there's only one partition with both GRUB and my kernel in it).
Octocontrabass
Member
Member
Posts: 5580
Joined: Mon Mar 25, 2013 7:01 pm

Re: Grub2 file loading help

Post by Octocontrabass »

Have you verified (with "ls -l" or similar) that it actually is a regular file on sda9?
moonsheep
Posts: 4
Joined: Sat Oct 26, 2019 1:04 pm

Re: Grub2 file loading help

Post by moonsheep »

Yep, I did that
Screenshot from 2019-10-30 09-50-08.png
Screenshot from 2019-10-30 09-50-08.png (4.8 KiB) Viewed 2489 times
Screenshot from 2019-10-30 09-53-08.png
Octocontrabass
Member
Member
Posts: 5580
Joined: Mon Mar 25, 2013 7:01 pm

Re: Grub2 file loading help

Post by Octocontrabass »

Does your installation of GRUB support the filesystem you're using on sda9? It might not work if it's not the same filesystem as your /boot partition.

Is your disk bigger than 2TB? GRUB might not be too happy if sda9 is somewhere outside the first 2TB of the disk.
User avatar
iansjack
Member
Member
Posts: 4703
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Grub2 file loading help

Post by iansjack »

Have you tried running

Code: Select all

grub-file --is-x86-multiboot2
on the fie?

Are you sure that the multiboot2 grub module exists on your disk and that it is a regular file?

Have you tried loading it explicitly in grub.cfg?
moonsheep
Posts: 4
Joined: Sat Oct 26, 2019 1:04 pm

Re: Grub2 file loading help

Post by moonsheep »

iansjack wrote:Have you tried running

Code: Select all

grub-file --is-x86-multiboot2
on the fie?
It outputs nothing. Is this normal?
iansjack wrote:Are you sure that the multiboot2 grub module exists on your disk and that it is a regular file?
Yep, I'm pretty sure.
iansjack wrote:Have you tried loading it explicitly in grub.cfg?
Yeah, I did that too, and got the same error message.
Post Reply