Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] Troubleshooting - grub not loading on 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
djentoo
n00b
n00b


Joined: 17 Oct 2017
Posts: 37

PostPosted: Wed Apr 04, 2018 8:36 am    Post subject: [solved] Troubleshooting - grub not loading on boot Reply with quote

Edited from original post. I am trying to install Gentoo on a Samsung Chronos 7 with the minimal install disc. It has an Intel i7, so I am following the amd64 handbook. As of now, it is partitioned and the system is installed, but GRUB is not booting and therefore the kernel is not loading. After toying around with BIOS options to ensure it wasn't a Secureboot problem (this is a UEFI system), I gave it a rest. The ubuntu fairy farted on it while I was asleep and now it will not boot or read the minimal install disc - either USB or DVD format. It also corrupted my USB ISO. Now it will work with a liveCD of Gentoo or Mint. Please help me to understand these issues and complete the installation!

Prepared the disks - I made a mistake by adding a bios boot as seen in the tutorial and later removed it.
Quote:
/dev/sda2 - boot 128mb FAT32
/dev/sda3 - swap 512mb
/dev/sda4 - rootfs 100gb ext4
/dev/sda5 - home 500gb ext4


Installed the stage3-amd64-20180325T214502Z.tar.xz tarball.

Mounted proc and other fs and chrooted to the mounted partition with unpacked tarball. Mounted /boot. Performed the emerge steps.

  • Profile: [25] default/linux/amd64/17.0/systemd (stable) (I do not know which DE to go with yet)
  • I completed all the other steps in installing the base system.
  • I chose not to configure the kernel and compiled genkernel instead, and I generated an initramfs, which is in /boot. (you can see fstab below)
  • I skipped the module configuration.
  • I configured the fstab and reviewed blkid. I did not spend much time here.
  • I set up a wired connection and added it to init.d.
  • I set up the root passwd.
  • I skipped installing tools and software for now.
  • I followed the steps for GRUB2:

Code:
echo 'GRUB_PLATFORMS="efi-64"' >> /etc/portage/make.conf
emerge --ask sys-boot/grub:2
grub-install --target=x86_64-efi --efi-directory=/boot

It did not boot, so I posted, and I attempted the recommendations by P Kosunen. I hope I followed correctly; steps completed:
Code:
mounte /dev/sda4 /mnt/gentoo && mount /dev/sda4 /mnt/gentoo
rm -R /grub # old grubx64.efi installation
grub-install --target=x86_64-efi --efi-directory=/boot/efi #output lines of "device node not found", but it said installation completed with no problems

There is an extra EFI directory; /boot/EFI/EFI/gentoo/grubx64.efi.
I think I misunderstood a step. Was I supposed to instead mount /dev/sda to /boot/EFI, rather than /boot?


Last edited by djentoo on Thu Apr 05, 2018 3:47 pm; edited 15 times in total
Back to top
View user's profile Send private message
P.Kosunen
Guru
Guru


Joined: 21 Nov 2005
Posts: 309
Location: Finland

PostPosted: Wed Apr 04, 2018 11:17 am    Post subject: Reply with quote

I would recommend mounting EFI partition to /mnt/gentoo/boot/efi after root is mounted to /mnt/gentoo, so only grubx64.fi file goes to EFI partition, kernels and grub modules etc stays on root partition.

https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Bootloader#Install

Code:
grub-install --target=x86_64-efi --efi-directory=/boot/efi


After this you should have only /EFI/gentoo/grubx64.efi file in EFI partition, it can load config from your root partition.
Back to top
View user's profile Send private message
djentoo
n00b
n00b


Joined: 17 Oct 2017
Posts: 37

PostPosted: Wed Apr 04, 2018 2:39 pm    Post subject: Reply with quote

Thanks, I will try this. I am now having trouble getting the install USB to boot like before. The computer is reading that all boot options have been tried even though it is recognizing the boot USB device in the option! I am not sure what happened. I have verified the USB boot works on another computer and I have gone in to reset UEFI settings to default and disabled secure boot again... hopefully resetting CMOS will fix the problem. Any ideas?
Back to top
View user's profile Send private message
djentoo
n00b
n00b


