Page 1 of 1

Grub2 file loading help

Posted: Sat Oct 26, 2019 1:15 pm
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!

Re: Grub2 file loading help

Posted: Sun Oct 27, 2019 8:52 am
by Octocontrabass
Which filesystem on your computer has the UUID 5a59c03c-d0a7-4677-b166-a7caebc87b0a? Is it the one where your kernel is located?

Re: Grub2 file loading help

Posted: Sun Oct 27, 2019 1:17 pm
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).

Re: Grub2 file loading help

Posted: Tue Oct 29, 2019 3:57 am
by Octocontrabass
Have you verified (with "ls -l" or similar) that it actually is a regular file on sda9?

Re: Grub2 file loading help

Posted: Wed Oct 30, 2019 2:54 am
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 2512 times
Screenshot from 2019-10-30 09-53-08.png

Re: Grub2 file loading help

Posted: Wed Oct 30, 2019 3:45 am
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.

Re: Grub2 file loading help

Posted: Wed Oct 30, 2019 4:24 am
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?

Re: Grub2 file loading help

Posted: Tue Nov 05, 2019 1:06 pm
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.