Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Gentoo Dual Boot on UEFI
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
Eumcoz
n00b
n00b


Joined: 10 Jul 2014
Posts: 4

PostPosted: Thu Jul 10, 2014 2:28 pm    Post subject: Gentoo Dual Boot on UEFI Reply with quote

Hey all,

I am trying to dual boot windows 8 and gentoo. I have a UEFI laptop, and found this guide: http://wiki.gentoo.org/wiki/UEFI_Dual_boot_with_Windows_7/8 I followed the guide and everything seems to have installed correctly, but my refind won't see my gentoo install. I can use the uefi bootable media to load the OS through refind. Does anyone know of a way to get refind to see the partition itself instead of having to use the bootable media to do it?

Thank you
Back to top
View user's profile Send private message
Telemin
l33t
l33t


Joined: 25 Aug 2005
Posts: 680
Location: Glasgow, UK

PostPosted: Thu Jul 10, 2014 4:04 pm    Post subject: Reply with quote

Hi there,

Unfortunately I found that wiki article didn;t work for me either and I did things the grub2 way, which unless you have a reason to use refind I would be inclined to encourage, since it is the most commonly used bootloader by the linux community and hence best supported.

I am typing this from a machine that boots in UEFI mode without needing refind at all. Just GRUB2 booting to either windows or gentoo.

I achieve this as follows:

Boot (EFI capable) livecd make a partition table like this:

Code:

Partition table (GPT of course):
/dev/sda1: EFI partition, mounted at /boot/efi  FAT32 ~500MiB, set type as EF00 in gdisk etc
/dev/sda2: NTFS windows partion
/dev/sda3: SWAP
/dev/sda4: Gentoo BTRFS partition


Now install windows to /dev/sda2 and because you have already created an EFIBOOT partition with special type EF00 it will use it.

Reboot to gentoo livecd, install gentoo as normal

Now emerge grub2 with GRUB_PLATFORMS="efi-64" and be sure to install os-prober too to detect windows partitions

Then simply running grub2-install /dev/sda should take care of the grub install and

grub2-mkconfig -o /boot/grub/grub.cfg will create a config that allows you to boot to either gentoo or windows.

Hopefully that makes some sense to you?

Take a look at the GRUB2 wiki article also http://wiki.gentoo.org/wiki/GRUB2, as it is very thorough and well written.

-Telemin-
_________________
The Geek formerly known as -Freestyling-
When you feel your problem has been solved please add [Solved] to the topic title.
Please adopt an unanswered post
Back to top
View user's profile Send private message
Eumcoz
n00b
n00b


Joined: 10 Jul 2014
Posts: 4

PostPosted: Thu Jul 10, 2014 4:31 pm    Post subject: Reply with quote

Hello,

I guess my case is slightly different, but maybe still workable with Grub2. My setup is as follows:

Code:
/dev/sda - Windows 8(already installed, would like to keep it as is)

/dev/sdb - Gentoo(currently installed as per articles installation, I can add/change/remove it, no data currently on it)
/dev/sdb1- boot partition -100M
/dev/sdb2- swap partition -32G
/dev/sdb3- remaining data partition -900G


I have two physical disks, I would like to use 1 per OS.

The reason I was using refind was because I saw for a UEFI system that it was the easiest/safest bet. I thought I also read somewhere that grub and windows 8 do not play well, I forget the reason exactly, but it was basically suggested to used a EFI bootloader like refind, or I may run into data loss problems on windows updates. I can't seem to locate the articles I was looking at, but perhaps they were old, and those problems have been fixed now. Would you have any suggestions to get grub2 setup with my already installed windows partition?
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 6737
Location: Goose Creek SC

PostPosted: Thu Jul 10, 2014 6:11 pm    Post subject: Reply with quote

moved
_________________
Defund the FCC.


Last edited by DONAHUE on Thu Jul 10, 2014 6:12 pm; edited 1 time in total
Back to top
View user's profile Send private message
ct85711
Apprentice
Apprentice


Joined: 27 Sep 2005
Posts: 274

PostPosted: Thu Jul 10, 2014 6:11 pm    Post subject: Reply with quote

