Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved]Unable to install bootloader
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
reikdas
Apprentice
Apprentice


Joined: 27 Nov 2018
Posts: 238

PostPosted: Fri Dec 21, 2018 10:18 am    Post subject: [Solved]Unable to install bootloader Reply with quote

Laptop - MSI-GS65 with Nvidia GTX 1070 Max Q
Architecture - AMD64

Goal - Dual booting Gentoo with Windows. (Windows is installed first)

I followed every instruction in the Gentoo installation handbook.
I did not change any hardware options while booting from the installation media. I did not do any extra hardware configuration.
I did not create a separate user.
I had a stable internet connection.

Current partitions (after installing Gentoo)
Partition table - GPT
Windows partitions-
sda1 - EFI boot partition
sda2 - C drive windows
sda3 - Recovery
sda4 - D drive windows
sda9 - BIOS
Linux partitions-
sda6 - BIOS_BOOT
sda7 - EFI boot partition
sda8 - swap
sda10 - / partition
Here 6, 7, 8 and 10 refer to 1, 2, 3 and 4 partitions from the Gentoo wiki.

Question - Do I need to create another EFI boot partition - sda7 here(considering there is one for windows)? Will doing so replace my windows bootloader?
Question - Do I need to create another BIOS_BOOT partition - sda6 here for Linux?

I made sure to replace sda1, sda2, sda3 and sda4 from the Gentoo wiki with sda6, sda7, sda8 and sda10 where required.

Profile - default/linux/amd64/17.0/systemd

Built kernel using genkernel.
I did not configure modules.
I installed firmware.

/etc/fstab was the same as in the handbook apart from sda6, sda7, etc in place of sda1, sda2, etc.

echo 'GRUB_PLATFORMS="efi-64"' >> /etc/portage/make.conf - Tried both with this and without.
emerge --ask sys-boot/grub:2
emerge --ask --update --newuse --verbose sys-boot/grub:2
I ran the above 3 in sequence. No error messages.

grub-install /dev/sda did not work.
grub-install --target=x86_64-efi --efi-directory=/boot -> Gave an error /boot doesn't look like an efi partition.
grub-install --target=x86_64-efi --efi-directory=/ -> Gave the error / doesn't look like an efi partition.
mount -o remount,rw /sys/firmware/efi/efivars was okay.
grub-install --target=x86_64-efi --efi-directory=/boot --removable -> Gave the error /boot doens't look like an efi partition.

I also installed os-prober in case it helped.

So I switched to efibootmgr-
emerge --ask sys-boot/efibootmgr
mkdir -p /boot/efi/boot
cp /boot/vmlinuz-* /boot/efi/boot/bootx64.efi -> Did not find a vmlinuz file in /boot so I copied the genkernel file.
efibootmgr --create --disk /dev/sda --part 7 --label "Gentoo" --loader "\efi\boot\bootx64.efi" -> 7 instead of 2 as mentioned above.
efibootmgr -c -d /dev/sda -p 2 -L "Gentoo" -l "\efi\boot\bootx64.efi" initrd='\initramfs-genkernel-amd64-3.16.5-gentoo' -> Replaced initrd with the correct initramfs file which I do not recall the name of and there is no way of accessing from Windows.

I rebooted my system. Did not work. Gave me an error of a grub conf file missing in /boot. I am also unable to see the Gentoo bootloader in the BIOS.
Question - Is there any way to boot into my gentoo system now that I do not have a working bootloader?

I am not sure how to make this work. Thoughts and suggestions?


Last edited by reikdas on Sat Dec 22, 2018 11:13 am; edited 1 time in total
Back to top
View user's profile Send private message
reikdas
Apprentice
Apprentice


Joined: 27 Nov 2018
Posts: 238

PostPosted: Fri Dec 21, 2018 10:49 am    Post subject: Chatroom comments Reply with quote

Some answers I got from the Gentoo IRC.

No need for a separate BIOS_BOOT partition.
Make sda1(the windows EFI partition), the /boot partition for Gentoo as well.
Back to top
View user's profile Send private message
Dwosky
Tux's lil' helper
Tux's lil' helper


Joined: 07 Nov 2018
Posts: 135

PostPosted: Fri Dec 21, 2018 11:40 am    Post subject: Reply with quote

If you can't make the actual configuration bootable, you can use a LiveCD/LiveUSB distribution (such as the Gentoo Installation or SystemRescueCD) to boot with that medium, then mount the needed filesystems and chroot to your local installation, that way you can tinker and update the needed items in order to make it work again.
Back to top
View user's profile Send private message
reikdas
Apprentice
Apprentice


Joined: 27 Nov 2018
Posts: 238

PostPosted: Fri Dec 21, 2018 12:53 pm    Post subject: Another attempt Reply with quote

So I tried installing Gentoo again.
This time I did not create a BIOS_BOOT partition. I did however create a separate /boot partition since I was afraid that the windows bootloader might get corrupted if I installed it in the same partition.
This time after updating the @world set, I ran a --depclean(I might be getting the command wrong) as recommended by the logs.

New issues-
When trying to emerge net-mis/netifrc I got the error log - [Blocks b] "sys-apps/sysvinit" is blocking sys-apps/systemd-239-r2
Also, rc-update is not working in this installation. I did emerge sys-apps/baselayout but rc-update still did not work.

