Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Can't boot grub2 with efi
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
axl
Guru
Guru


Joined: 11 Oct 2002
Posts: 536
Location: Romania

PostPosted: Wed Apr 20, 2016 6:00 pm    Post subject: Reply with quote

don't you worry about my patience. i'm upset it's taking me so long... :)

so let's review.

in this scenario, we KNOW the sda1 is the wrong type. should be type EF00. yours is 0700.

so now, sda2 on /mnt/gentoo. sda1 /mnt/gentoo/boot/efi. and boot/proc/sys. chroot and goodluck.

is sda1 vfat ?

also, i said grub2-install /dev/sda should work. grub2-mkconfig only creates grub.conf.

IF grub2-mkconfig freezes the system, it's prolly because of os-prober or whatever. grub.conf can be written by hand. that is no problem.

IF grub2-install freezes the system... that is a bit bad. maybe i suggest a different usb stick with a different os?

freeze the system. that's a very unpleasant bug. try the system rescue cd that gentoo recommends. http://www.system-rescue-cd.org/SystemRescueCd_Homepage

try changing the EFI partition type at first EF00. make sure it's vfat and healthy and clarify which of the commands freezes the system. also maybe clarify what happens on sda3 as well. i'm thinking os-prober which is part of grub2-mkconfig could freeze the system because of what is happening with your win partition on sda3. could be. dont know.

EDIT: also make sure you install windows in efi mode as well. otherwise we return to that sda1 legacy boot partition. again, it's not needed on efi systems, but it's sometimes hard to put all the ducks in a row. in my case, osx didn't make things easy at all. but forced me to learn :)
Back to top
View user's profile Send private message
vlynd
Tux's lil' helper
Tux's lil' helper


Joined: 23 Jan 2012
Posts: 123

PostPosted: Wed Apr 20, 2016 6:48 pm    Post subject: Reply with quote

Okay!

I did this on /dev/sda1:
Code:
mkfs.vfat /dev/sda1


And changed the type:

Code:
Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          206847   100.0 MiB   EF00
   2          206848       105064447   50.0 GiB    8300


Code:
Device      Start       End   Sectors  Size Type
/dev/sda1    2048    206847    204800  100M EFI System
/dev/sda2  206848 105064447 104857600   50G Linux filesystem


The system freezes when doing grub2-install /dev/sda. But as I said, working remotely via ssh on the system still works Thats strange.
It freezes at this point:

Code:
grub2-install: info: writing 968 bytes of a fixup block starting at 0xc000.
grub2-install: info: reading /usr/lib/grub/x86_64-efi/fshelp.mod.
grub2-install: info: reading /usr/lib/grub/x86_64-efi/ext2.mod.
grub2-install: info: reading /usr/lib/grub/x86_64-efi/part_gpt.mod.
grub2-install: info: kernel_img=0x1e649c0, kernel_size=0x18c00.
grub2-install: info: the core size is 0x1cd78.
grub2-install: info: writing 0x1e000 bytes.
grub2-install: info: copying `/boot/grub/x86_64-efi/core.efi' -> `/boot/efi/EFI/gentoo/grubx64.efi'.
grub2-install: info: Registering with EFI: distributor = `gentoo', path = `\EFI\gentoo\grubx64.efi', ESP at hostdisk//dev/sda,gpt1.
grub2-install: info: executing efibootmgr --version </dev/null >/dev/null.
grub2-install: info: executing modprobe -q efivars.
grub2-install: info: executing efibootmgr -c -d /dev/sda -p 1 -w -L gentoo -l \EFI\gentoo\grubx64.efi.
Installation finished. No error reported.


My Windows is on a different HDD, so that shouldnt be a problem, no?
Back to top
View user's profile Send private message
axl
Guru
Guru


Joined: 11 Oct 2002
Posts: 536
Location: Romania

PostPosted: Wed Apr 20, 2016 6:56 pm    Post subject: Reply with quote

vlynd wrote:

