You are not logged in.

#1 2016-08-12 11:24:11

jsson
Member
Registered: 2015-10-23
Posts: 28

Struggling to install grub

I reacently decided to give arch a fresh reinstall and this time i decided to do follow the wiki and beginners guide directly and not a third party turorial.
I have come as far as installing grub where the whole operation has come to a halt.

My system is running a UEFI motherboard and therefore i have to install the UEFI version of Grub i have created two partitions my root partition and a boot partition. I have created both partitions using cfdisk and i have flagged the boot partition as bootlable and it's typ is EFI.
I have formated the boot partition as FAT32 and mounted it to /mnt/boot.
Both grub and efibootmgr are installed via pacman.

My problem is that i have a hard time understanding what the wiki article about grub means when it says  to:

"First, tell GRUB to use UEFI, set the boot directory and set the bootloader ID. Mount the ESP partition to e.g. /boot or /boot/efi and in the following change esp to that mount point (usually /boot):"

Bellow this is this command:

# grub-install --target=x86_64-efi --efi-directory=esp --bootloader-id=grub

Does the comand i listed above do what the quoted text instucts me to do or do i have to do what the text above says manually? In that case how do i do it?
When i run the command above i recive the error

grub-install:error : failed to get canonical path of 'esp'

Offline

#2 2016-08-12 12:14:32

Starfish
Member
From: Germany
Registered: 2015-10-21
Posts: 133

Re: Struggling to install grub

My guess is that grub-install does not know where the boot directory is.
Try to mount your boot partition to /boot (which is probably the "canonical" path the error message tells you) instead of /mnt/boot and re-run grub-install.
/mnt is a place where you usually mount USB-sticks or external hard drives.

PS.: You might consider adding other partitions, e.g. one for swapping and one solely for the home directory. But that's not mandatory.


"Yesterday is history, tomorrow is a mystery, but today is a gift. That is why it is called the present." - Master Oogway

Offline

#3 2016-08-12 12:20:07

ruonim
Member
Registered: 2016-08-12
Posts: 11

Re: Struggling to install grub

Or second solution arch-chroot  then grub-install

Offline

#4 2016-08-12 12:43:46

jsson
Member
Registered: 2015-10-23
Posts: 28

Re: Struggling to install grub

Starfish wrote:

My guess is that grub-install does not know where the boot directory is.
Try to mount your boot partition to /boot (which is probably the "canonical" path the error message tells you) instead of /mnt/boot and re-run grub-install.
/mnt is a place where you usually mount USB-sticks or external hard drives.

Will tries this!

Starfish wrote:

PS.: You might consider adding other partitions, e.g. one for swapping and one solely for the home directory. But that's not mandatory.

I dont think i need a swap part since i have 8gigs om memory and i have a secondary hard drive that i will use for home when i get the system installed

ruonim wrote:

Or second solution arch-chroot  then grub-install

How else would i do it since i dont have the system fully installed yet?

Last edited by jsson (2016-08-12 12:44:27)

Offline

#5 2016-08-12 12:49:00

ukhippo
Member
From: Non-paged pool
Registered: 2014-02-21
Posts: 366

Re: Struggling to install grub

My emphasis:

"First, tell GRUB to use UEFI, set the boot directory and set the bootloader ID. Mount the ESP partition to e.g. /boot or /boot/efi and in the following change esp to that mount point (usually /boot):"

You need to do what the text tells you.
1) mount the ESP
• did you mount it?
• where? “/boot” “/boot/efi” “/ESP” “/efi” or somewhere else?
2) change esp to that mount point
• it does NOT say run that command as is
• when typing the command you have to type your ESP mount point wherever you see “esp”

Last edited by ukhippo (2016-08-12 12:50:01)

Offline

#6 2016-08-12 12:52:30

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 13,021

Re: Struggling to install grub

The problem is that you shouldn't literally write esp, but the mount point where your directory is mounted to, as mentioned should be /boot after the chroot (check output of mount)

--ninja'd with a much clearer response

Last edited by V1del (2016-08-12 13:20:04)

Offline

#7 2016-08-12 14:14:01

jsson
Member
Registered: 2015-10-23
Posts: 28

Re: Struggling to install grub

ukhippo wrote:

My emphasis:

"First, tell GRUB to use UEFI, set the boot directory and set the bootloader ID. Mount the ESP partition to e.g. /boot or /boot/efi and in the following change esp to that mount point (usually /boot):"