The issue of the bootloader remains.


Dwosky wrote:
If you can't make the actual configuration bootable, you can use a LiveCD/LiveUSB distribution (such as the Gentoo Installation or SystemRescueCD) to boot with that medium, then mount the needed filesystems and chroot to your local installation, that way you can tinker and update the needed items in order to make it work again.


Thanks!
mount /dev/sda9 /mnt/gentoo
chroot /mnt/gentoo
lets me get back into it!
Back to top
View user's profile Send private message
ali3nx
l33t
l33t


Joined: 21 Sep 2003
Posts: 722
Location: Winnipeg, Canada

PostPosted: Fri Dec 21, 2018 3:07 pm    Post subject: Reply with quote

Quote:
Question - Do I need to create another EFI boot partition - sda7 here(considering there is one for windows)?


efi partitions there should only be one per disk. this is generally a uefi bios specification.

If your having any difficulties configuring your system for "dual booting" and your laptop has a spot to add a second disk it can be more reliable because windows updates can delete your linux bootloader entries in the uefi bios or the bios boot binary unrelated to windows that exists in the esa partition and it can be much more simple to use separate disks for dual booting with uefi.

Windows is generally "uncool" when using traditional dual boot setups on a single disk when update time comes.

uefi bios is however able to accommodate multiple esa efi partitions existing on multiple disks.


Something you might consider.
_________________
Compiling Gentoo since version 1.4
Thousands of Gentoo Installs Completed
Emerged on every continent but Antarctica
Compile long and Prosper!
Back to top
View user's profile Send private message
reikdas
Apprentice
Apprentice


Joined: 27 Nov 2018
Posts: 238

PostPosted: Fri Dec 21, 2018 3:47 pm    Post subject: Reply with quote

ali3nx wrote:
Quote:
Question - Do I need to create another EFI boot partition - sda7 here(considering there is one for windows)?


efi partitions there should only be one per disk. this is generally a uefi bios specification.


Is there any chance of the windows bootloader being overwritten?

ali3nx wrote:
If your having any difficulties configuring your system for "dual booting" and your laptop has a spot to add a second disk it can be more reliable because windows updates can delete your linux bootloader entries in the uefi bios or the bios boot binary unrelated to windows that exists in the esa partition and it can be much more simple to use separate disks for dual booting with uefi.

Windows is generally "uncool" when using traditional dual boot setups on a single disk when update time comes.

uefi bios is however able to accommodate multiple esa efi partitions existing on multiple disks.


Something you might consider.


Would it be safe to have the bootloaders on separate disks but the partitions for one operating system be spread out over both the disks?
Back to top
View user's profile Send private message
ali3nx
l33t
l33t


Joined: 21 Sep 2003
Posts: 722
Location: Winnipeg, Canada

PostPosted: Fri Dec 21, 2018 4:06 pm    Post subject: Reply with quote

My simplified uefi disk partitioning guide from the forums may offer some useful fundamental perspective to aid with considering what could work for your laptop.

https://forums.gentoo.org/viewtopic-t-1088630.html

Quote:
Is there any chance of the windows bootloader being overwritten?


This technically is possible because of how uefi bios boot capabilities function, efivars filesystem and efibootmgr. microsoft has their own implementation of efivars filesystem and efibootmgr that more often than not considers any other boot entry for a second operating system that exists within the esa partition on the same disk as a windows OS install "hostile or irrelevant"

with uefi bios the bootloader is not the MBR on the disk but rather the file that exists on the esa partition and the uefi firmware entry to represent that file used to boot the kernel or boot the entire OS in the case of using efistub kernels.

Quote:
Would it be safe to have the bootloaders on separate disks but the partitions for one operating system be spread out over both the disks?


modern era "dual boot" using uefi bios by providing each OS you want to use it's own separate disk is just far easier to use and reliable considering windows has a nasty habit of being a bad inconsiderate neighbor when sharing a disk with another OS install.

Generally most users with "dual boot" setup would rarely have more than two OS installs in a single pc so this works great most of the time.
_________________
Compiling Gentoo since version 1.4
Thousands of Gentoo Installs Completed
Emerged on every continent but Antarctica
Compile long and Prosper!
Back to top
View user's profile Send private message
reikdas
Apprentice
Apprentice


Joined: 27 Nov 2018
Posts: 238

PostPosted: Fri Dec 21, 2018 6:20 pm    Post subject: Reply with quote

Installing the bootloader on the Windows EFI boot partition worked!
I can safely boot into Gentoo.
Thanks.
Back to top
View user's profile Send private message
ali3nx
l33t
l33t


Joined: 21 Sep 2003
Posts: 722
Location: Winnipeg, Canada

PostPosted: Fri Dec 21, 2018 6:28 pm    Post subject: Reply with quote

reikdas wrote:
Installing the bootloader on the Windows EFI boot partition worked!
I can safely boot into Gentoo.
Thanks.


Your welcome and Happy Holidays :)
_________________
Compiling Gentoo since version 1.4
Thousands of Gentoo Installs Completed
Emerged on every continent but Antarctica
Compile long and Prosper!
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