You are not logged in.

#1 2016-07-15 09:01:00

Dmoney
Member
Registered: 2016-06-21
Posts: 6

[SOLVED] Did not mount efi partition to /mnt/boot at install

I'm new to Linux and I've been using arch for a couple weeks now on my desktop with windows. Windows always boots first and to boot grub i have to manually select the hard drive i installed arch onto. Also grub doesn't display the windows boot manager at all.

Today i installed arch on my laptop (with windows 8) following the beginners guide and grub had no problem booting first and recognizing the windows boot manager.  During the installation on my laptop i mounted the efi partition that windows created to /mnt/boot which i DID NOT do on my main desktop installation.

I only have two fstab entries in /etc/fstab on my desktop here:

 # /etc/fstab: static file system information
#
# <file system> <dir>   <type>  <options>       <dump>  <pass>
# /dev/sdb3
UUID=570328db-0be1-4509-97ab-f3a9ad36e937       /               ext4            $

# /dev/sdb5
UUID=2394f0bf-7ce4-4785-9357-b30eb4338c07       none            swap            $

whereas on my laptop which i just installed arch on has 3 fstab entries with the third one being the efi partition that is mounted to /boot properly.

lsblk -f displays this on my desktop:

lsblk -f
NAME   FSTYPE LABEL      UUID                                 MOUNTPOINT
sda                                                           
├─sda1 ntfs   Recovery   3CAC8C5DAC8C1394                     
├─sda2 vfat              668D-BF32                            
├─sda3                                                        
└─sda4 ntfs              10EE9015EE8FF170                     
sdb                                                           
├─sdb1 ntfs   Soft Drive 7A02A6DA02A69B21                     
├─sdb2                                                        
├─sdb3 ext4              570328db-0be1-4509-97ab-f3a9ad36e937 /
└─sdb5 swap              2394f0bf-7ce4-4785-9357-b30eb4338c07 [SWAP]

Is there a way i can mount /dev/sda2 and regenerate my fstab without reinstalling?

Last edited by Dmoney (2016-07-18 12:06:33)

Offline

#2 2016-07-15 09:47:57

robg
Member
Registered: 2015-03-05
Posts: 218

Re: [SOLVED] Did not mount efi partition to /mnt/boot at install

You can mount the EFI partition onto boot by

mount /dev/sda2 /boot

(1)

and make things permanent by running genfstab. Note that due to the way mount works, (1) will result in the current contents of /boot being overlayed by what's in /dev/sda2. You can revert by simply calling umount /boot. Of course you will then need to reinstall GRUB e.t.c.

If dualbooting with Windows is your only goal I recommend you have a look at systemd-boot which has a particularly easy setup.

Last edited by robg (2016-07-15 09:48:49)

Offline

#3 2016-07-15 10:10:32

Dmoney
Member
Registered: 2016-06-21
Posts: 6

Re: [SOLVED] Did not mount efi partition to /mnt/boot at install

I ran mount /dev/sda2 /boot , but when i run genfstab im getting:

-bash: genfstab: command not found
do i need to put something like

 genfstab -U >> /etc/fstab 

Last edited by Dmoney (2016-07-15 10:12:50)

Offline

#4 2016-07-15 10:29:09

robg
Member
Registered: 2015-03-05
Posts: 218

Re: [SOLVED] Did not mount efi partition to /mnt/boot at install

genfstab is part of the package arch-install-scripts. In your case the command should rather be

genfstab -U > /etc/fstab

(> : Overwrite >> : Append)

In any case, adding this one entry to fstab can be of course be easily done by editing /etc/fstab manually smile

Offline

#5 2016-07-16 09:03:55

Dmoney
Member
Registered: 2016-06-21
Posts: 6

Re: [SOLVED] Did not mount efi partition to /mnt/boot at install

I installed the arch-installer-scripts package.
Would grub work if i made a directory called /boot/efi to not overwrite /boot?  I would run

mount /dev/sda2 /boot/efi 

  then run

genfstab -U > /etc/fstab

  and reinstall grub this time using the UEFI method, i would put

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub
grub-mkconfig -o /boot/grub/grub.cfg 

Offline

#6 2016-07-16 14:16:19

alive4ever
Member
Registered: 2016-07-10
Posts: 65

Re: [SOLVED] Did not mount efi partition to /mnt/boot at install

Dmoney wrote:

I installed the arch-installer-scripts package.
Would grub work if i made a directory called /boot/efi to not overwrite /boot?  I would run

mount /dev/sda2 /boot/efi 

  then run

genfstab -U > /etc/fstab

  and reinstall grub this time using the UEFI method, i would put

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub
grub-mkconfig -o /boot/grub/grub.cfg 

You should copy all boot files inside /boot to /boot/efi, especially vmlinuz-linux, initramfs-linux.img, initramfs-linux-fallback.img, and intel-ucode.img.
After that, you can unmount /boot/efi and mount /dev/sda2 over /boot directly. You may install efi grub afterwards, pointing /boot as efi directory.
Just don't forget to add /boot fstab entry via genfstab or manually to simplify updating boot files, especially whenever a new kernel is released.

Offline

#7 2016-07-16 14:58:02

Dmoney
Member
Registered: 2016-06-21
Posts: 6

Re: [SOLVED] Did not mount efi partition to /mnt/boot at install

Alright, i have linux-git installed for my GPU to work properly so my /boot looks like this

ls /boot
grub				  initramfs-linux-git.img  vmlinuz-linux
initramfs-linux-fallback.img	  initramfs-linux.img	   vmlinuz-linux-git
initramfs-linux-git-fallback.img  intel-ucode.img

should i copy every single boot file into the /boot/efi folder that i'll make or just the linux-git related ones?

edit:I mounted the EFI partition to /boot then I installed EFI grub after and the EFI partition shows its mounted when I reboot with lsblk

 NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 232.9G  0 disk 
├─sda1   8:1    0   450M  0 part 
├─sda2   8:2    0   100M  0 part /boot
├─sda3   8:3    0    16M  0 part 
└─sda4   8:4    0 232.3G  0 part 
sdb      8:16   0   1.8T  0 disk 
├─sdb1   8:17   0   1.2T  0 part 
├─sdb2   8:18   0     1K  0 part 
├─sdb3   8:19   0 603.6G  0 part /
└─sdb5   8:21   0   1.9G  0 part [SWAP]

but windows still boots first.

when installing grub i got "EFI variables are not supported on this system."

 # grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub
Installing for x86_64-efi platform.
efibootmgr: EFI variables are not supported on this system.
efibootmgr: EFI variables are not supported on this system.
Installation finished. No error reported.

this is the output from grub-mkconfig -o /boot//grub/grub.cfg

  grub-mkconfig -o /boot//grub/grub.cfg
Generating grub configuration file ...
Found Intel Microcode image
Found linux image: /boot/vmlinuz-linux-git
Found initrd image: /boot/initramfs-linux-git.img
Found fallback initramfs image: /boot/initramfs-linux-git-fallback.img
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/initramfs-linux.img
Found fallback initramfs image: /boot/initramfs-linux-fallback.img
done

My pc doesn't boot in UEFI mode when booting arch how can i fix this?

Last edited by Dmoney (2016-07-16 16:13:42)

Offline

#8 2016-07-17 12:52:32

robg
Member
Registered: 2015-03-05
Posts: 218

Re: [SOLVED] Did not mount efi partition to /mnt/boot at install

Dmoney wrote:

edit:I mounted the EFI partition to /boot then I installed EFI grub after and the EFI partition shows its mounted when I reboot with lsblk

That output looks good.

Dmoney wrote:

when installing grub i got "EFI variables are not supported on this system."

This appears to be the issue. GRUB is unable give itself precedence over the Windows Boot Manager. Unfortunately I'm not familiar with efivars. Have you already looked into this? The first result in Google for instance shows this.

Dmoney wrote:

this is the output from grub-mkconfig -o /boot//grub/grub.cfg

This doesn't look quite right. GRUB should recognize the Windows entry. Have you installed os-prober?

Offline

#9 2016-07-17 21:29:50

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

Re: [SOLVED] Did not mount efi partition to /mnt/boot at install

alive4ever wrote:

You should copy all boot files inside /boot to /boot/efi, especially vmlinuz-linux, initramfs-linux.img, initramfs-linux-fallback.img, and intel-ucode.img.

This is *not* required.

Dmoney wrote:

should i copy every single boot file into the /boot/efi folder

No.

I would recommend simply mounting the (empty) EFI system partition to /boot then re-installing your kernel package and GRUB (with `grub-install`), this should populate the partition with the necessary files.

EDIT: the EFI system partition should *not* be empty, it should contain the Windows files under $ESP/EFI/Microsoft

To generate an fstab entry, I would use this command after running `mount /dev/sda2 /boot`:

grep sda2 /proc/self/mounts >> /etc/fstab

But I am lazy and the correct approch would be to write the entry yourself with reference to fstab(5) & mount(8)

However, if systemd-boot is used instead of GRUB then no fstab entry is needed as systemd will automount (and auto-umount) the ESP.

Another advantage of systemd-boot is that Windows is picked up and a menu entry is generated for it automagically with no need to install os-prober.

See https://wiki.archlinux.org/index.php/Systemd-boot

Dmoney wrote:
efibootmgr: EFI variables are not supported on this system.

This error occurs because you are not booted in UEFI mode so a new NVRAM entry to boot your system cannot be made.

The Arch live ISO image will boot in UEFI mode, ensure that "CSM" or "Legacy" mode is disabled in your firmware ("BIOS") options and that UEFI is enabled.

Alternatively, add the "--removable" flag to the `grub-install` command to copy the GRUB .efi loader to the default location ($ESP/EFI/BOOT/BOOTX64.EFI) that should be recognised by your firmware ("BIOS") [1]

[1] Fingers crossed! hmm

Last edited by Head_on_a_Stick (2016-07-17 21:36:17)

Offline

#10 2016-07-18 11:59:46

Dmoney
Member
Registered: 2016-06-21
Posts: 6

Re: [SOLVED] Did not mount efi partition to /mnt/boot at install

My problem is fixed! Grub boots first and recognizes the windows boot manager.I booted into the arch live iso mounted all the proper partitions and reinstalled grub.The grub-install command issued no errors at all, but when i ran grub-mkconfig it issued a couple errors that i could not copy and paste.I then unmounted and rebooted, grub was able to boot first but there was no windows entry. I booted up arch just fine ran grub-mkconfig again to see if there would be errors i could copy paste but i got this

# grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found Intel Microcode image
Found linux image: /boot/vmlinuz-linux-git
Found initrd image: /boot/initramfs-linux-git.img
Found fallback initramfs image: /boot/initramfs-linux-git-fallback.img
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/initramfs-linux.img
Found fallback initramfs image: /boot/initramfs-linux-fallback.img
Found Windows Boot Manager on /dev/sda2@/EFI/Microsoft/Boot/bootmgfw.efi
done

I rebooted again and saw the windows entry in grub, thanks for the help everyone.

Offline

Board footer

Powered by FluxBB