Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Dualbooting with FreeBSD using EFI & GRUB2
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
apz
n00b
n00b


Joined: 21 Jul 2016
Posts: 6

PostPosted: Thu Jul 21, 2016 6:59 am    Post subject: Dualbooting with FreeBSD using EFI & GRUB2 Reply with quote

Hi,

I would like to set-up new Gentoo system alongside already existing FreeBSD on EFI disk.

This is my current disk layout:
/dev/sda1 EFI System 200MB
/dev/sda2 FreeBSD
/dev/sda3 FreeBSD swap

Before commiting to installation I would like to confirm that my approach would be correct:
1. Leave sda1 untouched and do not create separate linux EFI system /boot partition
2. Mount /dev/sda1 as /boot/efi and put /dev/sda1 /boot/efi vfat noauto,noauto to /etc/fstab
3. after system installation, set-up GRUB2 with grub2-install --target=x86_64-efi --efi-directory=/boot/efi, as specified in the handbook

My understanding is that this will just copy additional files into /boot/efi and not replace its contents, which will in turn allow me to easly set-up dual boot with FreeBSD.
Please let me know if this isn't correct.
Thanks.
Back to top
View user's profile Send private message
renee77
n00b
n00b


Joined: 21 Jun 2016
Posts: 12
Location: Tilburg

PostPosted: Thu Jul 21, 2016 11:09 am    Post subject: Re: Dualbooting with FreeBSD using EFI & GRUB2 Reply with quote

apz wrote:
Hi,

I would like to set-up new Gentoo system alongside already existing FreeBSD on EFI disk.

This is my current disk layout:
/dev/sda1 EFI System 200MB
/dev/sda2 FreeBSD
/dev/sda3 FreeBSD swap

Before commiting to installation I would like to confirm that my approach would be correct:
1. Leave sda1 untouched and do not create separate linux EFI system /boot partition
2. Mount /dev/sda1 as /boot/efi and put /dev/sda1 /boot/efi vfat noauto,noauto to /etc/fstab
3. after system installation, set-up GRUB2 with grub2-install --target=x86_64-efi --efi-directory=/boot/efi, as specified in the handbook

My understanding is that this will just copy additional files into /boot/efi and not replace its contents, which will in turn allow me to easly set-up dual boot with FreeBSD.
Please let me know if this isn't correct.
Thanks.


Hi there,

You are correct, worst case they can become a xx.old file. You can safeguard your install by backing up your bootpartition to be on the extra save side. and copy them back in case of disapearance. This can happen when your boot partition has a bootx64.efi file instead of a bsd.efi file or directory. Same aplies for config and posibly initramfs.

gl, Eva
Back to top
View user's profile Send private message
apz
n00b
n00b


Joined: 21 Jul 2016
Posts: 6

PostPosted: Thu Jul 21, 2016 11:45 am    Post subject: Re: Dualbooting with FreeBSD using EFI & GRUB2 Reply with quote

renee77 wrote:
apz wrote:
Hi,

I would like to set-up new Gentoo system alongside already existing FreeBSD on EFI disk.

This is my current disk layout:
/dev/sda1 EFI System 200MB
/dev/sda2 FreeBSD
/dev/sda3 FreeBSD swap

Before commiting to installation I would like to confirm that my approach would be correct:
1. Leave sda1 untouched and do not create separate linux EFI system /boot partition
2. Mount /dev/sda1 as /boot/efi and put /dev/sda1 /boot/efi vfat noauto,noauto to /etc/fstab
3. after system installation, set-up GRUB2 with grub2-install --target=x86_64-efi --efi-directory=/boot/efi, as specified in the handbook

My understanding is that this will just copy additional files into /boot/efi and not replace its contents, which will in turn allow me to easly set-up dual boot with FreeBSD.
Please let me know if this isn't correct.
Thanks.


Hi there,

You are correct, worst case they can become a xx.old file. You can safeguard your install by backing up your bootpartition to be on the extra save side. and copy them back in case of disapearance. This can happen when your boot partition has a bootx64.efi file instead of a bsd.efi file or directory. Same aplies for config and posibly initramfs.

gl, Eva


I haven't dealt with EFI and multiboot before, so just wanted to make sure - good to know I wasn't totally incorrect.
I'll definietly do that backup before starting though. Thanks!

-Artur
Back to top
View user's profile Send private message
apz
n00b
n00b


Joined: 21 Jul 2016
Posts: 6

PostPosted: Thu Jul 21, 2016 7:17 pm    Post subject: Reply with quote

Ok, so I've tried the aforementioned approach and it didin't work.
Gentoo installation does finish without any problems, but the system boots into FreeBSD directly.

Any ideas?
Back to top
View user's profile Send private message
renee77
n00b
n00b


Joined: 21 Jun 2016
Posts: 12
Location: Tilburg

PostPosted: Thu Jul 21, 2016 7:56 pm    Post subject: Reply with quote

are you using a xx.efi, an initramfs or both? Can you give a bit more detail on what you've done to make gentoo install through efi? for example did you use an initramfs?

You could also look into grub, you can set the given time to choose between both of them. I am not using grub only booting in efi without bootloader, there it works.
Back to top
View user's profile Send private message
apz
n00b
n00b


Joined: 21 Jul 2016
Posts: 6

PostPosted: Thu Jul 21, 2016 9:10 pm    Post subject: Reply with quote

renee77 wrote:
are you using a xx.efi, an initramfs or both? Can you give a bit more detail on what you've done to make gentoo install through efi? for example did you use an initramfs?

You could also look into grub, you can set the given time to choose between both of them. I am not using grub only booting in efi without bootloader, there it works.


I guess I'm using both .efi and initramfs since apart from the steps from my 1st post I've used genkernel (with additional options added through --menuconfig).
The problem with grub is that it doesn't take part in the boot process, so I can't really enter its command line - the default FreeBSD loader starts instead.
Back to top
View user's profile Send private message
apz
n00b
n00b


Joined: 21 Jul 2016
Posts: 6

PostPosted: Fri Jul 22, 2016 3:45 pm    Post subject: Reply with quote

Update:

/dev/sda1 (efi system) contains
EFI/
BOOTX.efi
STARTUP.NSH
gentoo/grubx.efi

STARTUP.NSH contains only one line: BOOTX.efi

I've changed it to grubx.efi and copied grubx.efi to the main folder (EFI), but still the same - FreeBSD loader fires up.
Back to top
View user's profile Send private message
apz
n00b
n00b


Joined: 21 Jul 2016
Posts: 6

PostPosted: Sat Jul 23, 2016 3:57 pm    Post subject: Reply with quote

Ok, so I've managed to solve the issue.

Turns out the Gentoo minimal cd cannot boot into uefi mode, and since I had both (uefi and legacy) set in BIOS, it booted into legacy mode.
In legacy mode, even though I had manually included the necessary EFI options into kernel config, the kernel still needs efivars to compile properly, and those are only mounted automatically when booted in pure uefi mode.
After downloading and booting Live DVD in pure uefi mode and following the handbook, I was sucessfully able to boot into Gentoo using Grub menu and add FreeBSD entry.
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