You are not logged in.

#1 2012-09-16 07:12:27

cogeary
Member
Registered: 2012-09-16
Posts: 22

[SOLVED]Grub-Install can't Find Kernel and/or initrd, mkinitcpio Fails

Hi all,

I have recently installed Arch on my new build (with UEFI firmware). I successfully set up xorg, alsa/pulseaudio, xfce, etc... things were looking pretty good. Then, I tried to blacklist the pcspkr in order to silence the annoying beep every time I selected "Log Out" inside xfce. I executed

mkinitcpio -p linux

and was presented with the following errors:

==> Building image from preset: 'default'
   -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img -S autodetect
==> ERROR: specified kernel image does not exist: `/boot/vmlinuz-linux'
==> Building image from preset: 'fallback'
   -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img -S autodetect
==> ERROR: specified kernel image does not exist: `/boot/vmlinuz-linux`

There were no such files anywhere on /boot. I tried doing

find / -name vmlinuz-linux

and nothing was found. I wasn't quite sure why that was happening, but I tried uninstalling/reinstall grub (grub-common and grub2-efi-x86_64). I installed grub to /boot using

grub-install --directory=/usr/lib/grub/x86_64-efi --target=x86_64-efi --efi-directory=/boot --bootloader-id="Arch Linux" --boot-directory=/boot --recheck --debug

and then generated /boot/grub/grub.cfg. I tried rebuilding the initramfs again but got the same error. I was tired and frustrated so I removed the old grub efi entry with

efibootmgr -b 0 -B

and then went to sleep.

I didn't have the chance to turn the computer back on until tonight... I was then presented with a grub2 shell. Since I didn't know where the kernel/initrd were located I tried

set root=(hd1,gpt1)
chainloader +1

but grub told me

error: invalid EFI file path

So that's about it. It appears that grub-mkconfig is having trouble locating the kernel/initrd so it doesn't make any entries, dropping me right into a shell. I've tried booting up with my installation USB and chrooting in and reinstalling grub again but nothing seems to work. So what I'd like to try to do is just boot up into my system and then modify add the grub boot entries entries I want... but I just can't figure out what's causing all these issues.

Sorry if I mess up any terminology... still learning the ropes here. Thanks for any input.

Last edited by cogeary (2012-09-17 05:35:51)

Offline

#2 2012-09-16 07:21:29

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: [SOLVED]Grub-Install can't Find Kernel and/or initrd, mkinitcpio Fails

==> ERROR: specified kernel image does not exist: `/boot/vmlinuz-linux'

Probably because you have a separate boot partition (not just the 512 MB "UEFISYS" FAT32 partition), which you forgot to mount (in fstab).


Post your /etc/fstab.


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#3 2012-09-16 18:14:58

cogeary
Member
Registered: 2012-09-16
Posts: 22

Re: [SOLVED]Grub-Install can't Find Kernel and/or initrd, mkinitcpio Fails

DSpider wrote:
==> ERROR: specified kernel image does not exist: `/boot/vmlinuz-linux'

Probably because you have a separate boot partition (not just the 512 MB "UEFISYS" FAT32 partition), which you forgot to mount (in fstab).


Post your /etc/fstab.

Thank you for your reply!

However, I do not have a separate boot partition apart from the "UEFISYS" partition. Here is my fstab:

# UUID=3ec307aa-0ead-4d33-b292-42bbe783d6ee
/dev/sda2           	/         	ext4      	rw,relatime,data=ordered	0 1

# UUID=B192-6C57
/dev/sda1           	/boot     	vfat      	rw,relatime,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro	0 2

When I first looked at the fstab I saw that both of the entries repeated themselves. This was because I had even tried reformatting /boot so I had to generate a new fstab, but for some reason I used ">> /mnt/etc/fstab" rather than "> ..."
So I executed

genfstab /mnt > /mnt/etc/fstab

and reinstalled grub, but still no difference... mkinitcpio fails and I reboot to a grub shell.

Last edited by cogeary (2012-09-16 18:15:51)

Offline

#4 2012-09-16 23:16:51

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,140

Re: [SOLVED]Grub-Install can't Find Kernel and/or initrd, mkinitcpio Fails

So you have a combined EFI/boot partition? That is, you do have a separate /boot (separate from /) but it is identical to your EFI partition?

Do you know if that set up can work? That is, can grub use a /boot which is formatted as fat 32?

The usual set up, I think, is to mount the efi partition at /boot/efi. (Whether /boot is separate from / or not.)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#5 2012-09-16 23:33:03

cogeary
Member
Registered: 2012-09-16
Posts: 22

Re: [SOLVED]Grub-Install can't Find Kernel and/or initrd, mkinitcpio Fails

cfr wrote:

So you have a combined EFI/boot partition? That is, you do have a separate /boot (separate from /) but it is identical to your EFI partition?

Do you know if that set up can work? That is, can grub use a /boot which is formatted as fat 32?

The usual set up, I think, is to mount the efi partition at /boot/efi. (Whether /boot is separate from / or not.)

Well, it worked for me for a day or so before I messed it all up.

Looking at the Arch documentation for grub-efi, I am seeing that mine is not the usual setup. However, I loosely followed a guide that installed grub on /boot, which was the EFI partition, so it seems that others have had it work that way.

I will probably try the "usual" setup and see how it goes, but since I've tried installing grub without success the same way I installed it will success originally, I don't think that's my problem.

Thanks!

Offline

#6 2012-09-17 02:52:15

angelfalls
Member
Registered: 2012-03-26
Posts: 139

Re: [SOLVED]Grub-Install can't Find Kernel and/or initrd, mkinitcpio Fails

try to mount /boot paritition manually.

Offline

#7 2012-09-17 03:47:06

cogeary
Member
Registered: 2012-09-16
Posts: 22

Re: [SOLVED]Grub-Install can't Find Kernel and/or initrd, mkinitcpio Fails

angelfalls wrote:

try to mount /boot paritition manually.

What do you mean? Mount it before running grub-install (while booted into the install disk)? I already do that...

mount /dev/sda1 /mnt/boot

Mount it while in grub shell? How would that work, and what would that accomplish?

Offline

#8 2012-09-17 05:13:36

angelfalls
Member
Registered: 2012-03-26
Posts: 139

Re: [SOLVED]Grub-Install can't Find Kernel and/or initrd, mkinitcpio Fails

if your /boot partition was mounted and ls command don't show vmlinuz-linux, i think /boot partition wasn't mounted when you were installing system (pacstrap /mnt base base-devel).
if that mount your /boot partition and reinstall kernel (pacman -S linux) then install grub-efi.

Offline

#9 2012-09-17 05:35:10

cogeary
Member
Registered: 2012-09-16
Posts: 22

Re: [SOLVED]Grub-Install can't Find Kernel and/or initrd, mkinitcpio Fails

angelfalls wrote:

if your /boot partition was mounted and ls command don't show vmlinuz-linux, i think /boot partition wasn't mounted when you were installing system (pacstrap /mnt base base-devel).
if that mount your /boot partition and reinstall kernel (pacman -S linux) then install grub-efi.

Thank you so much! Everything is working now. I'm still a bit puzzled why it didn't give me the errors right after I installed arch, but I must have messed up somewhere...

Many thanks to those that have helped.

Offline

#10 2015-01-27 12:36:04

Almoullim
Member
Registered: 2015-01-27
Posts: 9

Re: [SOLVED]Grub-Install can't Find Kernel and/or initrd, mkinitcpio Fails

I've had this problem before, i fixed by using this commands

pacman -S linux

I guess somehow it didn't install correctly using

pacstrap

Offline

Board footer

Powered by FluxBB