You are not logged in.

#1 2014-02-19 09:07:37

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,240

[SOLVED] Advice for Arch install with rEFInd dual boot Lenovo laptop?

I am trying to plan an Arch install on a new laptop for dual boot with Windows 8.1, but I know there is a potential to cause huge problems so I have been trying to read and learn about the hard disk partition structure and how I might install the rEFInd boot files so that I am still able to boot Windows once Arch is installed. (Unfortunately for some tasks such as updating the maps on my satnav box Windows is essential). However I am really quite unsure if I am doing the right thing in the way I am thinking about the Arch install so I would appreciate any help from experts on the forum.

The laptop is a Lenovo IdeaPad Y510p which came with Windows 8 pre-installed, with the option to upgrade to Windows 8.1.  The upgrade was completed without issue and I then looked into the question of hard drive partitions and boot.  I had read posts on the Ubuntu forums about users who had installed Ubuntu on this same laptop and ended up being unable to boot Windows afterwards so I wanted to tread very carefully before executing anything which might cause really major damage. I had also read on the Lenovo forums replies about people who had replaced the hard drive and installed linux only to find that they could  not boot to the recovery partitions, with replies from Lenovo moderators saying that if the partition structure had been changed then the laptop would have to be sent back to Lenovo for a factory repair.

On this laptop to get into the bios or boot options you do not just press the power button and hit an F key, but instead there is a special small "OneKey Recovery" button next to the power jack, which opens up with options for BIOS setup and boot options as well as normal boot or recovery. This OneKey Recovery button is therefore needed to boot a usbkey - the power button only allows it to boot to windows presumably until/unless a different bootloader and NVRAM entry is amended.

I have done all the initial ( safe!)changes necessary to move to the point at which I can execute the Arch install. From within Windows (switched off fastboot, and shrunk the "C:" drive to make space for linux partitions).  I have also switched off Secure Boot from the BIOS, and made sure that Windows still boots up fine.

The current arch install iso (February 2014) boots under uefi just fine - and of course once booted I have access to the gdisk programme.  That certainly showed the pre-existing partitions on the drive (8 partitions with partition number 2 being the EFI partition, and three recovery partitions!) with a GPT partition table, and it should therefore be possible to make the necessary new linux partitions in the now unallocated space on the disk that was freed up with the internal disk management facility within Windows 8.1.  So at that point I created three partitions for a root partition (type 8300), a swap partition (type 8200) and another type 8300 partition which will become /opt in the installed Arch system.

In order to try and not make any changes to the partition structure I let the three new linux partitions be number 9, 10 and 11.

I am told that for a GPT disk it is a definite no-no to try to create more than one EFI partition. So I will need to use the existing EFI partition to place the rEFInd files and the kernel once I install Arch.

In this (Y510p) laptop the EFI partition contains the following structure:

BOOT/ - containing only boot.sdi
BOOTSECT.BAK
EFI/ which contains two directories Boot/ and Microsoft/

so EFI/Boot/ contains only Boot64.efi which is likely a fallback copy of the Windows 8.1 bootloader

and EFI/Microsoft/ contains a Boot/ directory - so

EFI/Microsoft/Boot/  contains loads of language specific directories like en-GB/
plus bootmgfw.efi (which I believe is the Windows main efi loader file)
        bootmgr.efi
        memtest.efi

The scheme that I am planning to use which I have previously used in pure Arch uefi machines, is that /boot is a directory in the root partition, /. That way /boot is an ext4 directory and will contain the kernel and initramfs plus the rEFInd linux config file.

Then I can mount the EFI (vfat) partition as /boot/efi and so I can then make a /boot partition under /.  Then the EFI /BOOT/ directory would be seen in Linux as /boot/efi/BOOT/ and the Windows efi stuff would be in /boot/efi/EFI/Boot/Microsoft/Boot/ in which case I would presume that I have to make a new directory in /boot/efi/EFI/refind/ and put the refind stuff including the filesystem drivers there, and let the kernel go into the (ext4) /boot/ directory which would be preferred!  However I am not 100% confident that this is what will work and I need to read more before trying to do the install. The thing that concerns me is how the system will handle the uefi boot process, and whether it would auto-detect the Windows efi file as well as the Arch refind efi file once the system has started up?