You need to do what the text tells you.
1) mount the ESP
• did you mount it?
• where? “/boot” “/boot/efi” “/ESP” “/efi” or somewhere else?
2) change esp to that mount point
• it does NOT say run that command as is
• when typing the command you have to type your ESP mount point wherever you see “esp”

1. Sorry if this is to stupid of a question but when you say ESP you are talking about the actual partition right? Anyhow i mounted it to /boot/mnt.
2. This is exactly what i sucpected i do think i tried to change out "esp" but i must have gotten it wrong somehow i will trie this.

V1del wrote:

The problem is that you shouldn't literally write esp, but the mount point where your directory is mounted to, as mentioned should be /boot after the chroot (check output of mount)

Will trie this.

V1del wrote:

--ninja'd with a much clearer response

what?

Offline

#8 2016-08-12 15:25:20

ukhippo
Member
From: Non-paged pool
Registered: 2014-02-21
Posts: 366

Re: Struggling to install grub

ESP stands for “EFI System Partition”, so yes the ESP is the partition.

You'll save yourself a lot of future grief if you have your ESP mounted as /boot.
During installation you have to set up your hierarchy under /mnt for arch-chroot, so you mount it on /mnt/boot.
Once inside the arch-chroot it will appear as /boot

Offline

#9 2016-08-12 16:00:03

ruonim
Member
Registered: 2016-08-12
Posts: 11

Re: Struggling to install grub

jsson wrote:
Starfish wrote:

My guess is that grub-install does not know where the boot directory is.
Try to mount your boot partition to /boot (which is probably the "canonical" path the error message tells you) instead of /mnt/boot and re-run grub-install.
/mnt is a place where you usually mount USB-sticks or external hard drives.

Will tries this!

Starfish wrote:

PS.: You might consider adding other partitions, e.g. one for swapping and one solely for the home directory. But that's not mandatory.

I dont think i need a swap part since i have 8gigs om memory and i have a secondary hard drive that i will use for home when i get the system installed

ruonim wrote:

Or second solution arch-chroot  then grub-install

How else would i do it since i dont have the system fully installed yet?

You only need pacstrap base at /mnt to chain root.

Minimal bootable system on uefi mode (+networkmanager - all popular dektop enviroment use this for applets on panel):

cfdsik /dev/sda (<- gpt 250mb 1st partition, rest space 2nd partition)
makefs.ext4 /dev/sda2
mount /dev/sda1 /mnt
makefs.fat -F32 /dev/sda1
mkdir /mnt/boot
mount /dev/sda1 /mnt/boot
genfstab -U /mnt >> /mnt/etc/fstab
pacstrap /mnt base grub networkmanager
arch-chroot /mnt
passwd
systemctl enable NetworkManager.service (<- big letters matter)
grub-install /dev/sda1
grub-mkconfig
exit
reboot

Offline

#10 2016-08-13 11:58:01

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: Struggling to install grub

jsson you need to read more. The GRUB wiki page clearly says "and in the following change esp to that mount point (usually /boot)".

Also, if you are following the Beginners' Guide or Installation Guide you will already have chroot.

@ruonim: Don't spoonfeed. The Installation Guide exists for a reason.


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#11 2016-08-13 22:02:26

jsson
Member
Registered: 2015-10-23
Posts: 28

Re: Struggling to install grub

When i was trying to install grub this morning i managed to somehow choose the wrong disk to format and therefore broke my windows install....

Anyhow i was trying a bunch of diffrent mountpoints and methods to get grub installed, i even tried systemd with same results. At this point i dont realy know how i should procede since i've read all the relevant wikipages and googles for quite a while without any progress.
I must be missing something somwhere, this is the ways i've tried:
1. Formating my boot partition via cfdisk, it's size is 620 MB and it's type is efi i've also set the bootflag.
2. Making the file system with:

 mkfs.fat -F32 /dev/sdb2

3. Mounting the partition with(also tried with /boot and /boot/efi) :

mount /dev/sdb2 /mnt/boot

