You are not logged in.

#1 2013-09-15 00:11:21

brokengestalt
Member
Registered: 2012-07-24
Posts: 55

[SOLVED] Dual Boot+UEFI woes

So I attempted to install arch after win8, made some mistakes, and nuked a lot of files. Luckily, those files were worthless.

What I want to do at this point in time is get either dual or single boot, and use UEFI. Since my motherboard supports UEFI, there seems to be no reason not to try and use it, especially if I want to dual boot. But this is where most of my problems seem to lie.

I've disabled fastboot, and checked to make sure secureboot is off (it doesn't even exist in my mobo as an option.) I have the choice between UEFI and UEFI+Legacy as a boot option. Thing is, when I tried to boot the archiso install media with UEFI, it only successfully did so the first time I attempted to install. (I know it succeeded the first time because I did this test. I rebooted to go into gparted, thinking my ESP was too small. Then I couldn't boot back into the media in UEFI mode. Basically, at this moment, whenever I use UEFI bootmode and try to boot the media, I get thrown into my EFI boot shell. I switched it to UEFI+Legacy mode (the compatibility mode) and it booted into it just fine, but I obviously won't be able to use an uefi bootmanager/loader if I do that.

Is there any reason why this would happen? I don't really mind starting all over to get dual boot using GPT and UEFI mode working, but what should I do to actually get the arch media to boot into UEFI mode? If it booted in UEFI mode the first time, I don't see why it should never ever ever boot into it again.

Last edited by brokengestalt (2013-09-23 10:41:14)

Offline

#2 2013-09-15 00:48:42

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,132

Re: [SOLVED] Dual Boot+UEFI woes

Are you using a CD or a USB key as installation media? How did you prepare the installation media?

There's something wrong with that link by the way - it just takes me to the main page in the wiki.

Did your machine come with Windows 8 installed? If so, it must support secure boot but this is probably an option you need to change in the BIOS - not in the OS.

You can in fact install for EFI boot while booted in legacy mode - the only thing you can't do is set the nvram entry for the EFI boot menu. There are at least 2 ways around this. One is to boot any live environment which will boot in EFI mode (e.g. Ubuntu) and to set the entry from there. The other is to copy the .efi application (e.g. refind_x64.efi or grub.efi or whatever) to the default fallback position at EFI/boot/bootx64.efi and to then choose the relevant hard drive from your EFI boot menu. There are other ways, too e.g. from the EFI shell or from Windows. Or you can just recreate the Arch installation media and try it again.

You should also be able to boot the Arch live environment from the EFI shell you get thrown into (since you are lucky enough to have one smile). There are details of this and the other methods on the wiki and also on Rod Smith's pages on this.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#3 2013-09-15 01:02:38

brokengestalt
Member
Registered: 2012-07-24
Posts: 55

Re: [SOLVED] Dual Boot+UEFI woes

Link fixed.

I used a USB drive, and prepared it with UNETBootin first, before realizing my mistake, then used win32 image writer. I built the machine myself, so I installed win8 myself.

Can I really install for efi mode while booted in legacy? Some of the directions in the guide don't work as they probably should if I'm booted in legacy, for example, the steps that must be performed to before chrooting if I want to install gummi-boot afterwards..

# umount /sys/firmware/efi/efivars
# modprobe -r efivars
# modprobe efivarfs
# mount -t efivarfs efivarfs /sys/firmware/efi/efivars

Or is this just exactly what you mean by "the only thing you can't do is set the nvram entry," because I'm not actually quite sure if this the same thing or not. I just found smith's pages, guess I have some reading to do :S

Offline

#4 2013-09-15 01:12:33

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,132

Re: [SOLVED] Dual Boot+UEFI woes

Yes. That's the bit which won't work. But you can do everything else. I know this for sure because when I installed Arch, I used the old installation system and it didn't support EFI booting. So what you did was install everything and then use some other method to boot into EFI mode and set the nvram entry. (Which is how I know Ubuntu's live environment works for this.) However, if you plan to use gummiboot or rEFInd or grub or whatever, copying the .efi application to the fallback position is easier. Once you boot into the new system, you can then set the nvram entry. I actually keep grub as EFI/boot/bootx64.efi on my machine because it is quite easy to inadvertently wipe out all custom EFI entries with my firmware and that leaves my machine unbootable. However, I didn't know about this trick at the time wink.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#5 2013-09-15 03:02:22

brokengestalt
Member
Registered: 2012-07-24
Posts: 55

Re: [SOLVED] Dual Boot+UEFI woes

On this thread, someone suggests putting the EFI partition at /boot/efi, and says that a separate boot is unecessary. This means that if choose to set it up like this, /boot isn't a separate partition, but rather a directory under root, and I am installing the appropriate bootloaders/bootmanagers in /boot/efi?

But if dual booting, still would need a separate EFI system partition, right? So is this where some choose put arch's /boot partition? (Basically, putting arch's /boot in the esp, it'd make sense if uefi was designed to have it this way, but if not, I'm probably just really confused.)

To clarify, for someone not using a separate /boot partition, and using the /boot/efi setup instead, would his root directory be called the ESP?

Last edited by brokengestalt (2013-09-15 03:05:54)

Offline

#6 2013-09-15 03:30:14

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [SOLVED] Dual Boot+UEFI woes

I just want to note that thanks to the.ridikulus.rat, we not have an efibootmgr in [testing] that is from Peter Jones' branch. It has been updated to work with efivarfs rather than the old sysfs-efivar.  I have been testing it for about a week or two and it works amazingly.  No longer do I have to switch between the two in order to make firmware entries.  It also handles kernel command line arguments quite well, avoiding and kind of truncation that would occur on some machines.  So the creation of direct efistub entries works quite well.

@OP, you can use the ESP as /boot or /boot/efi.  It is up to you.  The advantage of having it at /boot/efi is that the kernel and initramfs remain on a Linux filesystem.  There are a number of distributions that actually use symlinks in this area, which are not supported by VFAT.  But if you have a bootloader or boot manager that expects your kernel and initramfs to be on the ESP then you will have to find a way to move or copy them onto the ESP.

If Arch is your only OS, or you don't have a vast number of operating ssytems on your machine, then I think putting the ESP at /boot is a pretty sane thing to do.  It will ensure that the kernel is written directly to the ESP on installation, saving you from having to have a service that moves it to where it needs to be.  It just eliminates one more potential fail point in installing the kernel.

I have started using /boot/efi to mount my ESP as I use btrfs.  I like to snapshot my system, but if I have the kernel and initramfs on a different filesystem, it makes it very hard to roll back to and older snapshot.  So having it at /boot/efi means that the kernel will still be written to /boot/vmlinuz-linux and I can snapshot the rootfs and the kernel and initramfs will be included in that snapshot.  Therefore the kernel's version will match with the module in /usr/lib/modules, which makes my life easier in the event I cause breakage… and oh do I cause some breakage sometimes.

Offline

#7 2013-09-15 03:57:26

brokengestalt
Member
Registered: 2012-07-24
Posts: 55

Re: [SOLVED] Dual Boot+UEFI woes

So based on what you are saying, ESP as /boot is still sane if I were just dual booting, right? Now I think it's just a matter  of getting (1) arch media to boot properly and (2) figuring out if I should install win8 or arch first, but other than that, I think I understand this all a little better...

EDIT: So it appears that windows8 installer doesn't allow me to configure the size of the esp that it uses, which is just 100 mb. According to documentation, the bootmanager I want, gummiboot, looks for pretty much everything in the ESP. It's unfortunate that I can't follow the suggestion in the beginner's guide for 512mb ESP for best compatibility. I hope everything fits... if not, I guess I'll have to figure out if it's possible to use another partition as ESP and still have windows be bootable, or just use a bootmanager that can be placed elsewhere (is that even possible?) Sorry, I'm still confused about some things about how this works/should work.

Last edited by brokengestalt (2013-09-15 10:37:31)

Offline

#8 2013-09-15 14:51:08

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: [SOLVED] Dual Boot+UEFI woes

You should be able to prepare your partitions before you install Windows. Windows will then use the ESP that it finds on the disk, even if it's >=512MiB in size. (Note that should be 512MiB, not 512MB. See here if you don't understand the distinction. In fact, I recommend going to 550MiB, because that avoids the confusion and makes the partition big enough that mkdosfs uses FAT32 by default.)

Offline

#9 2013-09-15 23:01:18

brokengestalt
Member
Registered: 2012-07-24
Posts: 55

Re: [SOLVED] Dual Boot+UEFI woes

Huh, it's basically too late to adjust, since I already installed. :<

I made a 513ish MB partition, then selected the partition (which was after my 513) to install Win8 to. The thing is, I couldn't change any options or flags or anything for the partitions. Windows then proceeded to make the ESP, MSR and Recovery(?) partition *before* the main OS partition, so my 513MB partition and OS partition sandwiched the ESP. It then gives a warning about how this partition setup is "incorrect," and may prove troublesome later. Eeeeh. Maybe I missed something, but seems like it's too late unless I wanna redo partitions again. I don't know that there's a safe way to use the disk manager from within Windows to increase the size of the ESP, though I think MSR is supposed to be reserved space to expand either ESP or main OS partition. Again, I'm not entirely sure...