Joined: 17 Oct 2017
Posts: 37

PostPosted: Wed Apr 04, 2018 9:24 pm    Post subject: Reply with quote

P.Kosunen wrote:
I would recommend mounting EFI partition to /mnt/gentoo/boot/efi after root is mounted to /mnt/gentoo, so only grubx64.fi file goes to EFI partition, kernels and grub modules etc stays on root partition.

https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Bootloader#Install

Code:
grub-install --target=x86_64-efi --efi-directory=/boot/efi


After this you should have only /EFI/gentoo/grubx64.efi file in EFI partition, it can load config from your root partition.


Okay, we have some other problems.
My USB boot was no longer readable by my other Linux machine. Not sure what happened. I can still format it, but it is now read only.
The target computer will not boot the minimal install disc period - whether USB or DVD. It does not even recognize it. I think this is something to do with UEFI/GPT??
It will run Linux Mint Live CD and Gentoo Live CD. I presume it will also load with other live CDs. Why not the minimal install disc, though?
I used the Linux Mint Live CD to mount /dev/sda4 onto /mnt/gentoo and /dev/sda2 to boot. I followed your instructions to install GRUB, and then I removed /boot/gentoo recursively. I verified the /EFI/gentoo/grubx64.efi was there. When I installed GRUB, I got several output lines of "device node not found", but it said installation completed with no problems.

After all that, it still did not boot GRUB. It won't read the Gentoo Live USB, but it will read the DVD. I would like to know what is going on though, to ensure that I did not fry my BIOS and need to reflash it or something.
Back to top
View user's profile Send private message
djentoo
n00b
n00b


Joined: 17 Oct 2017
Posts: 37

PostPosted: Wed Apr 04, 2018 10:18 pm    Post subject: Reply with quote

OK, I am now logged in Gentoo liveCD and posting from there. Here is some output below that may be useful in determining what the problem is. Looking at /boot, it seems I need to move /gentoo/grubx64.efi to /boot/EFI and remove /boot/EFI/EFI. Correct? Not sure what else it may be. Please have a look at the directory lists, fstab, and blkid output.

Code:
gentoo@livecd ~ $ sudo passwd root
New password:
Retype new password:
passwd: password updated successfully
gentoo@livecd ~ $ sudo login root
Password:
Last login: Thu Feb 11 17:44:17 UTC 2016 on pts/1

livecd ~ # mount /dev/sda4 /mnt/gentoo
livecd ~ # mount /dev/sda2 /mnt/gentoo/boot
livecd ~ # chroot /mnt/gentoo
livecd / # ls
bin   etc   lib32       media  proc  sbin                                  tmp
boot  home  lib64       mnt    root  stage3-amd64-20180325T214502Z.tar.xz  usr
dev   lib   lost+found  opt    run   sys                                   var
livecd / # ls -R /boot
/boot:
EFI  grub  initramfs-genkernel-x86_64-4.9.76-gentoo-r1

/boot/EFI:
EFI

/boot/EFI/EFI:
gentoo

/boot/EFI/EFI/gentoo:
Code:
grubx64.efi

/boot/grub:
fonts  grub.cfg  grubenv  locale  themes  x86_64-efi

/boot/grub/fonts:
unicode.pf2

/boot/grub/locale:
ast.mo        de_CH.mo        en@piglatin.mo  fr.mo  it.mo  nl.mo     sl.mo  vi.mo
ca.mo         en@arabic.mo    en@quot.mo      gl.mo  ja.mo  pa.mo     sr.mo  zh_CN.mo
da.mo         en@cyrillic.mo  eo.mo           hr.mo  ko.mo  pl.mo     sv.mo  zh_TW.mo
de.mo         en@greek.mo     es.mo           hu.mo  lt.mo  pt_BR.mo  tr.mo
de@hebrew.mo  en@hebrew.mo    fi.mo           id.mo  nb.mo  ru.mo     uk.mo