I thought I would mentioned, I just went through and installed windows7 and gentoo recently doing UEFI boot mode. I first installed gentoo, and had that booting through UEFI using grub2. Afterwards, I installed windows 7 (in UEFI, have to use a usb boot to get the installer to do UEFI). Once the windows installer was going in UEFI, it installed perfectly fine right along my Gentoo. I noticed, if windows installer is loaded in msdos (the old partition system), the installer throws a fit if it sees a linux system. However, the UEFI des not care, it'll automaticaly add the windows boot stuff in the correct partition for UEFI if that's already setup (doesn't matter if that partition is on a seperate disk). The only thing I had to do afterwards, was change my bios to load the linux UEFI instead of windows (did not have to reinstall grub at all), and once I got back in gentoo, ran the mkconfig again to add the windows option into my grub config. The big thing to be aware of, grub will NOT load/see windows if windows is installed on a msdos drive, and gentoo is loaded as UEFI. To check, on which partition setup you are using in linux, is check the drive's label on if it say GPT or msdos in fdisk (gdisk defaults to GPT, when it makes a partition setup).
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 6737
Location: Goose Creek SC

PostPosted: Thu Jul 10, 2014 6:13 pm    Post subject: Reply with quote

For clarity: the refind that you installed on the hard drive boots?
When the refind on the hard drive boots it displays an icon for windows (an icon for the sysresccd/usb if inserted) but not one for gentoo? Or does it have Gentoo icon but fail to boot when gentoo is selected?
Does windows boot from installed refind?
Does sysresccd boot from installed refind?
Code:
grep -i cmdline /usr/src/linux/.config
produces?
Code:
grep -i config_efi  /usr/src/linux/.config
produces?
Code:
ls -l /boot
produces?
create a mountpoint for the EFI system partition:
Code:
mkdir /mnt/esp

mount the windows EFI system partition (in my systems this is /dev/sda2) on it:
Code:
mount /dev/sda2 /mnt/esp
If you don't have it:
Code:
emerge wgetpaste
Code:
wgetpaste /mnt/esp/EFI/refind/refind.conf


It should be noted that rEFInd is not a bootloader. It is a boot manager; a tool used to select among multiple boot loaders.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
djdunn
l33t
l33t


Joined: 26 Dec 2004
Posts: 719
Location: Arrakis

PostPosted: Thu Jul 10, 2014 9:07 pm    Post subject: Reply with quote

i dualboot with syslinux here is how

secure boot off, obvious reasons, mostly because it has nothing to do with security

set up windows 7 to install on partition 3, on a gpt disk, actually installed it 2nd on a booting linux box, i have /boot, swap, and windows partition, root on separate disks.

for some reason even while booting uefi windows wanted CSM turned on

i have the boot order in uefi menu set to 1) syslinux 2) windows

here is my syslinux label for windows

Code:
LABEL exit_to_efi
        MENU LABEL Microsoft Windows 7 ultimate
        LOCALBOOT -1


its not really a true dual boot, it just exits efi and boots up the next entry in the uefi menu
_________________
A process cannot be understood by stopping it. Understanding must move with the flow of the process, must join it and flow with it.

-The First Law of Mentat
Back to top
View user's profile Send private message
srs5694
Guru
Guru


Joined: 08 Mar 2004
Posts: 434
Location: Woonsocket, RI

PostPosted: Mon Jul 14, 2014 1:11 am    Post subject: Re: Gentoo Dual Boot on UEFI Reply with quote

Eumcoz wrote:
I am trying to dual boot windows 8 and gentoo. I have a UEFI laptop, and found this guide: http://wiki.gentoo.org/wiki/UEFI_Dual_boot_with_Windows_7/8 I followed the guide and everything seems to have installed correctly, but my refind won't see my gentoo install. I can use the uefi bootable media to load the OS through refind. Does anyone know of a way to get refind to see the partition itself instead of having to use the bootable media to do it?


If you're saying that rEFInd installed to the hard disk loads but doesn't show a Gentoo option, whereas rEFInd booted from USB drive does show a Gentoo option, then the most likely explanation is that you haven't installed a suitable EFI filesystem driver for whatever filesystem holds your Linux kernel. Installing the driver is a matter of copying one file to the "drivers" or "drivers_x64" subdirectory of the rEFInd installation directory. (You may need to create that subdirectory, too.)

Telemin wrote:
I did things the grub2 way, which unless you have a reason to use refind I would be inclined to encourage, since it is the most commonly used bootloader by the linux community and hence best supported.


GRUB 2 is probably the most commonly used boot loader for Linux, but it's also the most bloated and the most difficult to configure manually. It's a reasonable default for Ubuntu, Fedora, and other such distributions simply because those distributions provide scripts that set up GRUB's convoluted configuration file automatically. Gentoo expects a more hands-on approach, though, which means you're more likely to have to get your hands dirty with the configuration files whatever boot program you use. In this situation, it's easy to find yourself hip deep in muck when using GRUB, whereas with anything else, you won't find yourself so dirtied. Clearly, I'm not a fan of GRUB. That's part of the reason that I forked rEFInd from rEFIt; I saw that the combination of the latter and the EFI stub loader almost made a better EFI boot solution than other options, so I wanted to bridge the gap.