Code:
grub2-install: info: writing 968 bytes of a fixup block starting at 0xc000.
grub2-install: info: reading /usr/lib/grub/x86_64-efi/fshelp.mod.
grub2-install: info: reading /usr/lib/grub/x86_64-efi/ext2.mod.
grub2-install: info: reading /usr/lib/grub/x86_64-efi/part_gpt.mod.
grub2-install: info: kernel_img=0x1e649c0, kernel_size=0x18c00.
grub2-install: info: the core size is 0x1cd78.
grub2-install: info: writing 0x1e000 bytes.
grub2-install: info: copying `/boot/grub/x86_64-efi/core.efi' -> `/boot/efi/EFI/gentoo/grubx64.efi'.
grub2-install: info: Registering with EFI: distributor = `gentoo', path = `\EFI\gentoo\grubx64.efi', ESP at hostdisk//dev/sda,gpt1.
grub2-install: info: executing efibootmgr --version </dev/null >/dev/null.
grub2-install: info: executing modprobe -q efivars.
grub2-install: info: executing efibootmgr -c -d /dev/sda -p 1 -w -L gentoo -l \EFI\gentoo\grubx64.efi.
Installation finished. No error reported.



this part of the snippet shows what i said all along. should be able to install grub2-install /dev/sda without problems. WHY on earth it's working in ssh and not on console... i dont know. but the question is... is it working now? did it appear back in bios boot options? does it boot? we're back on kernel things i guess.

Quote:
My Windows is on a different HDD, so that shouldnt be a problem, no?


not necessary. os-prober (or at least what i thought could be the problem) is an util that grub uses in the grub2-mkconfig command to write a grub.conf that includes windows and some installments of mac and other linux distros. on ALL harddrives.

in fact, when you wrestle with situations like yours, i would disconnect as much hw as possible until i have the efi/main drive thing under control.

but still. you still haven't commented on the kernel. with ext4/without fb/with sata etc etc. we're back on efi/grub issues. this line:

Installation finished. No error reported.

shows grub finally installed in efi mode. does it work?:)


EDIT: so yes. you could have your second hdd with windows in mbr/bios mode. i dont know. just disconnect it until you finish with this drive. i dont know the code behide os-prober, and i seen it do weird things sometimes. just as grub. it's best to isolate what you are working on. and when it is working, add more stuff. then fix for the stuff u add. and repeat.
Back to top
View user's profile Send private message
vlynd
Tux's lil' helper
Tux's lil' helper


Joined: 23 Jan 2012
Posts: 123

PostPosted: Wed Apr 20, 2016 7:03 pm    Post subject: Reply with quote

No it still doesnt show up in the boot menu of the bios! And thats odd because it says there were no problems installing grub.

I havent seen "gentoo" in the boot menu of the bios for a while now.

Imho windows shouldnt be a problem because it did work yesterday... I just must have screwed it up. I will try it agin with the rescue cd you posted.

I would be glad if we were back at the kernel because that would mean I got grub properly installed.
Back to top
View user's profile Send private message
axl
Guru
Guru


Joined: 11 Oct 2002
Posts: 536
Location: Romania

PostPosted: Wed Apr 20, 2016 7:06 pm    Post subject: Reply with quote

don't despair. we're close. it could be something specific to your mobo. i suggest upgrading bios, still insist on disconnecting unnecessary hw, and try again with that rescue thing. but it is odd. that ssh/console thing is very odd. what type of mobo do you have. am sure you haven't specified that.

EDIT: bios again, it's something i am not entirely reliant on. mine was a bitch with clover. clover is mac's grub. that's why i am suggesting that approach. disconnect all, connect one by one. i've been through that. u can't expect every component to act as it should. not when you are looking for a bug specific to your hw. and yes, i think we are getting specific to your hw. mobo in particular. should sure love to google that.


Last edited by axl on Wed Apr 20, 2016 7:09 pm; edited 1 time in total
Back to top
View user's profile Send private message
vlynd
Tux's lil' helper
Tux's lil' helper


Joined: 23 Jan 2012
Posts: 123

PostPosted: Wed Apr 20, 2016 7:08 pm    Post subject: Reply with quote

My mobo is: ASRock H77M
Back to top
View user's profile Send private message
axl
Guru
Guru


Joined: 11 Oct 2002
Posts: 536
Location: Romania

PostPosted: Wed Apr 20, 2016 7:14 pm    Post subject: Reply with quote

https://www.asus.com/Motherboards/P8H77M/HelpDesk_Download/