4. Generating fstab
5. Chrooting into the system.
6. Installing grub and efibootmgr via pacman.
7. Running the grub install with (yes i've changed /boot to /boot/efi and /mnt/boot when mounted there) :

# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub

While trying this a couple of times i've gotten two diffrent outcomes:
The first one is

GUID Partition Table Header signature is wrong: 41615252 != 5452415020494645
GUID Partition Table Header signature is wrong: 0 != 5452415020494645
Installation successfull withount any errors 

After this i've generated the grub config file and when trying to boot i recive and error

reboot and select a boot device or insert a bootable media

The second outcome of grub-install is

That partiton does not look like an EFI partition

On the wiki it says that the partition is most likely not Fat32. When checking with cfdisk it says that the partition has a vfat filesystem and when checking with parted it says that it is a FAT32 system.

Do you guys see any obvious error that i make or anything please let me know, i havent done as much research as i would have like to do before asking on the forum but i hade to go and reinstall windows since i managed to missclick in cfdisk and broke the partition...

Offline

#12 2016-08-13 22:39:12

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 5,838
Website

Re: Struggling to install grub

Rather than trying all the methods you can find at the same time, why not pick one method and attempt to troubleshoot things methodically instead?

I recommend trying systemd-boot first, this requires that the EFI system partition contains the kernel image & initramfs along with any configuration files -- I suggest that you check that this is the case.

Please post the full output of:

# parted -l

This will confirm the partition types.

You can use a pastebin client to generate a URL from the command output that can be posted here.
https://wiki.archlinux.org/index.php?ti … in_clients

You should also post your systemd-boot configuration file and the commands used to install it.

Offline

#13 2016-08-14 11:34:26

jsson
Member
Registered: 2015-10-23
Posts: 28

Re: Struggling to install grub

Head_on_a_Stick wrote:

Rather than trying all the methods you can find at the same time, why not pick one method and attempt to troubleshoot things methodically instead?

I recommend trying systemd-boot first, this requires that the EFI system partition contains the kernel image & initramfs along with any configuration files -- I suggest that you check that this is the case.

Please post the full output of:

# parted -l

This will confirm the partition types.

You can use a pastebin client to generate a URL from the command output that can be posted here.
https://wiki.archlinux.org/index.php?ti … in_clients

You should also post your systemd-boot configuration file and the commands used to install it.

I tried systemd-boot this morning and when running the

 bootctl --path=/boot install 

I recive and error where it says that the partiton does not look like an FAT EFI partition.
This is the output of parted -l https://ptpb.pw/ELBM
/dev/sdb is the drive i'm trying to install to, /dev/sdb1 it root and /dev/sdb2 is /boot

Before trying to install i copied the kernel and intrams to the esp with

# mkdir -p esp/EFI/arch
# cp /boot/vmlinuz-linux esp/EFI/arch/vmlinuz-linux
# cp /boot/initramfs-linux.img esp/EFI/arch/initramfs-linux.img
# cp /boot/initramfs-linux-fallback.img esp/EFI/arch/initramfs-linux-fallback.img

Offline

#14 2016-08-14 15:58:47

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 5,838
Website

Re: Struggling to install grub

jsson wrote:

I tried systemd-boot this morning and when running the

 bootctl --path=/boot install 

I recive and error where it says that the partiton does not look like an FAT EFI partition.

Did you check the output of `lsblk` to confirm that /boot was mounted to the ESP?

This is the output of parted -l https://ptpb.pw/ELBM

You appear to have a Windows system installed on /dev/sda which has it's own EFI system partition (/dev/sda2).

In such cases, it is generally recommended to use the Windows-generated ESP for the Arch system also -- I think that you should try that.

Before trying to install i copied the kernel and intrams to the esp with

# mkdir -p esp/EFI/arch
# cp /boot/vmlinuz-linux esp/EFI/arch/vmlinuz-linux
# cp /boot/initramfs-linux.img esp/EFI/arch/initramfs-linux.img
# cp /boot/initramfs-linux-fallback.img esp/EFI/arch/initramfs-linux-fallback.img

That is slightly confusing hmm

Did you mount /dev/sdb2 to this local esp/EFI/arch directory before running those commands?

If the ESP was mounted to /boot when the base group was installed with `pacstrap` then the kernel image & initramfs should already be there -- have you checked this?

Offline

#15 2016-08-14 18:56:04

jsson
Member
Registered: 2015-10-23
Posts: 28

Re: Struggling to install grub

Head_on_a_Stick wrote:

Did you check the output of `lsblk` to confirm that /boot was mounted to the ESP?

Just to make things clear ESP=dev/sdb2 right? and in that case should'nt /dev/sdb2 be mounted to /boot and not the other way around? hmm

You appear to have a Windows system installed on /dev/sda which has it's own EFI system partition (/dev/sda2).
In such cases, it is generally recommended to use the Windows-generated ESP for the Arch system also -- I think that you should try that.

I rather not do that since i want to keep the two systems separated from each other.

Did you mount /dev/sdb2 to this local esp/EFI/arch directory before running those commands?

No it was mounted to /boot like it says on the wiki

If the ESP was mounted to /boot when the base group was installed with `pacstrap` then the kernel image & initramfs should already be there -- have you checked this?

No i havent checked that since it says on the systemd wiki to copy the files there

Offline

#16 2016-08-14 20:38:28

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 5,838
Website

Re: Struggling to install grub

jsson wrote:

should'nt /dev/sdb2 be mounted to /boot and not the other way around? hmm

That is a meaningless question, the two statements ("/boot should be mounted to the ESP" & "the ESP should be mounted to /boot") mean exactly the same thing.

Before running the `bootctl` command, check your mountpoints with:

findmnt

Did you mount /dev/sdb2 to this local esp/EFI/arch directory before running those commands?

No it was mounted to /boot like it says on the wiki

Well then the kernel image & initramfs should already be on the EFI system partition.

If the ESP was mounted to /boot when the base group was installed with `pacstrap` then the kernel image & initramfs should already be there -- have you checked this?

No i havent checked that since it says on the systemd wiki to copy the files there

Is the kernel image & initramfs present on the EFI system partition?

Offline

#17 2016-08-15 12:40:32

jsson
Member
Registered: 2015-10-23
Posts: 28

Re: Struggling to install grub

Head_on_a_Stick wrote:

Before running the `bootctl` command, check your mountpoints with:

findmnt

Did this and it turns out that only the root partition is mounted. Altough when exiting out of chroot and running lsblk it says that the boot partiton i mounted to /boot.

I also noticed that when doing the installation with boot partition mounted to /boot the partition did not show in fstab but when having it mounted to /mnt/boot it does.

Edit: Clarification: When having the boot partition mounted to /mnt/boot and doing the whole installation with pactstrap and generating fstab the boot partiton shows in the fstab.
Altough when having the boot partition mounted to /boot and doing pacstrap and generating fstab it does not.

Well then the kernel image & initramfs should already be on the EFI system partition.

I checked by navigating with cd /boot and checking with ls and yes they where there.

Last edited by jsson (2016-08-15 12:44:24)

Offline

#18 2016-08-15 21:24:00

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 5,838
Website

Re: Struggling to install grub

jsson wrote:

Did this and it turns out that only the root partition is mounted. Altough when exiting out of chroot and running lsblk it says that the boot partiton i mounted to /boot.

Please post the exact commands that you used to mount your partitions and enter the chroot.

When having the boot partition mounted to /mnt/boot and doing the whole installation with pactstrap and generating fstab the boot partiton shows in the fstab.
Altough when having the boot partition mounted to /boot and doing pacstrap and generating fstab it does not.

I need to know *all* of the commands used when installing the systemn and the exact order in which they were run, a vague description doesn't really help me.

Mounting the EFI system partition to /boot makes no sense at all, why would you do that? Did you try that before or after entering the chroot?

Also, let's see what is actually present on the ESP:

# mount /dev/sdb2 /mnt
# find /mnt

Finally, your desire to keep separate ESPs for Windows and Arch may encounter other problems:
https://bbs.archlinux.org/viewtopic.php?id=215931

As I said, a single, shared ESP is the recommended approach.

Offline

#19 2016-08-15 21:27:12

ukhippo
Member
From: Non-paged pool
Registered: 2014-02-21
Posts: 366

Re: Struggling to install grub

@jsson:
It seems like you don't understand what a chroot is. See https://wiki.archlinux.org/index.php/Change_root

Also the Beginners' guide — Mount the partitions uses the boot partition in an example. The Change root wiki page also has a section about mounting partitions

Last edited by ukhippo (2016-08-15 21:28:41)

Offline

#20 2016-08-16 00:18:16

BlahBlahBlase
Member
From: Tucson, AZ
Registered: 2015-09-15
Posts: 35

Re: Struggling to install grub

I tried systemd-boot this morning and when running the
bootctl --path=/boot install
I recive and error where it says that the partiton does not look like an FAT EFI partition.

I've had this issue before and I was able to fix it in my BIOS by disabling legacy boot. Does

efivars -l

return an error?


"Full disclosure, I'm drunk right now. And if you can't handle that, you can't handle science."

Offline

Board footer

Powered by FluxBB