Offline

#10 2013-09-16 09:45:05

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,494

Re: [SOLVED] Dual Boot+UEFI woes

srs5694 wrote:

You should be able to prepare your partitions before you install Windows. Windows will then use the ESP that it finds on the disk, even if it's >=512MiB in size. (Note that should be 512MiB, not 512MB. See here if you don't understand the distinction. In fact, I recommend going to 550MiB, because that avoids the confusion and makes the partition big enough that mkdosfs uses FAT32 by default.)

It should be at least 512MiB, but why hold on to that, or even 550MiB.
Since there will likely be more tools available for EFI in the future, why not make it bigger?, disk size isn't a problem these days.
Me myself, I made '/boot/efi' which is my ESP, 3GiB, it also hosts some rescue ISO's, like the Arch iso.

brokengestalt wrote:

so my 513MB partition and OS partition sandwiched the ESP. It then gives a warning about how this partition setup is "incorrect,

Your 512MiB partition should be the ESP, so yeah, probably something is wrong. Show us your partition layout.

Offline

#11 2013-09-16 17:05:49

srs5694
Member
From: Woonsocket, RI
Registered: 2012-11-06
Posts: 719
Website

Re: [SOLVED] Dual Boot+UEFI woes

qinohe wrote:
brokengestalt wrote:

so my 513MB partition and OS partition sandwiched the ESP. It then gives a warning about how this partition setup is "incorrect,

Your 512MiB partition should be the ESP, so yeah, probably something is wrong. Show us your partition layout.

To clarify: Show the output of a program that displays partition information, such as one of:

gdisk -l /dev/sda
parted /dev/sda unit s print

People who try to summarize these things in words invariably omit critical details.

Offline

#12 2013-09-17 10:59:11

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,494

Re: [SOLVED] Dual Boot+UEFI woes

srs5694 wrote:

To clarify: Show the output of a program that displays partition information, such as one of:

gdisk -l /dev/sda
parted /dev/sda unit s print

People who try to summarize these things in words invariably omit critical details.

Yeah your right. Mostly, when I ask such questions, I assume people use tools like that, not that 'they' start typing;)....

Last edited by qinohe (2013-09-17 10:59:33)

Offline

#13 2013-09-22 04:17:39

brokengestalt
Member
Registered: 2012-07-24
Posts: 55

Re: [SOLVED] Dual Boot+UEFI woes

I only have windows installed at the moment. Using diskpart, this is the current partition setup. Not terribly detailed. I don't have the 512 mb esp, since win8 setup told me it would be problematic to have it *before* all of the partitions listed below. (The 512MiB partition I tried to make wasn't selected by win8 installer to be the esp, rather, it made its own, and I had no way of selecting or customizing the size of it...)

DISKPART> list partition

  Partition ###  Type              Size     Offset
  -------------  ----------------  -------  -------
  Partition 1    Recovery           300 MB  1024 KB
  Partition 2    System             100 MB   301 MB
  Partition 3    Reserved           128 MB   401 MB
  Partition 4    Primary            409 GB   529 MB

Offline

#14 2013-09-22 20:59:58

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,132

Re: [SOLVED] Dual Boot+UEFI woes

I don't know how that tool works but it is not showing the type codes for the partitions in any form I'm familiar with. Are you sure that the type code of the 513MiB partition was set correctly before you ran the Windows installer, for example?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#15 2013-09-23 01:53:03

brokengestalt
Member
Registered: 2012-07-24
Posts: 55

Re: [SOLVED] Dual Boot+UEFI woes

I'm almost certain at this point that it wasn't. From what you asked, I'm guessing this means that ideally I would set up the partitions using some other tool before using the windows installer? (The windows installer really doesn't have any options at all....)

Offline

#16 2013-09-23 02:46:22

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,132

Re: [SOLVED] Dual Boot+UEFI woes

You can use any live Linux distro which includes a tool such as gdisk or gparted. gparted is recommended for beginners as it is a GUI programme.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#17 2013-09-23 10:40:56

brokengestalt
Member
Registered: 2012-07-24
Posts: 55

Re: [SOLVED] Dual Boot+UEFI woes

I suppose I'll just have to install arch when I can risk making another error, or something goes wrong. I think since arch installer includes gdisk(?) I could just wipe my hard drive (again), set up the partitions and mark the 512MiB as boot, then install windows, then install arch. The only thing that's left (I think) as far as preparing for a dual boot is figuring out if the win8 installer can allow the user to select a pre-made ESP, rather than having it blindly make its own. I'll just mark this as solved.

Last edited by brokengestalt (2013-09-23 10:41:30)

Offline

Board footer

Powered by FluxBB