start with this. select your type of windows. update your FW to 1306 and let's pick up from there. or that rescue disk. whatever you prefer.

EDIT: although i doubt it's the bios thing. u prolly already have 1306. it's from 2014.
Back to top
View user's profile Send private message
vlynd
Tux's lil' helper
Tux's lil' helper


Joined: 23 Jan 2012
Posts: 123

PostPosted: Thu Apr 21, 2016 7:30 am    Post subject: Reply with quote

Good news everybody! :D

What I did:

- Updated BIOS/UEFI
- Used Ubuntu 14.04 LTS as Live USB-Stick
- Run grub2-insall /dev/sda and nothing crashed!

What happened:

- Gentoo appeared in the Boot Menu of the Bios!
- Loading the Gentoo entry led to a grub shell ("minimal bash-like line editing is supported...")
- I could boot the kernel with:
Code:
configfile (hd3,gpt1)/grub.cfg

- Kernel panic while booting:
Code:
unable to mount root fs on uknown-block(0,0)


So... a kernel problem?

My config:
http://i.imgur.com/eg38jMq.png

And everything under "Serial ATA and Parallel ATA drivers (libata)" is marked as built-in.

EDIT

This is from the grub.cfg - isnt it strange that the root fs /dev/sda2 is mounted read only?

Code:

        load_video
        insmod gzio
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt2'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  1fd808dd-9fba-4a3d-8b56-dea28a3fa419
        else
          search --no-floppy --fs-uuid --set=root 1fd808dd-9fba-4a3d-8b56-dea28a3fa419
        fi
        echo    'Loading Linux 4.5.1-gentoo ...'
        linux   /boot/vmlinuz-4.5.1-gentoo root=/dev/sda2 ro


EDIT2

Aaaaaaand its booting! :lol:
Now only this grub cfg thing to fix.
Back to top
View user's profile Send private message
axl
Guru
Guru


Joined: 11 Oct 2002
Posts: 536
Location: Romania

PostPosted: Thu Apr 21, 2016 9:55 am    Post subject: Reply with quote

no, it's not weird. I am glad u're doing fine. Congrats & enjoy
Back to top
View user's profile Send private message
vlynd
Tux's lil' helper
Tux's lil' helper


Joined: 23 Jan 2012
Posts: 123

PostPosted: Thu Apr 21, 2016 4:18 pm    Post subject: Reply with quote

Thanks for your help!

Just one last thing...

Everytime I boot gentoo I'm ending up in this grub shell ("grub minimal bash-like line editing is supported....").

I can boot the kernel with "configfile (hd3,gpt1)/grub.cfg"

But how can I fix this? I tried all kinds of grub2-install with differend parameters but it's just running into this shell every time I'm booting.
Back to top
View user's profile Send private message
axl
Guru
Guru


Joined: 11 Oct 2002
Posts: 536
Location: Romania

PostPosted: Thu Apr 21, 2016 4:21 pm    Post subject: Reply with quote

well. theoretically grub.conf should be in another place. since you are calling it from the root of the efi partition. it should have been on the linux partition, in dir /boot/grub/.

again, sda1 should have been mounted on /boot/efi. yours seems to remain mounted on /boot.
Back to top
View user's profile Send private message
vlynd
Tux's lil' helper
Tux's lil' helper


Joined: 23 Jan 2012
Posts: 123

PostPosted: Thu Apr 21, 2016 4:38 pm    Post subject: Reply with quote

/dev/sda1 is mounted to /boot/efi via fstab

I copied the grub.conf to /boot/grub/ now and rebooted, but I still end up in the grub shell.

EDIT

Just renamed grub.conf to grub.cfg and now everything works fine... lol!

THX 1000 times!
Back to top
View user's profile Send private message
axl
Guru
Guru


Joined: 11 Oct 2002
Posts: 536
Location: Romania

PostPosted: Thu Apr 21, 2016 4:40 pm    Post subject: Reply with quote

vlynd wrote:
/dev/sda1 is mounted to /boot/efi via fstab

I copied the grub.conf to /boot/grub/ now and rebooted, but I still end up in the grub shell.


hmmm. could you please post find /boot ?

also maybe the output from grub2-mkconfig -o /boot/grub/grub.conf and grub2-install /dev/sdc (i think it's sdc in your case).
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum