You are not logged in.

#1 2014-07-21 11:07:04

Devenda
Member
Registered: 2014-07-21
Posts: 20

Trouble installing GRUB on Windows dualboot

When trying to install GRUB I ran into some problems:

I followed the instructions  found on the wiki for a UEFI system.

But I got stuck on:

First, mount the ESP at your preferred mountpoint (usually /boot/efi, hereafter referred to as $esp).

I found that there was no EFI entry in fstab:

#
# /etc/fstab: static file system information
#
# <file system> <dir>   <type>  <options>       <dump>  <pass>
# /dev/sda5
UUID=c1822e3c-e037-4445-bdd8-b71778237dee       /               ext4            rw,relatime,data=ordered        0 1

# /dev/sda2 LABEL=SYSTEM_DRV
UUID=D2DF-9F74          /boot           vfat            rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro    0 2

# /dev/sda5
#UUID=c1822e3c-e037-4445-bdd8-b71778237dee      /               ext4            rw,relatime,data=ordered        0 1

# /dev/sda2 LABEL=SYSTEM_DRV
#UUID=D2DF-9F74         /boot           vfat            rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro    0 2

I than manually changed /boot to /boot/efi and was able to mount /boot/efi

but than

grub-install --target=x86_64-efi --efi-directory=$esp --bootloader-id=grub --recheck --debug

gave:

Installing for x86_64-efi platform.
grub-install: info: cannot open `/boot/grub/device.map': No such file or directory.
grub-install: error: failed to get canonical path of `'.

I would normally search further on the Internet/experiment on my own but this seemed to risky and I do not want to lose my windows boot entry.

Offline

#2 2014-07-21 12:29:26

sugartest
Member
Registered: 2014-07-09
Posts: 38

Re: Trouble installing GRUB on Windows dualboot

Did you just try changing "$esp" to

/boot/efi

?
Or refering to the whole UEFI documentation here ?
Maybe your case is quite specific and harware / UEFI implementation related if so check here.
Your problem might be related to one of these cases.

Silly question here:
How come that that there's 2 "vfat" partitions and two of each /dev/sdaX in your fstab?

Anyway if there was no UEFI partition you have to CREATE one from what I understood since you have to mount it, relocating it in a subfolder of the /boot isn't the solution to your problem.

I hope I was of some help.

Last edited by sugartest (2014-07-21 12:38:58)


An Arch Linux enthousiast and a Linux fan in general, mostly interrested in command line use, security issues, code learning and networks.

Offline

#3 2014-07-21 12:49:26

Devenda
Member
Registered: 2014-07-21
Posts: 20

Re: Trouble installing GRUB on Windows dualboot

sugartest wrote:

Did you just try changing "$esp" to

/boot/efi

?
Or refering to the whole UEFI documentation here ?
Maybe your case is quite specific and harware / UEFI implementation related if so check here.
Your problem might be related to one of these cases.

Silly question here:
How come that that there's 2 "vfat" partitions and two of each /dev/sdaX in your fstab?

Anyway if there was no UEFI partition you have to CREATE one from what I understood since you have to mount it, relocating it in a subfolder of the /boot isn't the solution to your problem.

I hope I was of some help.

With:

mount /boot/efi /boot/efi

I just get:

mount:  /boot/efi is not a block device

I commented the other entries out, I think I did something wrong when installing and ended up with duplicated entries.

Offline

#4 2014-07-21 13:17:39

loqs
Member
Registered: 2014-03-06
Posts: 17,196

Re: Trouble installing GRUB on Windows dualboot

Did you set $esp to /boot/efi?
If you want the ESP mounted at /boot/efi change the fstab entry to /boot/efi from /boot
unmount /dev/sda2 from /boot
mkdir /boot/efi
mount /dev/sda2 /boot/efi
move from /boot/efi back to /boot the following: vmlinuz-linux initramfs-linux.img initramfs-linux-fallback.img ( anything related to grub )
repeat the grub-install with either $esp set or replace $esp with /boot/efi
Edit:
Its probably better to remove anything grub related, regenerate the config and let grub-install copy the needed files to the correct locations

Last edited by loqs (2014-07-21 13:25:44)

Offline

#5 2014-07-21 13:41:36

Devenda
Member
Registered: 2014-07-21
Posts: 20

Re: Trouble installing GRUB on Windows dualboot

loqs wrote:

Did you set $esp to /boot/efi?
If you want the ESP mounted at /boot/efi change the fstab entry to /boot/efi from /boot
unmount /dev/sda2 from /boot
mkdir /boot/efi
mount /dev/sda2 /boot/efi
move from /boot/efi back to /boot the following: vmlinuz-linux initramfs-linux.img initramfs-linux-fallback.img ( anything related to grub )
repeat the grub-install with either $esp set or replace $esp with /boot/efi
Edit:
Its probably better to remove anything grub related, regenerate the config and let grub-install copy the needed files to the correct locations

I thought /boot/efi already existed (but can't check because cd boot gives me a permission denied). Isn't this where the windows boot entry resides?
Will any of the listed commands harm my windows installation?

Last edited by Devenda (2014-07-21 13:41:50)

Offline

#6 2014-07-21 13:50:26

loqs
Member
Registered: 2014-03-06
Posts: 17,196

Re: Trouble installing GRUB on Windows dualboot

The Windows boot files should exist on the ESP.  If the ESP is mounted at /boot/efi the Windows files would be under /boot/efi/EFI/Microsoft/Boot.
Odd that you can not cd to /boot even if you were not attempting it as root
None of the commands is designed to harm the Windows installation but I can not guarantee it.
I personally would use refind instead as the boot loader as I find that simpler to manage than grub but both should work without damage Windows.

Offline

#7 2014-07-21 13:54:30

Devenda
Member
Registered: 2014-07-21
Posts: 20

Re: Trouble installing GRUB on Windows dualboot

Strangely I have these two entries in /proc/mounts:

/dev/sda2 /boot vfat rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0
/dev/sda2 /boot/efi vfat rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0

Offline

#8 2014-07-21 13:56:07

Devenda
Member
Registered: 2014-07-21
Posts: 20

Re: Trouble installing GRUB on Windows dualboot

loqs wrote:

The Windows boot files should exist on the ESP.  If the ESP is mounted at /boot/efi the Windows files would be under /boot/efi/EFI/Microsoft/Boot.
Odd that you can not cd to /boot even if you were not attempting it as root
None of the commands is designed to harm the Windows installation but I can not guarantee it.
I personally would use refind instead as the boot loader as I find that simpler to manage than grub but both should work without damage Windows.

I was able to cd to boot after

sudo su

and found boot containing those files and also containing /efi (which also contained those files).

Offline

#9 2014-07-21 13:58:48

Devenda
Member
Registered: 2014-07-21
Posts: 20

Re: Trouble installing GRUB on Windows dualboot

loqs wrote:

The Windows boot files should exist on the ESP.  If the ESP is mounted at /boot/efi the Windows files would be under /boot/efi/EFI/Microsoft/Boot.
Odd that you can not cd to /boot even if you were not attempting it as root
None of the commands is designed to harm the Windows installation but I can not guarantee it.
I personally would use refind instead as the boot loader as I find that simpler to manage than grub but both should work without damage Windows.

Is installing rEFInd really that easy as the wiki says it is?

Install refind-efi from the Official repositories. Then run

# refind-install

This should detect your kernel and EFI system partition, copy any necessary files to the ESP, create default configuration files, and set rEFInd as the default UEFI boot entry.

Offline

#10 2014-07-21 14:00:38

loqs
Member
Registered: 2014-03-06
Posts: 17,196

Re: Trouble installing GRUB on Windows dualboot

From that you have /dev/sda2 mounted twice at /boot then within itself at /boot/efi
After umounting both of these mounts

umount /boot/efi
umount /boot

Then you can mount /dev/sda2 at /boot/efi,  creating /boot/efi if needed
/boot/efi will then contain the combined contents of the old /boot and /boot/efi which is why I was suggesting some files will need to be moved back into /boot

Offline

#11 2014-07-21 14:10:46

Devenda
Member
Registered: 2014-07-21
Posts: 20

Re: Trouble installing GRUB on Windows dualboot

loqs wrote:

From that you have /dev/sda2 mounted twice at /boot then within itself at /boot/efi
After umounting both of these mounts

umount /boot/efi
umount /boot

Then you can mount /dev/sda2 at /boot/efi,  creating /boot/efi if needed
/boot/efi will then contain the combined contents of the old /boot and /boot/efi which is why I was suggesting some files will need to be moved back into /boot

Many thanks for the help!
As you said I just installed rEFIned which was extremely easy and works perfectly!

Last edited by Devenda (2014-07-21 14:10:59)

Offline

Board footer

Powered by FluxBB