Eumcoz wrote:
I thought I also read somewhere that grub and windows 8 do not play well, I forget the reason exactly, but it was basically suggested to used a EFI bootloader like refind, or I may run into data loss problems on windows updates.


Without knowing the source, I can't say for certain, but these comments might be a reference to one or more of three things:


  • Some people have reported problems getting GRUB to chainload the Windows boot loader, particularly with Secure Boot active. I've seen fewer reports of such problems recently than I was seeing a year or two ago, so I'm not sure if such problems are still common. As I recall, they were particularly common with Fedora, whose developers made the (bad) assumption that people would be using the firmware's boot manager to choose which OS to use, so they put little effort into the GRUB-to-Windows path. These problems can often be worked around, but may require disabling Secure Boot. If you have such a problem, rEFInd can provide a simpler fix than tweaking the GRUB configuration, since rEFInd usually Just Works when it comes to chainloading Windows, provided the Windows boot loader is configured correctly.
  • If you leave the Fast Startup feature active in Windows, the result can be data corruption on partitions that are shared with other OSes, including the EFI System Partition (ESP). The solution is to disable Fast Startup, as described here (among other places). Note that this is a Windows feature. Many EFIs provide their own feature with a similar name, but that's completely unrelated. Note also that disabling Fast Startup is required to avoid data corruption no matter what boot managers or boot loaders you use.
  • When you install a major Windows update, it's likely to re-install its own boot manager and set it as the default. This will require you to use bcdedit in Windows or some other tool to reset the default boot program. As with the previous item, this isn't a GRUB-specific issue; you'll need to make a similar change no matter what boot program you use as your primary.
Back to top
View user's profile Send private message
Telemin
l33t
l33t


Joined: 25 Aug 2005
Posts: 680
Location: Glasgow, UK

PostPosted: Mon Jul 14, 2014 12:35 pm    Post subject: Reply with quote

Hi there Srs5694,

Thank you for the clarifications and explanations of what rEFInd is and why it exists. Now I understand it I am intending to migrate back to EFI stub loading the kernel and choosing with rEFInd. (The only reason I went to grub was to make dual booting with windows less of a faff with UEFI settings and pressing the F12 key at the right time etc...)

Since you are the author and so the best equipped to do this, would you perhaps consider adding the information from your post into the wiki? At the moment there is not actually a rEFInd article. I realise there is the UEFI_Dual_boot_with_Windows_7/8 article already, but having some explanation of rEFInd vs GRUB and a more detailed explanation of e.g why rEFInd is not a boot loader, would be really helpful.

Thanks

-Telemin-
_________________
The Geek formerly known as -Freestyling-
When you feel your problem has been solved please add [Solved] to the topic title.
Please adopt an unanswered post
Back to top
View user's profile Send private message
Eumcoz
n00b
n00b


Joined: 10 Jul 2014
Posts: 4

PostPosted: Mon Jul 14, 2014 1:20 pm    Post subject: Reply with quote

DONAHUE wrote:
For clarity: the refind that you installed on the hard drive boots?
When the refind on the hard drive boots it displays an icon for windows (an icon for the sysresccd/usb if inserted) but not one for gentoo?

This is correct, there is no gentoo icon at all, but there is one for windows and sysresccd.
DONAHUE wrote:
Does windows boot from installed refind?

Window's boots fine from refind.
DONAHUE wrote:
Does sysresccd boot from installed refind?

sysresccd boots fine from refind
DONAHUE wrote:

Code:
grep -i cmdline /usr/src/linux/.config
produces?

Code:
CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE=root=PARTUUID=b696d9e0-0e95-45a5-923c-a9f61923ed44
CONFIG_CMDLINE_OVERRIDE=y


DONAHUE wrote:
Code:
grep -i config_efi  /usr/src/linux/.config
produces?

Code:
CONFIG_EFI_PARTITION=y
CONFIG_EFI=y
CONFIG_EFI_STUB=y
CONFIG_EFI_VARS=y


DONAHUE wrote:
Code:
ls -l /boot
produces?

Code:
initramfs-genkernel-x86_64-3.12.21-gentoo-r1
kernel-genkernel-x86_64-3.12.21-gentoo-r1
System.map-genkernel-x86_64-3.12.21-gentoo-r1


DONAHUE wrote:

create a mountpoint for the EFI system partition:
Code:
mkdir /mnt/esp