/boot/grub/themes:
starfield

/boot/grub/themes/starfield:
COPYING.CC-BY-SA-3.0  boot_menu_s.png   dejavu_bold_14.pf2  terminal_box_ne.png
README                boot_menu_se.png  slider_c.png        terminal_box_nw.png
blob_w.png            boot_menu_sw.png  slider_n.png        terminal_box_s.png
boot_menu_c.png       boot_menu_w.png   slider_s.png        terminal_box_se.png
boot_menu_e.png       dejavu_10.pf2     starfield.png       terminal_box_sw.png
boot_menu_n.png       dejavu_12.pf2     terminal_box_c.png  terminal_box_w.png
boot_menu_ne.png      dejavu_14.pf2     terminal_box_e.png  theme.txt
boot_menu_nw.png      dejavu_16.pf2     terminal_box_n.png

/boot/grub/x86_64-efi:
acpi.mod              gcry_tiger.mod            part_sun.mod
adler32.mod           gcry_twofish.mod          part_sunpc.mod
affs.mod              gcry_whirlpool.mod        partmap.lst
afs.mod               geli.mod                  parttool.lst
ahci.mod              gettext.mod               parttool.mod
all_video.mod         gfxmenu.mod               password.mod
aout.mod              gfxterm.mod               password_pbkdf2.mod
appleldr.mod          gfxterm_background.mod    pata.mod
archelp.mod           gfxterm_menu.mod          pbkdf2.mod
at_keyboard.mod       gptsync.mod               pbkdf2_test.mod
ata.mod               grub.efi                  pcidump.mod
backtrace.mod         gzio.mod                  play.mod
bfs.mod               halt.mod                  png.mod
bitmap.mod            hashsum.mod               priority_queue.mod
bitmap_scale.mod      hdparm.mod                probe.mod
blocklist.mod         hello.mod                 procfs.mod
boot.mod              help.mod                  progress.mod
bsd.mod               hexdump.mod               raid5rec.mod
bswap_test.mod        hfs.mod                   raid6rec.mod
btrfs.mod             hfsplus.mod               random.mod
bufio.mod             hfspluscomp.mod           read.mod
cat.mod               http.mod                  reboot.mod
cbfs.mod              iorw.mod                  regexp.mod
cbls.mod              iso9660.mod               reiserfs.mod
cbmemc.mod            jfs.mod                   relocator.mod
cbtable.mod           jpeg.mod                  romfs.mod
cbtime.mod            keylayouts.mod            scsi.mod
chain.mod             keystatus.mod             search.mod
cmdline_cat_test.mod  ldm.mod                   search_fs_file.mod
cmp.mod               legacy_password_test.mod  search_fs_uuid.mod
cmp_test.mod          legacycfg.mod             search_label.mod
command.lst           linux.mod                 serial.mod
configfile.mod        linux16.mod               setjmp.mod
core.efi              loadbios.mod              setjmp_test.mod
cpio.mod              loadenv.mod               setpci.mod
cpio_be.mod           loopback.mod              sfs.mod
cpuid.mod             ls.mod                    shift_test.mod
crc64.mod             lsacpi.mod                signature_test.mod
crypto.lst            lsefi.mod                 sleep.mod
crypto.mod            lsefimmap.mod             sleep_test.mod
cryptodisk.mod        lsefisystab.mod           spkmodem.mod
cs5536.mod            lsmmap.mod                squash4.mod
ctz_test.mod          lspci.mod                 syslinuxcfg.mod
date.mod              lssal.mod                 tar.mod
datehook.mod          luks.mod                  terminal.lst
datetime.mod          lvm.mod                   terminal.mod
disk.mod              lzopio.mod                terminfo.mod
diskfilter.mod        macbless.mod              test.mod
div.mod               macho.mod                 test_blockarg.mod
div_test.mod          mdraid09.mod              testload.mod
dm_nv.mod             mdraid09_be.mod           testspeed.mod
echo.mod              mdraid1x.mod              tftp.mod
efi_gop.mod           memdisk.mod               tga.mod
efi_uga.mod           memrw.mod                 time.mod
efifwsetup.mod        minicmd.mod               tr.mod
efinet.mod            minix.mod                 trig.mod
ehci.mod              minix2.mod                true.mod
elf.mod               minix2_be.mod             udf.mod
eval.mod              minix3.mod                ufs1.mod
exfat.mod             minix3_be.mod             ufs1_be.mod
exfctest.mod          minix_be.mod              ufs2.mod
ext2.mod              mmap.mod                  uhci.mod
extcmd.mod            moddep.lst                usb.mod
fat.mod               modinfo.sh                usb_keyboard.mod
file.mod              morse.mod                 usbms.mod
fixvideo.mod          mpi.mod                   usbserial_common.mod
font.mod              msdospart.mod             usbserial_ftdi.mod
fs.lst                mul_test.mod              usbserial_pl2303.mod
fshelp.mod            multiboot.mod             usbserial_usbdebug.mod
functional_test.mod   multiboot2.mod            usbtest.mod
gcry_arcfour.mod      nativedisk.mod            verify.mod
gcry_blowfish.mod     net.mod                   video.lst
gcry_camellia.mod     newc.mod                  video.mod
gcry_cast5.mod        nilfs2.mod                video_bochs.mod
gcry_crc.mod          normal.mod                video_cirrus.mod
gcry_des.mod          ntfs.mod                  video_colors.mod
gcry_dsa.mod          ntfscomp.mod              video_fb.mod
gcry_idea.mod         odc.mod                   videoinfo.mod
gcry_md4.mod          offsetio.mod              videotest.mod
gcry_md5.mod          ohci.mod                  videotest_checksum.mod
gcry_rfc2268.mod      part_acorn.mod            xfs.mod
gcry_rijndael.mod     part_amiga.mod            xnu.mod
gcry_rmd160.mod       part_apple.mod            xnu_uuid.mod
gcry_rsa.mod          part_bsd.mod              xnu_uuid_test.mod
gcry_seed.mod         part_dfly.mod             xzio.mod
gcry_serpent.mod      part_dvh.mod              zfs.mod
gcry_sha1.mod         part_gpt.mod              zfscrypt.mod
gcry_sha256.mod       part_msdos.mod            zfsinfo.mod
gcry_sha512.mod       part_plan.mod

