Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
(SOLVED) EFI Newbie, Grub Won't Boot
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
sdz
n00b
n00b


Joined: 26 Sep 2011
Posts: 24

PostPosted: Sat Mar 25, 2017 6:41 pm    Post subject: (SOLVED) EFI Newbie, Grub Won't Boot Reply with quote

I am attempting to install Gentoo on a new 3TB hard drive. I have run Gentoo for years with grub, MBR, and BIOS boot without issue.

  • I thought I followed all of the Gentoo Handbook instructions correctly.
  • The partition structure is GPT
  • I have an ext2 /boot partition and a fat32 GPT partition
  • All commands output without error
  • For boot, my BIOS is set to AUTO (MBR or GPT)

Code:

(chroot) livecd linux # ls -A /boot
(chroot) livecd linux # ls -A /mnt/efi
(chroot) livecd linux # make install
sh ./arch/x86/boot/install.sh 4.9.16-gentoo arch/x86/boot/bzImage \
        System.map "/boot"
(chroot) livecd linux # echo $?
0
(chroot) livecd linux # make modules_install
  INSTALL crypto/echainiv.ko
  INSTALL drivers/thermal/x86_pkg_temp_thermal.ko
  INSTALL net/ipv4/netfilter/ipt_MASQUERADE.ko
  INSTALL net/ipv4/netfilter/iptable_nat.ko
  INSTALL net/ipv4/netfilter/nf_log_arp.ko
  INSTALL net/ipv4/netfilter/nf_log_ipv4.ko
  INSTALL net/ipv4/netfilter/nf_nat_masquerade_ipv4.ko
  INSTALL net/ipv6/netfilter/ip6_tables.ko
  INSTALL net/ipv6/netfilter/ip6t_REJECT.ko
  INSTALL net/ipv6/netfilter/ip6t_ipv6header.ko
  INSTALL net/ipv6/netfilter/ip6table_filter.ko
  INSTALL net/ipv6/netfilter/ip6table_mangle.ko
  INSTALL net/ipv6/netfilter/nf_conntrack_ipv6.ko
  INSTALL net/ipv6/netfilter/nf_defrag_ipv6.ko
  INSTALL net/ipv6/netfilter/nf_log_ipv6.ko
  INSTALL net/ipv6/netfilter/nf_reject_ipv6.ko
  INSTALL net/netfilter/nf_log_common.ko
  INSTALL net/netfilter/xt_addrtype.ko
  INSTALL net/netfilter/xt_nat.ko
  DEPMOD  4.9.16-gentoo
(chroot) livecd linux # echo $?
0
(chroot) livecd linux # fdisk /dev/sda

Welcome to fdisk (util-linux 2.28.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/sda: 2.7 TiB, 3000592982016 bytes, 5860533168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt

Device      Start        End    Sectors  Size Type
/dev/sda1    2048      67583      65536   32M BIOS boot
/dev/sda2   67584     329727     262144  128M EFI System
/dev/sda3  329728 5860532223 5860202496  2.7T Linux filesystem

Command (m for help): q

(chroot) livecd linux # df -T | grep sda
/dev/sda3      ext4     2883059904 3272112 2733266348   1% /
/dev/sda1      ext2          31729   22932       7159  77% /boot
/dev/sda2      vfat         129039     122     128918   1% /mnt/efi
(chroot) livecd linux # grub-install --target=x86_64-efi --efi-directory=/mnt/efi --boot-directory=/boot
Installing for x86_64-efi platform.
Installation finished. No error reported.
(chroot) livecd linux # grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.9.16-gentoo
done
(chroot) livecd linux #


When I boot to the hard drive, BIOS outputs "Loading Operating System..." then hangs.

What am I doing wrong? What should I try next?


Last edited by sdz on Sun Mar 26, 2017 7:10 pm; edited 1 time in total
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 5879

PostPosted: Sat Mar 25, 2017 8:27 pm    Post subject: Reply with quote

First try to see if you can boot the kernel directly. Make sure the kernel config has EFI Stub enabled and root=/dev/sda3 in the built-in command line, build it and copy vmlinuz to /mnt/efi/boot/bootx64.efi. It should show up in the firmware boot menu automatically.
Back to top
View user's profile Send private message
sdz
n00b
n00b


Joined: 26 Sep 2011
Posts: 24

PostPosted: Sun Mar 26, 2017 12:27 am    Post subject: Reply with quote

No change. I still only see "Loading Operating System..." when booting from the HDD.

I enabled the kernel stub option, added the kernel command line option, make, make install, copied the kernel to /mnt/efi/boot/bootx64.efi, reran grub-install (as above), reran grub-mkconfig (as above).

Note: "Loading Operating System..." also shows when booting from the Gentoo LiveDVD before it continues, so I know that message is from the BIOS.

Also, I don't see anything about firmware boot.
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Sun Mar 26, 2017 12:49 am    Post subject: Reply with quote

Hi.

I think boot has to be vfat!

Code:
Number  Start   End     Size    File system  Name  Flags
 1      1049kB  3146kB  2097kB               grub  bios_grub
 2      3146kB  137MB   134MB   fat16        boot  boot, esp
 3      137MB   120GB   120GB                      lvm


Code:
/dev/sda2 on /boot type vfat (rw,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)


I suggest you reformat and redo your boot to vfat first please


afaik: uefi bios => gpt partition table, layout from gentoo handbook. 3rd partition can be anything when boot is properly setup.
Back to top
View user's profile Send private message
sdz
n00b
n00b


Joined: 26 Sep 2011
Posts: 24

PostPosted: Sun Mar 26, 2017 7:17 pm    Post subject: Reply with quote

I solved the issue by flashing the latest beta BIOS for my Gigabyte Z68A-D3-B3 motherboard (which was a huge headache in itself). The earlier BIOS (version F11) only supported EFI on DVD drives.

Thank you both for your assistance.
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
Page 1 of 1

 
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