... and then there is the issue of the NVRAM entries and I am no longer confident that if I use the usual tools to create an entry (efiboomgr or bcfg), that I will get a successful dual boot system!

There is still a chance that I would irrevocably damage being able to boot to the Windows and Recovery partition boot options by messing up the EFI and/or the NVRAM so I have to tread very very carefully with this.

If anyone has gone through this kind of dual boot install with a Windows 8 or 8.1 machine using rEFInd for the bootloader, and can offer advice or help here I would very much appreciate it.  I have another pure Arch system which uses rEFInd that works extremely well, but it seems that dual boot with uefi is a rather more complex animal than a pure linux system!

Last edited by mcloaked (2014-02-22 10:06:03)


Mike C

Offline

#2 2014-02-21 21:58:10

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,240

Re: [SOLVED] Advice for Arch install with rEFInd dual boot Lenovo laptop?

After receiving no replies I decided to go ahead and install arch on this Windows 8.1 laptop using the scheme outlined in my original post, using the February 2014 arch install iso written to a usb key using the dd command. The install key booted in UEFI without any problems (Secure Boot and Fastboot had already been turned off as per previous people's experience)

The install executed without any problems. I installed rEFInd as the bootloader, copied the relevant directories and files to the existing EFI after making a new directory in it for rEFInd. The scheme I used was to mount the existing EFI as /boot/efi, with a new directory at /boot/efi/EFI/refind/ to hold the refind binary and icons/fonts etc, and make a subdirectory in the root partition called /boot to contain the arch kernel. This way the existing EFI (vfat) only needed to contain minimal bootloader files, and the kernel would then still be in an ext4 directory at /boot.

The refind_linux.conf file was placed in /boot along with the normal kernel and initramfs, containing two lines, one for default graphical boot and the other to boot to a console.  The only change in the refind.conf file in the EFI was to specify the default string as vmlinuz.  One new NVRAM entry was written using efibootmgr towards the end of the main install, which was selected as the default entry when that command was executed.

Once the base install was complete, with a wired connection left in place the system was rebooted, and the laptop booted into the rEFInd graphical screen with Arch as the default operating system. The Windows efi binary was detected automatically and appeared as a Windows icon next to the Arch one.

The boot into the new Arch system was normal without any problems. Once I had checked that arch was running normally and set up some initial configuration with a normal user, then I powered off, and rebooted to select Windows from the rEFInd graphical screen to check that Windows 8.1 booted normally, which it did.

So dual booting Windows 8.1 and Arch was straightforward despite my potential concerns expressed in the post above.

It is gratifying that the install was smooth and that rEFInd as my chosen bootloader worked correctly at the first attempt.

Hopefully this will encourage other arch users to install under dual boot knowing that the basic scheme does not cause any conflict with the existing Windows system.


Mike C

Offline

#3 2014-02-22 17:13:58

Luccianus
Member
Registered: 2013-08-24
Posts: 6

Re: [SOLVED] Advice for Arch install with rEFInd dual boot Lenovo laptop?

I've been in something like you for the past days.
I managed to make a Triple Boot Windows 8.1 + Mac OS X 10.9 + Arch. I did a previous disk layout with GPT. Only problem was Clover EFI from Mac, which decided it was OK to delete all the files in the EFI partition, which make me have to reinstall Windows and refind files later.

Although the Arch system was a previos installation (which was originally on an MBR disk, and I copyed to a GPT one), so I boot'ed it through a Grub2 in BIOS mode, installed refind just as the wiki says (how you did), except I placed the kernel and initramfs inside the EFI Partition, it was my intention to have it available there. And also I have to manually configure the entry in refind.conf, and Windows was yes automatically detected (the manual detections for the kernel image didn't work at all, they needed the extra parameters).
Anyhow, I had an additional step, once I placed the refind files, I booted to Windows in UEFI mode (since you can't use efibootmgr if you're in BIOS mode), and used it's bcdedit to default to refind.
Though, if you don't have any loader previously installed... I have a VM in which I installed Gentoo in BIOS mode, then installed the refind files to the EFI Partiton, and now I could get through the UEFI shell to boot, and then I can use efibootmgr to default it.


Push my Arch through the roof!

Offline

#4 2014-02-23 16:51:44

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,240

Re: [SOLVED] Advice for Arch install with rEFInd dual boot Lenovo laptop?

I have added some details about the use-case for rEFInd to the Arch Wiki, including some info on dual boot which I hope may be useful to anyone else considering setting up a laptop to use arch but preserve the Windows install.


Mike C

Offline

#5 2014-05-27 03:38:03

daeden
Member
Registered: 2013-08-02
Posts: 3

Re: [SOLVED] Advice for Arch install with rEFInd dual boot Lenovo laptop?

I just purchased a y510p and have successfully installed Arch Linux with GRUB as my bootloader, but I can't seem to get X Server to work properly.

I have installed the NVIDIA drivers that I downloaded from their website and followed the instructions provided on the Arch Wiki regarding NVIDIA Optimus. Nevertheless, whenever I attempt to start up X using 'startx' my screen goes black, the GPU fan spins up, and after roughly 10 seconds the machine restarts.

Can you go into more detail on how you got X Server and whatever display manager you use to work?

Offline

#6 2014-05-27 07:48:40

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,240

Re: [SOLVED] Advice for Arch install with rEFInd dual boot Lenovo laptop?

daeden wrote:

I just purchased a y510p and have successfully installed Arch Linux with GRUB as my bootloader, but I can't seem to get X Server to work properly.

I have installed the NVIDIA drivers that I downloaded from their website and followed the instructions provided on the Arch Wiki regarding NVIDIA Optimus. Nevertheless, whenever I attempt to start up X using 'startx' my screen goes black, the GPU fan spins up, and after roughly 10 seconds the machine restarts.

Can you go into more detail on how you got X Server and whatever display manager you use to work?

On my Y510p I only used the open source nouveau driver, and installed the main set of KDE packages so my display manager is the default that comes with KDE.  My system never had any issue with starting X and getting the desktop running. After the initial install with a text console I then simply ran pacman to install the kde set of packages, and enabled the graphical desktop before rebooting and it just worked. I know that the proprietary Nvidia drivers may need more manual setting up, but since I never used this and only nouveau I have no experience of the proprietary drivers to be able to guide you.  Maybe other users who do ise the Nvidia drivers can help.

Having said that I don't actually use the the full range of the hybrid graphics and the system boots and uses the integrated Intel graphics chip.  I did have a dabble some months ago at using bumblebee but I could not get it to work so I reverted to letting it use the integrated graphics and not the discrete graphics card.

Presumably you have the appropriate set of xorg packages installed?

Last edited by mcloaked (2014-05-27 09:21:21)


Mike C

Offline

#7 2014-06-25 17:05:14

vipin
Member
From: Qatar
Registered: 2014-06-25
Posts: 1
Website

Re: [SOLVED] Advice for Arch install with rEFInd dual boot Lenovo laptop?

I have recently bought the y510p , im planning to install Arch , this is my 4th laptop , i had installed Arch in all the other 3 with no problems, but im a bit worried with the installation as this is the first laptop which has EFI , im a linux user for the past 6 years , i started with fedora , now i like Arch , mike documentation is excellent, i just had one question when i had grub , it automatically finds the new kernel when i update (grub.conf/menu.lst gets updated), does rEFInd also do that.

Offline

#8 2014-06-25 17:33:31

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 1,240

Re: [SOLVED] Advice for Arch install with rEFInd dual boot Lenovo laptop?

vipin wrote:

I have recently bought the y510p , im planning to install Arch , this is my 4th laptop , i had installed Arch in all the other 3 with no problems, but im a bit worried with the installation as this is the first laptop which has EFI , im a linux user for the past 6 years , i started with fedora , now i like Arch , mike documentation is excellent, i just had one question when i had grub , it automatically finds the new kernel when i update (grub.conf/menu.lst gets updated), does rEFInd also do that.

When there is an update to the rEFInd package you need to copy the files across to your ESP from the files contained in /usr/share/refind/  usually you need to copy the refind_x64.efi binary as well as the icons, fonts, and drivers directories.  Since there is flexibility in how you configure the kernel and initrd files in terms of where they are located whether you need to do anything else when a new kernel update arrives depends on how you set your system up.  If you have the /boot directory as your ESP partition which will then have the kernel and initrd files updated by default then there no need to do anything else when there is a kernel update. If the ESP is then at /boot/EFI and within that is your refind/ directory then that is where the replacement files go if refind-efi gets a pacman update. So it is actually fairly straight forward. If you configure rEFInd to look for kernels in some other directory than /boot/ then you may need to copy the files there after a kernel update but there is more information in the arch wiki about this.

During a refind-efi package update there are helpful files in the pacman output (and log) reminding you of what you need to do.  eg for the latest refind-efi update you get:

[2014-06-18 18:48] [PACMAN] upgraded radvd (1.12-1 -> 1.13-1)
[2014-06-18 18:48] [ALPM-SCRIPTLET] 
[2014-06-18 18:48] [ALPM-SCRIPTLET] rEFInd UEFI application has been installed at /usr/share/refind/refind_*.efi
[2014-06-18 18:48] [ALPM-SCRIPTLET] 
[2014-06-18 18:48] [ALPM-SCRIPTLET] Other UEFI applications have been installed at /usr/share/refind/tools_*/
[2014-06-18 18:48] [ALPM-SCRIPTLET] 
[2014-06-18 18:48] [ALPM-SCRIPTLET] UEFI drivers have been installed at /usr/share/refind/drivers_*/
[2014-06-18 18:48] [ALPM-SCRIPTLET] 
[2014-06-18 18:48] [ALPM-SCRIPTLET] Copy the efi application (according to your UEFI ARCH) 
[2014-06-18 18:48] [ALPM-SCRIPTLET] and /usr/share/refind/refind.conf-sample to a sub-directory of <EFISYS>/EFI/
[2014-06-18 18:48] [ALPM-SCRIPTLET] as refind.conf and add an entry to firmware boot menu using efibootmgr
[2014-06-18 18:48] [ALPM-SCRIPTLET] or mactel-boot (for Macs)
[2014-06-18 18:48] [ALPM-SCRIPTLET] 
[2014-06-18 18:48] [ALPM-SCRIPTLET] rEFInd Icons have been installed at /usr/share/refind/icons/
[2014-06-18 18:48] [ALPM-SCRIPTLET] rEFInd Fonts have been installed at /usr/share/refind/fonts/
[2014-06-18 18:48] [ALPM-SCRIPTLET] 
[2014-06-18 18:48] [ALPM-SCRIPTLET] HTML Documentation is available at /usr/share/refind/docs/html/
[2014-06-18 18:48] [ALPM-SCRIPTLET] 
[2014-06-18 18:48] [ALPM-SCRIPTLET] More info: [url]https://wiki.archlinux.org/index.php/UEFI_Bootloaders#Using_rEFInd[/url]
[2014-06-18 18:48] [ALPM-SCRIPTLET] 
[2014-06-18 18:48] [PACMAN] upgraded refind-efi (0.8.1-1 -> 0.8.2-1)

I hope that helps.

By the way you can also boot uefi using grub and in fact you can get rEFInd to chainload grub as a backup bootloader as an added safety factor and have both rEFInd as well as grub installed simultaneously. How that can be done is explained in the thread at https://bbs.archlinux.org/viewtopic.php?id=181906

Last edited by mcloaked (2014-06-25 17:41:12)


Mike C

Offline

Board footer

Powered by FluxBB