You are not logged in.

#1 2014-03-23 10:59:38

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,899
Website

Dual booting Arch with Windows using refind [Solved]

Just got a Sony Vaio laptop that currently runs Windows 7 (uefi). Can run/load arch install media without a problem (usb drive). Did try to reduce size of windows partition to allow me to dual boot, but was getting errors. So have decided to run with what I have until I can remove Windows completely.

sda looks like

sda1 ntfs 10G
sda2 ntfs 104M  (boot)
sda3 489G

Could I do a minimal install of Arch to sda1? can use it as it is only system recovery. From what I have red I would need to mount /efi to /boot/efi.

Forgive me I am still learning about efi, can follow wiki guides and search but just wondered if what I am trying to do is possible

EDIT:

creating /boot/efi/EFI/refind part is confusing as I have a /boot and a /EFI directory, do I create those directories in /EFI ? in other words mkdir -p /boot/efi/EFI/refind?

Last edited by Mr Green (2014-03-24 06:31:38)


Mr Green

Offline

#2 2014-03-23 11:04:17

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,600
Website

Re: Dual booting Arch with Windows using refind [Solved]

You wanna format sda1 to ext4 or the like?  If you do that, and copy/install Arch there, yes, mount the $esp to /boot/efi and you should be able to use refind or grub or whatever.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3 2014-03-23 11:11:53

progandy
Member
Registered: 2012-05-17
Posts: 5,203

Re: Dual booting Arch with Windows using refind [Solved]

Could I do a minimal install of Arch to sda1? can use it as it is only system recovery. From what I have red I would need to mount /efi to /boot/efi.

First boot windows and create your recovery media in case you ever want windows back. If I remember correctly sony doesn't provide a separate installation medium.

Edit: Mounting the ESP partition to /boot/efi is one way to do it, but mounting directly to /boot makes the configuration easier if you only have arch and windows.

Last edited by progandy (2014-03-23 11:20:56)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Online

#4 2014-03-23 11:17:12

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,899
Website

Re: Dual booting Arch with Windows using refind [Solved]

Ok have edited first post, sorry did not catch replies. Do not want to run windows might need to mount partition to extract data (laptop belonged to my partner, have of course backed up but better safe than sorry, can always blast it in the future). Very interested in getting efi working.

Yes sda1 is system backup so not required, can format to ext4 no problem. Minimal Arch install is fine at this point.

Last edited by Mr Green (2014-03-23 11:30:20)


Mr Green

Offline

#5 2014-03-23 14:53:48

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,899
Website

Re: Dual booting Arch with Windows using refind [Solved]

After reading wiki tried to mount efivarsfs, but I get:

sudo mount -t efivarfs efivarfs /sys/firmware/efi/efivar 
mount: mount point /sys/firmware/efi/efivars does not exist

Checked kernel (stock repo and up to date) and seems ok, modprbe efivarfs seems to work although it does not show up in lsmod


Mr Green

Offline

#6 2014-03-24 06:35:02

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,899
Website

Re: Dual booting Arch with Windows using refind [Solved]

Need to boot via efi, then /sys/firmware/efi will be present. Refind is not happy with esp currently used by windows, might need to renew it too vfat.


Mr Green

Offline

#7 2014-03-24 07:50:12

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,763
Website

Re: Dual booting Arch with Windows using refind [Solved]

The EFI System Partition should be formatted to FAT32 (or FAT16), the official specification says 512MB but 100-200MB should be fine.
/boot does not need to be mounted on the ESP but it makes the setup much easier if it is.
You will need one partition for the ESP & one for the / directory.
EDIT: I haven't tried a dual-boot UEFI though, so I'm not sure whether this makes any difference...

Last edited by Head_on_a_Stick (2014-03-24 07:53:36)

Offline

#8 2014-03-24 08:31:02

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,899
Website

Re: Dual booting Arch with Windows using refind [Solved]

The current ESP that windows uses as far as I can tell is ntfs, roughly 104Mb (sda2) was going to use 10Gb partition for root but think it would be better to set up as I want. Did try to resize windows partition but it was giving me errors... Since restored booting into windows so maybe any drive problems have been sorted now.

Arch-install-media was booting normally (not efi) so was getting confused. Have of course read up more and now understand what I am doing wrong, just got to figure out how to get laptop to boot in efi mode (time to look in bios). Would really like to see arch-install-media boot this way....

Read so much about booting without a bootloader just wanted to try it for myself.


Mr Green

Offline

#9 2014-03-24 19:56:14

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,763
Website

Re: Dual booting Arch with Windows using refind [Solved]

If you set the BIOS to boot with UEFI enabled and then put the archlive cd in, it will boot up in EFI mode & can be used to set up efibootmgr after arch-chrooting into your system; thats how I did it anyway wink

Last edited by Head_on_a_Stick (2014-03-24 19:57:27)

Offline

#10 2014-03-24 20:08:29

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,899
Website

Re: Dual booting Arch with Windows using refind [Solved]

The wiki is not clear on if usb live works efi, might try a cd see what happens. Not much to see in bios certainly no efi setting. Did mange to add option to windows boot loader but have not tested yet, got impatient to install and went with syslinux....


Mr Green

Offline

#11 2014-03-24 20:14:19

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Dual booting Arch with Windows using refind [Solved]

Mr Green wrote:

The wiki is not clear on if usb live works efi...

https://wiki.archlinux.org/index.php/US … otable_USB


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#12 2014-03-25 07:09:47

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,899
Website

Re: Dual booting Arch with Windows using refind [Solved]

Might try that at least I will be able to use rest of usb drive for something else. To even use refind I need to be able to boot via efi. Must remember to read wiki more carefully

Thank you


Mr Green

Offline

#13 2014-03-25 14:12:50

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,899
Website

Re: Dual booting Arch with Windows using refind [Solved]

So I have follow the alternative install to usb without any luck. All I get is syslinux prompt (files not found). Wiki guide excludes the use of syslinux.conf or a way of pointing boot to iso version. Either I am reading the guide wrongly or I am missing something.

This part needs to be made more clear

https://wiki.archlinux.org/index.php/Sy … al_install

If you follow those commands you will overwrite your own /boot directory, of course it needs to point too /mnt/usb.

Still thinking that I need to create the $esp on the usb drive and partition for archlinux iso


Mr Green

Offline

#14 2014-03-25 23:27:53

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

Re: Dual booting Arch with Windows using refind [Solved]

Mr Green wrote:

sda looks like

sda1 ntfs 10G
sda2 ntfs 104M  (boot)
sda3 489G

A tip: Don't summarize such things. Present the output of a relevant partitioning tool, such as gdisk or parted. In my experience, summaries omit critical details more often than not. In your case, either your summary is inaccurate or you are not booting Windows in EFI mode (see below).

Head_on_a_Stick wrote:

The EFI System Partition should be formatted to FAT32 (or FAT16), the official specification says 512MB but 100-200MB should be fine.

Unless it's changed with the 2.4 spec (which I have yet to read), the EFI spec does not specify a size for the EFI System Partition (ESP), but it does specify that the ESP should be FAT32. The 512MiB figure is mentioned here sometimes because some EFIs seem to have bugs that cause them to be flaky with FAT32 filesystems that are smaller than 512MiB. (Note that's 512MiB, not 512MB; the two aren't the same.)

Also, the EFI spec does say that the ESP must be FAT32. In practice, FAT16 usually works, but some tools and EFIs also flake out with FAT16 ESPs.

Mr Green wrote:

The current ESP that windows uses as far as I can tell is ntfs, roughly 104Mb (sda2)

An ESP can not be NTFS; it must be FAT. The reason is that the ESP must be readable by the firmware, and the only filesystem driver guaranteed to be present in EFI is FAT. Apple includes an HFS+ driver in their EFI implementation, and in fact Macs read the OS X boot loader from an HFS+ volume -- but Apple delights in dancing to the beat of their own drummer. I know of no EFI that includes an NTFS driver, and the Windows installer certainly doesn't create an NTFS ESP. For these reasons, one of two things is almost certainly true:

  • You've omitted or misreported something about your partition table, and in fact you've got a FAT ESP on your disk that your initial report didn't mention.

  • You're not booting in EFI mode, but in BIOS/CSM/legacy mode.

Note that just because a firmware is EFI does not guarantee that it's booting in EFI mode. Most EFIs include a Compatibility Support Module (CSM), which enables them to boot older BIOS boot loaders. The settings for boot mode are quite confusing in many EFIs, so you may be using the CSM even if you think you're not.

Head_on_a_Stick wrote:

If you set the BIOS to boot with UEFI enabled and then put the archlive cd in, it will boot up in EFI mode

Not necessarily. Many EFIs have settings that are about as clear as mud. Enabling EFI support does not always guarantee an EFI-mode boot. That's one of many things that makes supporting EFI on forums like this difficult.

Offline

#15 2014-03-26 08:12:43

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,899
Website

Re: Dual booting Arch with Windows using refind [Solved]

I fully understand that more information would help, working on a uefi booting usb drive.

On that device I have followed uefi guide to create esp

Disk /dev/sdb: 30.2 GiB, 32463912960 bytes, 63406080 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 46BF0DD1-6077-4C11-9D59-1D5AF5FB8332

Device           Start          End   Size Type
/dev/sdb1         2048      1048576   511M EFI System
/dev/sdb2      1050624     63406046  29.8G Linux filesystem

Once I get base installed then will try and add grub-efi to work, provided I remember to mount esp ;-)


Mr Green

Offline

#16 2014-03-26 09:39:25

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,763
Website

Re: Dual booting Arch with Windows using refind [Solved]

Wow thanks for the info Mr. Smith --- you're the man! smile
I was a bit confused because I didnt think windows 7 could boot up in EFI --- my windows 7 installation requires the CSM "Legacy" mode to be enabled...

Offline

#17 2014-03-26 09:59:57

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,899
Website

Re: Dual booting Arch with Windows using refind [Solved]

My laptop drive layout

Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x2c152fed

Device    Boot     Start       End    Blocks  Id System
/dev/sda1           2048  21430271  10714112  27 Hidden NTFS WinRE
/dev/sda2       21430272  21635071    102400   7 HPFS/NTFS/exFAT
/dev/sda3       21635072 545923071 262144000   7 HPFS/NTFS/exFAT
/dev/sda4      545923072 976773167 215425048   5 Extended
/dev/sda5 *    545923135 585924921  20000893+ 83 Linux
/dev/sda6      585924985 976773167 195424091+ 83 Linux

Mr Green

Offline

#18 2014-03-26 10:17:24

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,899
Website

Re: Dual booting Arch with Windows using refind [Solved]

Now when mounting creating and mounting esp I get

root@arch ~]# mkfs.fat -F32 /dev/sdb1
mkfs.fat 3.0.26 (2014-03-07)
[root@arch ~]# mount /dev/sdb1 /mnt/boot/efi
mount: unknown filesystem type 'vfat'

Drive still looks ok

Disk /dev/sdb: 30.2 GiB, 32463912960 bytes, 63406080 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 46BF0DD1-6077-4C11-9D59-1D5AF5FB8332

Device           Start          End   Size Type
/dev/sdb1         2048      1048576   511M EFI System
/dev/sdb2      1050624     63406046  29.8G Linux filesystem
/dev/sdb1: UUID="8FF8-A9D8" TYPE="vfat" PARTLABEL="EFI System" PARTUUID="0c583adb-6f50-4693-8c97-7d90af3743d8" 
/dev/sdb2: UUID="c820a83b-34db-4568-bb0e-2b964cf0806f" TYPE="ext4" PARTLABEL="Linux filesystem" PARTUUID="87606a10-c21c-4e60-a2ee-135ed4fef9bb" 

Mr Green

Offline

#19 2014-03-26 10:22:26

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,763
Website

Re: Dual booting Arch with Windows using refind [Solved]

I think its just

# mount /dev/sda1 /mnt/boot

without the /efi bit...
https://wiki.archlinux.org/index.php/Be … partitions
wink

Offline

#20 2014-03-26 10:33:06

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,899
Website

Re: Dual booting Arch with Windows using refind [Solved]

Well according to wiki grub guide

First, mount the ESP at your preferred mountpoint (usually /boot/efi, hereafter referred to as $esp). On a first install, you will need to mkdir /boot/efi, if that's where you want to mount it.


Mr Green

Offline

#21 2014-03-26 10:35:31

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,763
Website

Re: Dual booting Arch with Windows using refind [Solved]

Oh sorry dood, misunderstood your post sad

Offline

#22 2014-03-26 10:46:21

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,899
Website

Re: Dual booting Arch with Windows using refind [Solved]

Its ok it of course can go to /boot but I went with guide. At the moment it is not mounting for some reason.


Mr Green

Offline

#23 2014-03-26 10:56:14

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,899
Website

Re: Dual booting Arch with Windows using refind [Solved]

Ok so I rebooted and mount  now works so ran grub install

grub-install: info: writing 0x1d400 bytes.
grub-install: info: copying `/boot/grub/x86_64-efi/core.efi' -> `/boot/efi/EFI/grub/grubx64.efi'.
grub-install: info: Registering with EFI: distributor = `grub', path = `\EFI\grub\grubx64.efi', ESP at hostdisk//dev/sdb,gpt1.
grub-install: info: executing efibootmgr --version </dev/null >/dev/null.
grub-install: info: executing modprobe -q efivars.

EFI variables are not supported on this system.

grub-install: info: executing efibootmgr -c -d /dev/sdb -p 1 -w -L grub -l \EFI\grub\grubx64.efi.

EFI variables are not supported on this system.

Installation finished. No error reported.

Last edited by Mr Green (2014-03-26 11:02:40)


Mr Green

Offline

#24 2014-03-26 11:04:44

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,763
Website

Re: Dual booting Arch with Windows using refind [Solved]

So from that it looks like the system is not booted in EFI mode...
Do you have /sys/firmware/efi on the system?
Try this link, it may help wink

Offline

#25 2014-03-26 11:19:33

Mr Green
Forum Fellow
From: U.K.
Registered: 2003-12-21
Posts: 5,899
Website

Re: Dual booting Arch with Windows using refind [Solved]

No I do not, starting to think that the files I saw on windows partition are simply ones from Windows 7 install. System runs bios and loads syslinux fine. Really wanted to try out UEFI for myself. Thing is I have learned quite a bit along the way.  Maybe I should try archinstall media with virtualbox as I kknow it does have uefi support if limited.

Fingers crossed wink


Mr Green

Offline

Board footer

Powered by FluxBB