You are not logged in.

#1 2019-02-10 23:38:49

edoelas
Member
Registered: 2018-04-27
Posts: 56

[SOLVED] GRUB does not start after installation

I'm trying to install arch following the wiki steps:
-  I have created the partitions (I'm using the /dev/sda disk)

Disk /dev/sda: 232.9 GiB, 250059350016 bytes, 488397168 sectors
Disk model: Samsung SSD 850
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: CA67FF88-3018-4446-B3A5-C8E7B2C5B5C4
 
Device       Start       End   Sectors  Size Type
/dev/sda1     2048   1128447   1126400  550M EFI System
/dev/sda2  1128448 210843647 209715200  100G Linux filesystem
 
 
Disk /dev/sdb: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: TOSHIBA MQ01ABD1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x5c308dfe
 
 
Disk /dev/sdc: 14.4 GiB, 15472047104 bytes, 30218842 sectors
Disk model: DataTraveler 3.0
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: 0x0007fe05
 
Device     Boot Start      End  Sectors  Size Id Type
/dev/sdc1  *     2048 30218841 30216794 14.4G  c W95 FAT32 (LBA)
 
 
Disk /dev/loop0: 442.1 MiB, 463548416 bytes, 905368 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

- I have mounted the file system

mount /dev/sda2 /mnt

- I have installed the base package group

pacstrap /mnt base

- Then chroot

 arch-chroot /mnt 

- Installed  the packages grub and efibootmgr:

pacman -S grub efibootmgr

- Mounted the EFI partition:

mount /dev/sda1 /efi 

- Executed grub-install:

grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=GRUB

- Generate the main configuration file:

grub-mkconfig -o /boot/grub/grub.cfg

Then I reboot the system but anything bootable is detected. I supose I mising an importante step.

I'm not sure which commands output would be useful to show here, so just tell me and as fast as posible I will edit the main post with it.

efibootmgr -v

BootCurrent: 0000
Timeout: 2 seconds
BootOrder: 2001,2002,2003
Boot0000* USB HDD: KingstonDataTraveler 3.0 PciRoot(0x0)/Pci(0x14,0x0)/USB(1,0)/HD(1,MBR,0x7fe05,0x800,0x1cd125a)RC
Boot0001* GRUB  HD(1,GPT,c502e89e-3003-2f47-ae02-e8f8bb1f34fc,0x800,0x113000)/File(\EFI\GRUB\grubx64.efi)
Boot0002* boot  HD(1,GPT,c502e89e-3003-2f47-ae02-e8f8bb1f34fc,0x800,0x113000)/File(\EFI\GRUB\grubx64.efi)
Boot0005* Unknown Device:   HD(2,GPT,410a1c03-49b0-40af-99e7-a39c3370224f,0x12c800,0x96000)/File(\EFI\ubuntu\shimx64.efi)RC
Boot0006* Unknown Device:   HD(2,GPT,410a1c03-49b0-40af-99e7-a39c3370224f,0x12c800,0x96000)/File(\EFI\ubuntu\shimx64.efi)RC
Boot0007* Unknown Device:   HD(2,GPT,410a1c03-49b0-40af-99e7-a39c3370224f,0x12c800,0x96000)/File(\EFI\ubuntu\shimx64.efi)RC
Boot0008* Unknown Device:   HD(2,GPT,410a1c03-49b0-40af-99e7-a39c3370224f,0x12c800,0x96000)/File(\EFI\ubuntu\shimx64.efi)RC
Boot000D* ubuntu    HD(2,GPT,410a1c03-49b0-40af-99e7-a39c3370224f,0x12c800,0x96000)/File(\EFI\ubuntu\shimx64.efi)
Boot2001* EFI USB Device    RC
Boot2002* EFI DVD/CDROM RC
Boot2003* EFI Network   RC

Last edited by edoelas (2019-02-16 18:06:32)

Offline

#2 2019-02-11 14:38:24

Trianda
Member
Registered: 2019-01-24
Posts: 25

Re: [SOLVED] GRUB does not start after installation

I have no idea. Just want to say that you are missing the final g in grub.cfg.

grub-mkconfig -o /boot/grub/grub.cf

Offline

#3 2019-02-11 15:13:01

edoelas
Member
Registered: 2018-04-27
Posts: 56

Re: [SOLVED] GRUB does not start after installation

Thanks, it has already been edited.

Offline

#4 2019-02-11 17:52:29

Rydberg95
Member
From: Stockholm, Sweden
Registered: 2013-01-25
Posts: 51

Re: [SOLVED] GRUB does not start after installation

edoelas wrote:

I
- Executed grub-install:

grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=GRUB

If the commands you listed are the only ones you run, it will have to do with your EFI-partition (/dev/sda1) not being mounted. With the grub-install command,  your are installing grub in your root directory of the /dev/sda2 partition. Therefore, when your system boots and looks for bootloaders in the /dev/sda1 partition, it will not find your GRUB installation.

Now, try mounting your EFI-partition before installing GRUB:

mnt /dev/sda1 /boot

After that, install GRUB in the mounted folder:

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

Don't forget to create a new config in this folder before rebooting:

grub-mkconfig -o /boot/grub/grub.cfg

Good luck!

Offline

#5 2019-02-11 21:10:31

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

Re: [SOLVED] GRUB does not start after installation

Rydberg95 wrote:

it will have to do with your EFI-partition (/dev/sda1) not being mounted

The OP did mount the ESP, check their post again.

@OP: I presume you have disabled Secure Boot?

If so then try setting the Arch boot entry as first in the boot order:

# efibootmgr -o 0001,2001,2002,2003

In case of failure, note that there have been threads in which too many NVRAM entries caused problems so deleting some of them might help:

# efibootmgr -b xxxx -B

Replace xxxx with the boot number to be deleted.

If that still doesn't work then try copying /EFI/GRUB/grubx64.efi to /EFI/BOOT/bootx64.efi (on the EFI system partition), if your UEFI firmware is particularly defective then you may have to use /EFI/Microsoft/Boot/bootmgfw.efi

See https://www.rodsbooks.com/efi-bootloade … ive-naming for more on this.

Offline

#6 2019-02-11 21:25:44

Rydberg95
Member
From: Stockholm, Sweden
Registered: 2013-01-25
Posts: 51

Re: [SOLVED] GRUB does not start after installation

My bad. Although it looks like /dev/sda1 is mounted at /efi. However, the EFI directory is usually a in the ESP. This surely must matter, since in OP:s command, the root directory of the partition is specified as the EFI directory?

Offline

#7 2019-02-11 21:33:21

edoelas
Member
Registered: 2018-04-27
Posts: 56

Re: [SOLVED] GRUB does not start after installation

I have been reading this issue in the efibootmgr git and a lo of people with an Acer Aspire V has the same problem (my laptop is also an Acer Aspire V). I was planning to do dual boot so I guess the easiest option is to install windows and then inside windows change the boot path with this order:

bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi

That is what I have been doing since the last time, but I felt it was not the best way.

Offline

#8 2019-02-11 21:56:29

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

Re: [SOLVED] GRUB does not start after installation

Rydberg95 wrote:

it looks like /dev/sda1 is mounted at /efi. However, the EFI directory is usually a in the ESP. This surely must matter, since in OP:s command, the root directory of the partition is specified as the EFI directory?

That should be fine, AFAIK.

edoelas wrote:
bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi

That command tells Windows' UEFI loader (bootmgfw.efi) to start \EFI\ubuntu\grubx64.efi so copying /EFI/GRUB/grubx64.efi to /EFI/Microsoft/Boot/bootmgfw.efi will probably work and save you from having to install Windows.

Try /EFI/BOOT/bootx64.efi first though, that at least is actually defined in the UEFI standard.

Offline

#9 2019-02-11 22:25:07

edoelas
Member
Registered: 2018-04-27
Posts: 56

Re: [SOLVED] GRUB does not start after installation

I think this worked. It's not the GRUB menu I'm used to, it's a command line, but at least something booted a part from my USB.
My file tree now looks like this:

EFI:
+---BOOT:
|   +----bootx64.efi
+---EFI:
|   +---GRUB:
|       +---grubx64.efi
+---arch:
|   +---grubx64.efi
+---arch_grub:
    +---grubx64.efi

I'm not sure if this is how it should look. I copied the /EFI/EFI/GRUB/grubx64.efi to /EFI/BOOT/bootx64.efi

Offline

#10 2019-02-11 22:32:13

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

Re: [SOLVED] GRUB does not start after installation

edoelas wrote:

II copied the /EFI/EFI/GRUB/grubx64.efi to /EFI/BOOT/bootx64.efi

It needs to be /EFI/BOOT/bootx64.efi on the EFI system partition so if the ESP is mounted to /EFI then you should copy it to /EFI/EFI/BOOT/bootx64.efi

Did simply changing the boot order not work?

Offline

#11 2019-02-11 22:37:33

edoelas
Member
Registered: 2018-04-27
Posts: 56

Re: [SOLVED] GRUB does not start after installation

The ESP is mounted in /boot and changing the boot order does not work because once I reboot it return to the original order.

Offline

#12 2019-02-12 08:07:22

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

Re: [SOLVED] GRUB does not start after installation

edoelas wrote:

The ESP is mounted in /boot

So have you placed the GRUB .efi loader at /boot/EFI/BOOT/bootx64.efi? If that doesn't work try /boot/EFI/Microsoft/Boot/bootmgfw.efi

If you're going to run your system with the ESP mounted to /boot then the kernel image & initramfs also need to be there, mounting the ESP then re-installing the kernel package should do that for you, remember to re-install the grub package as well so the modules are in the right place.

EDIT: grub.cfg will also have to be relocated to the ESP, that's probably why you booted to a (grub?) command line.

Last edited by Head_on_a_Stick (2019-02-12 09:20:06)

Offline

#13 2019-02-12 21:09:51

edoelas
Member
Registered: 2018-04-27
Posts: 56

Re: [SOLVED] GRUB does not start after installation

Both of this options

 /boot/EFI/BOOT/bootx64.efi

and

/boot/EFI/Microsoft/Boot/bootmgfw.efi

work but I have the problem that both of them launch a command line instad of the typical menu. Where is supposed to be relocated the grub.cfg?

Offline

#14 2019-02-12 21:19:08

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

Re: [SOLVED] GRUB does not start after installation

When you say "command line" do you mean a GRUB prompt?

edoelas wrote:

Where is supposed to be relocated the grub.cfg?

/boot/grub/grub.cfg

I think the problem here is that you originally installed with /boot on /dev/sda2 but now you have mounted /dev/sda1 to /boot instead so you need to re-populate the /boot folder over on /dev/sda1 (and change /etc/fstab as well).

You will also have to run the `grub-install` command again so the bootloader is searching the correct partition for the modules and configuration file.

It may be best to start again from scratch and mount /dev/sda1 to /boot (/mnt/boot from the live environment) before running `arch-chroot` so that everything is in the right place.

Offline

#15 2019-02-12 22:03:56

edoelas
Member
Registered: 2018-04-27
Posts: 56

Re: [SOLVED] GRUB does not start after installation

Head_on_a_Stick wrote:

When you say "command line" do you mean a GRUB prompt?

Yes


Head_on_a_Stick wrote:

I think the problem here is that you originally installed with /boot on /dev/sda2 but now you have mounted /dev/sda1 to /boot instead so you need to re-populate the /boot folder over on /dev/sda1 (and change /etc/fstab as well).

You will also have to run the `grub-install` command again so the bootloader is searching the correct partition for the modules and configuration file.

It may be best to start again from scratch and mount /dev/sda1 to /boot (/mnt/boot from the live environment) before running `arch-chroot` so that everything is in the right place.

Okay, so I format the partitions, mount /dev/sda2 on /mnt, run pacstrap and genfstab, mount /dev/sda1 on /mnt/boot, make chroot, install grub and efibootmgr, run grub-install, run grub-mkconfig, copy the  grubx64.efi /boot/EFI/BOOT/bootx64.efi, reboot and everything should work. I'm right?

Offline

#16 2019-02-12 22:18:40

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

Re: [SOLVED] GRUB does not start after installation

edoelas wrote:

mount /dev/sda2 on /mnt, run pacstrap and genfstab, mount /dev/sda1 on /mnt/boot

No, mount both of the partitions before running the `pacstrap` & `genfstab` commands.

You can use the --removable flag for the `grub-install` command to copy the .efi loader to ${ESP}/EFI/BOOT/bootx64.efi automatically.

Offline

#17 2019-02-12 22:24:24

edoelas
Member
Registered: 2018-04-27
Posts: 56

Re: [SOLVED] GRUB does not start after installation

If I try to mount /dev/sda1 on /mnt/boot after mounting /dev/sda2 on /mnt but before running pacstrap I get the error:

mount: /mnt/boot: mount point does not exist.

Offline

#18 2019-02-12 22:37:10

dmartins
Member
Registered: 2006-09-23
Posts: 360

Re: [SOLVED] GRUB does not start after installation

edoelas wrote:

If I try to mount /dev/sda1 on /mnt/boot after mounting /dev/sda2 on /mnt but before running pacstrap I get the error:

mount: /mnt/boot: mount point does not exist.

mount /dev/sda2 /mnt
mkdir /mnt/boot
mount /dev/sda1 /mnt/boot

Then pacstrap, etc.

Edit: When running grub-install (inside the chroot), --efi-directory= should be /boot if following the above.

Last edited by dmartins (2019-02-12 22:39:24)

Offline

#19 2019-02-12 23:52:06

edoelas
Member
Registered: 2018-04-27
Posts: 56

Re: [SOLVED] GRUB does not start after installation

Thanks to everyone who helped me, now it seems to work.
Should I mark the question as resolved? How could I do that?

Offline

#20 2019-02-12 23:58:28

dmartins
Member
Registered: 2006-09-23
Posts: 360

Re: [SOLVED] GRUB does not start after installation

Glad you got it working!

To mark the topic solved, edit your first post and add [SOLVED] to the start of the topic.

Offline

Board footer

Powered by FluxBB