mount the windows EFI system partition (in my systems this is /dev/sda2) on it:
Code:
mount /dev/sda2 /mnt/esp
If you don't have it:
Code:
emerge wgetpaste
Code:
wgetpaste /mnt/esp/EFI/refind/refind.conf


I did this with no results, still no boot choice for gentoo. Do I have to tell refind to look for the gentoo boot partition somehow?
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 6737
Location: Goose Creek SC

PostPosted: Mon Jul 14, 2014 5:11 pm    Post subject: Reply with quote

sorry, I did not ask you to post the url returned after running the step
Code:
wgetpaste /mnt/esp/EFI/refind/refind.conf
please rerun: mount the windows EFI system partition (in my systems this is /dev/sda2) on it:
Code:
mount /dev/sda2 /mnt/esp
run
Code:
wgetpaste /mnt/esp/EFI/refind/refind.conf
and post the url returned.

create additional entries at /boot:
Code:
cp kernel-genkernel-x86_64-3.12.21-gentoo-r1 vmlinuz-3.12.21-gentoo-r1
cp kernel-genkernel-x86_64-3.12.21-gentoo-r1 kernel-genkernel-x86_64-3.12.21-gentoo-r1.efi
and reboot the installed refind. any gentoo icons appear?
_________________
Defund the FCC.
Back to top
View user's profile Send private message
srs5694
Guru
Guru


Joined: 08 Mar 2004
Posts: 434
Location: Woonsocket, RI

PostPosted: Tue Jul 15, 2014 12:44 pm    Post subject: Reply with quote

Eumcoz wrote:
DONAHUE wrote:
For clarity: the refind that you installed on the hard drive boots?
When the refind on the hard drive boots it displays an icon for windows (an icon for the sysresccd/usb if inserted) but not one for gentoo?

This is correct, there is no gentoo icon at all, but there is one for windows and sysresccd.


Please see my earlier post. You almost certainly need to add an EFI filesystem driver (and maybe a /boot/refind_linux.conf file).
Back to top
View user's profile Send private message
Eumcoz
n00b
n00b


Joined: 10 Jul 2014
Posts: 4

PostPosted: Tue Jul 15, 2014 3:52 pm    Post subject: Reply with quote

Good news is that there is defiantly progress being made, I now have icons in refind.

DONAHUE wrote:
sorry, I did not ask you to post the url returned after running the step
Code:
wgetpaste /mnt/esp/EFI/refind/refind.conf
please rerun: mount the windows EFI system partition (in my systems this is /dev/sda2) on it:
Code:
mount /dev/sda2 /mnt/esp
run
Code:
wgetpaste /mnt/esp/EFI/refind/refind.conf
and post the url returned.

create additional entries at /boot:
Code:
cp kernel-genkernel-x86_64-3.12.21-gentoo-r1 vmlinuz-3.12.21-gentoo-r1
cp kernel-genkernel-x86_64-3.12.21-gentoo-r1 kernel-genkernel-x86_64-3.12.21-gentoo-r1.efi
and reboot the installed refind. any gentoo icons appear?


http://bpaste.net/show/465488

I rebooted my system, and I now have a gentoo boot icon for refind. I believe while following your guide however I may have used the blkid on the disk block to get the PARTUUID. When I boot into gentoo I get the error:

Code:
Cannot open root device PARTUUID=b696d9e0-0e9545a5-923a-a9f61923ed44 or unknown block(0,0): error -6.  Please append correct root= boot option


Which partition should I be using blkid on? /dev/sdb(the disk my gentoo install is on), /dev/sdb1(my boot partition), /dev/sdb2(my swap partition), or /dev/sdb3(my main partition)? I am assuming once I update the boot option to used the correct PARTUUID, gentoo should boot.

srs5694 wrote:
Please see my earlier post. You almost certainly need to add an EFI filesystem driver (and maybe a /boot/refind_linux.conf file).


Now that the icons are there, I believe this may have fixed the problem you had stated, if I continue to have problems I will give it a shot.

Thank you,
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 6737
Location: Goose Creek SC

PostPosted: Tue Jul 15, 2014 4:52 pm    Post subject: Reply with quote

please run
Code:
lspci -k | wgetpaste
from the sysresccd and post the url returned.
Your CMDLINE is not invoking an initrd/initramfs at present. genkernel builds the hard drive drivers and filesystem drivers as modules requiring an initrd/initramfs to load the modules. Propose shifting you to a manual kernel by adding the drivers for HDD and filesystems to your current configuration.
I have discovered that the call for the initrd that I have previously used is no longer working. Investigating that. I thank you for leading me to that discovery.
_________________
Defund the FCC.
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