livecd / # cat /etc/fstab
Code:
# comments edited out

/dev/sda2       /boot           vfat    defaults,noatime        0 2
/dev/sda3       none            swap    sw                      0 0
/dev/sda4       /               ext4    noatime                 0 1
/dev/sda5       /               ext4    noatime                 0 1

/dev/cdrom      /mnt/cdrom      auto    noauto,ro               0 0

livecd / # blkid
Code:
/dev/sda2: UUID="5F0D-F0BD" TYPE="vfat"
/dev/sda3: UUID="05467a8b-5e29-47d9-91b8-a376ce589a10" TYPE="swap"
/dev/sda4: UUID="62888c3d-8112-44d1-86fd-cd8ed32f86f5" TYPE="ext4"
/dev/sda5: UUID="5ad5f364-9b0a-4616-84c9-1f9b971030d0" TYPE="ext4"
livecd / #


[Moderator edit: added [code] tags to preserve output layout. -Hu]
Back to top
View user's profile Send private message
P.Kosunen
Guru
Guru


Joined: 21 Nov 2005
Posts: 309
Location: Finland

PostPosted: Thu Apr 05, 2018 11:14 am    Post subject: Reply with quote

Use SystemRescueCD for install, it is UEFI and Gentoo compatible.
Back to top
View user's profile Send private message
djentoo
n00b
n00b


Joined: 17 Oct 2017
Posts: 37

PostPosted: Thu Apr 05, 2018 3:46 pm    Post subject: Reply with quote

P.Kosunen wrote:
Use SystemRescueCD for install, it is UEFI and Gentoo compatible.


Thank you. This is what I decided to do last night. I am marking this thread as solved because I started over. Everything is going much more smoothly, but taking longer because I went with a larger profile.
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