You are not logged in.

#1 2017-10-16 03:28:59

Salkay
Member
Registered: 2014-05-22
Posts: 619

[SOLVED] Grub can't find vmlinuz-linux

I followed the installation guide, but can't boot into Linux. I copied my original Windows partition to use as the EFI System Partition. This is mounted as the /boot partition. I also created a / and /home partition, as per the following /etc/fstab.

# 
# /etc/fstab: static file system information
#
# <file system>	<dir>	<type>	<options>	<dump>	<pass>
# /dev/nvme0n1p2
UUID=a6fbc26c-a082-4d9f-b686-65718a2b5653	/         	ext4      	rw,relatime,data=ordered	0 1

# /dev/nvme0n1p1 LABEL=SYSTEM
UUID=4A35-4EE8      	/boot     	vfat      	rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro	0 2

# /dev/nvme0n1p3
UUID=4e4d8f42-8cc3-4da5-94d8-ed39f1c5bef9	/home     	ext4      	rw,relatime,data=ordered	0 2

I then followed the wiki verbatim, installing grub. efibootmgr, and intel-ucode, remembering to `grub-mkconfig -o /boot/grub/grub.cfg`.

When I boot, I get the normal grub screen successfully. However, after selecting Arch Linux, I just get the following on the screen.

Loading Linux linux ...
error: file `/vmlinuz-linux' not found.
Loading initial ramdisk ...
error: you ned to load the kernel first.

When I manually mount the /boot partition, I can confirm that it does contain vmlinuz-linux.

The contents of /boot/grub/grub.cfg are here

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod ext2
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root  a6fbc26c-a082-4d9f-b686-65718a2b5653
else
  search --no-floppy --fs-uuid --set=root a6fbc26c-a082-4d9f-b686-65718a2b5653
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_input console
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-a6fbc26c-a082-4d9f-b686-65718a2b5653' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_gpt
	insmod fat
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root  4A35-4EE8
	else
	  search --no-floppy --fs-uuid --set=root 4A35-4EE8
	fi
	echo	'Loading Linux linux ...'
	linux	/vmlinuz-linux root=UUID=a6fbc26c-a082-4d9f-b686-65718a2b5653 rw  
	echo	'Loading initial ramdisk ...'
	initrd  /intel-ucode.img /initramfs-linux.img
}
submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-a6fbc26c-a082-4d9f-b686-65718a2b5653' {
	menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-a6fbc26c-a082-4d9f-b686-65718a2b5653' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_gpt
		insmod fat
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root  4A35-4EE8
		else
		  search --no-floppy --fs-uuid --set=root 4A35-4EE8
		fi
		echo	'Loading Linux linux ...'
		linux	/vmlinuz-linux root=UUID=a6fbc26c-a082-4d9f-b686-65718a2b5653 rw  
		echo	'Loading initial ramdisk ...'
		initrd  /intel-ucode.img /initramfs-linux.img
	}
	menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-a6fbc26c-a082-4d9f-b686-65718a2b5653' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_gpt
		insmod fat
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root  4A35-4EE8
		else
		  search --no-floppy --fs-uuid --set=root 4A35-4EE8
		fi
		echo	'Loading Linux linux ...'
		linux	/vmlinuz-linux root=UUID=a6fbc26c-a082-4d9f-b686-65718a2b5653 rw  
		echo	'Loading initial ramdisk ...'
		initrd  /intel-ucode.img /initramfs-linux-fallback.img
	}
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

#EDIT
I tried installing systemd-boot instead, and that boots fine.

Last edited by Salkay (2017-10-23 06:58:08)

Offline

#2 2017-10-16 13:54:35

unixman
Member
Registered: 2015-03-12
Posts: 64

Re: [SOLVED] Grub can't find vmlinuz-linux

Salkay wrote:
Loading Linux linux ...
error: file `/vmlinuz-linux' not found.

EFI  use  \   as path seperator not   /

Last edited by unixman (2017-10-16 13:54:48)

Offline

#3 2017-10-16 23:29:22

Salkay
Member
Registered: 2014-05-22
Posts: 619

Re: [SOLVED] Grub can't find vmlinuz-linux

unixman wrote:

EFI  use  \   as path seperator not   /

I'm not 100% sure what you mean. /boot/grub/grub.cfg was automatically generated by grub-mkconfig. Nevertheless, I manually edited the file, changing all /vmlinuz-linux to \vmlinuz-linux, but now when I boot I get the following error instead:

Loading Linux linux ...
error: invalid file name `vmlinuz-linux'.
Loading initial ramdisk ...
error: you ned to load the kernel first.

It looks like I might need to escape the backslash, so I used two \ instead. I now get the error:

error: invalid file name `\vmlinuz-linux'.

Offline

#4 2017-10-17 09:18:32

lo1
Member
Registered: 2017-09-25
Posts: 584

Re: [SOLVED] Grub can't find vmlinuz-linux

https://bbs.archlinux.org/viewtopic.php?id=231001 the issues of you both don't seem related, but you should take a look to see if there's something you're missing in your installation...
Also, is good practice to post your disk partitioning scheme like the other guy did wink

Last edited by lo1 (2017-10-17 09:19:00)

Offline

#5 2017-10-18 04:25:54

Salkay
Member
Registered: 2014-05-22
Posts: 619

Re: [SOLVED] Grub can't find vmlinuz-linux

Thanks for that link.

I was actually in the process of troubleshooting when you posted. I think the problem is that I have two partitions that share the same UUID. I have two hard drives, and I manually copied (dd) the ESP from one to the other. systemd-boot uses PARTUUID, which are unique, and presumably why it works, whereas grub uses the duplicate UUID.

AFAIK you can't change vfat UUIDs, so to test, I tried manually editing /boot/grub/grub.cfg . I replaced all references to

search --no-floppy --fs-uuid --set=root 4A35-4EE8

with

search --no-floppy --label --set=root root

For some reason I still got the following error:

error: no such device: root

but it worked, and I could boot!

Perhaps the error was because it expected a LABEL an not PARTLABEL. However, I'm not so interested in troubleshooting this error specifically. This workaround has just shown that the problem is probably because grub uses the UUID. Also, future kernel updates would override these changes anyway. Is there a "proper" way to pass PARTUUID (or at least PARTLABEL) to grub?

Offline

#6 2017-10-18 09:16:11

lo1
Member
Registered: 2017-09-25
Posts: 584

Re: [SOLVED] Grub can't find vmlinuz-linux

Hmm, try with

lsblk -O | tee lsblk.txt

(for better readability)

Edit: If you're not able to log into a graphical session with a text editor, just do

lsblk -O | tee lsblk

Edit 2: I omitted the part in which you read the PARTUUID from the lsblk file you just created, then edit /etc/grub.d/40_custom to add your entries. That's the best i can come up with, though you'll find multiple redundant entries at startup.

Edit 3: You should never edit your /boot/grub/grub.cfg manually, that's what /etc/grub.d/40_custom (plus grub-mkconfig) is for.

Last edited by lo1 (2017-10-18 09:55:23)

Offline

#7 2017-10-19 23:07:44

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

Re: [SOLVED] Grub can't find vmlinuz-linux

lo1 wrote:

Hmm, try with

lsblk -O | tee lsblk.txt

(for better readability)

Edit: If you're not able to log into a graphical session with a text editor, just do

lsblk -O | tee lsblk

What? Why not just ask for the output of lsblk -O? Why also write it to file? Why write it to two files if the user is in a GUI?

Edit 3: You should never edit your /boot/grub/grub.cfg manually, that's what /etc/grub.d/40_custom (plus grub-mkconfig) is for.

Unless you plan to maintain it manually. In that case, you should, of course, never run grub-mkconfig, at least with your real grub.cfg as output.


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

#8 2017-10-20 06:44:16

Salkay
Member
Registered: 2014-05-22
Posts: 619

Re: [SOLVED] Grub can't find vmlinuz-linux

lo1 wrote:

Hmm, try with

lsblk -O | tee lsblk.txt
NAME        KNAME     MAJ:MIN FSTYPE      MOUNTPOINT LABEL            UUID                                 PARTTYPE                             PARTLABEL                    PARTUUID                             PARTFLAGS  RA RO RM HOTPLUG MODEL                                    SERIAL            SIZE STATE   OWNER GROUP MODE       ALIGNMENT MIN-IO OPT-IO PHY-SEC LOG-SEC ROTA SCHED RQ-SIZE TYPE DISC-ALN DISC-GRAN DISC-MAX DISC-ZERO WSAME WWN                  RAND PKNAME  HCTL       TRAN   SUBSYSTEMS          REV VENDOR   ZONED
sda         sda         8:0                                                                                                                                                                                                 128  0  0       0 ST2000DM001-1ER1                         Z4Z8T8D4          1.8T running root  disk  brw-rw----         0   4096      0    4096     512    1 cfq       128 disk        0        0B       0B         0    0B 0x5000c500a41fa353      1         0:0:0:0    sata   block:scsi:pci     HP51 ATA      none
├─sda1      sda1        8:1   vfat                   SYSTEM           4A35-4EE8                            c12a7328-f81f-11d2-ba4b-00a0c93ec93b EFI system partition         0fa43fd5-742e-430c-8952-22a11234f8a9           128  0  0       0                                                            360M         root  disk  brw-rw----         0   4096      0    4096     512    1 cfq       128 part        0        0B       0B         0    0B 0x5000c500a41fa353      1 sda                       block:scsi:pci                   none
├─sda2      sda2        8:2                                                                                e3c9e316-0b5c-4db8-817d-f92df00215ae Microsoft reserved partition dd97e4b2-24d3-4185-96a0-567fcd90ad42           128  0  0       0                                                            128M         root  disk  brw-rw----         0   4096      0    4096     512    1 cfq       128 part        0        0B       0B         0    0B 0x5000c500a41fa353      1 sda                       block:scsi:pci                   none
├─sda3      sda3        8:3   ntfs                   Windows          1282244782243221                     ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 Basic data partition         8f45bb5c-3007-43a1-8463-b611d14b4d84           128  0  0       0                                                          105.5G         root  disk  brw-rw----         0   4096      0    4096     512    1 cfq       128 part        0        0B       0B         0    0B 0x5000c500a41fa353      1 sda                       block:scsi:pci                   none
├─sda4      sda4        8:4   ntfs                   Windows RE tools 124E70924E707079                     de94bba4-06d1-4d40-a16a-bfd50179d6ac Basic data partition         678c5eaa-b72d-44de-8fd5-c1e5ceb931d9 0x1       128  0  0       0                                                            980M         root  disk  brw-rw----         0   4096      0    4096     512    1 cfq       128 part        0        0B       0B         0    0B 0x5000c500a41fa353      1 sda                       block:scsi:pci                   none
├─sda5      sda5        8:5   ntfs                   Recovery Image   A854445254442602                     ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 Basic data partition         c7858bbc-14a9-4c02-ab15-4ea21c5ff0a2 0x1       128  0  0       0                                                           16.5G         root  disk  brw-rw----         0   4096      0    4096     512    1 cfq       128 part        0        0B       0B         0    0B 0x5000c500a41fa353      1 sda                       block:scsi:pci                   none
├─sda6      sda6        8:6   ext4        /HDD                        b9a21af2-4334-4a11-a212-4f6488287048 0fc63daf-8483-4772-8e79-3d69d8477de4 HDD                          56291b6a-1e18-46e8-a36a-cc8c2d7a04fb           128  0  0       0                                                            1.7T         root  disk  brw-rw----         0   4096      0    4096     512    1 cfq       128 part        0        0B       0B         0    0B 0x5000c500a41fa353      1 sda                       block:scsi:pci                   none
└─sda7      sda7        8:7   swap        [SWAP]                      7e3c8f54-ebf4-4d9f-84c8-b98e2dbcd03a 0657fd6d-a4ab-43c4-84e5-0933c84b4f4f swap                         c5598397-d7be-4a77-a846-423bda2b0c8c           128  0  0       0                                                             19G         root  disk  brw-rw----         0   4096      0    4096     512    1 cfq       128 part        0        0B       0B         0    0B 0x5000c500a41fa353      1 sda                       block:scsi:pci                   none
nvme0n1     nvme0n1   259:0                                                                                                                                                                                                 128  0  0       0 SAMSUNG MZVLW256HEHP-000H1               S340NX0J837258  238.5G live    root  disk  brw-rw----         0    512      0     512     512    0 none     1023 disk      512      512B       2T         0    0B eui.002538b871b6c0f8    0                    nvme   block:nvme:pci                   none
├─nvme0n1p1 nvme0n1p1 259:1   vfat        /boot      SYSTEM           4A35-4EE8                            c12a7328-f81f-11d2-ba4b-00a0c93ec93b boot                         ae5455c7-54f0-4171-b11a-08229c2acfd1           128  0  0       0                                                            360M         root  disk  brw-rw----         0    512      0     512     512    0 none     1023 part        0      512B       2T         0    0B eui.002538b871b6c0f8    0 nvme0n1            nvme   block:nvme:pci                   none
├─nvme0n1p2 nvme0n1p2 259:2   ext4        /                           6663b92f-bf18-47bf-9698-351512ff217c 0fc63daf-8483-4772-8e79-3d69d8477de4 root                         a5a390c6-bb2d-4e90-887f-5f18ae347c17           128  0  0       0                                                           49.7G         root  disk  brw-rw----         0    512      0     512     512    0 none     1023 part        0      512B       2T         0    0B eui.002538b871b6c0f8    0 nvme0n1            nvme   block:nvme:pci                   none
└─nvme0n1p3 nvme0n1p3 259:3   ext4        /home                       5b79601b-d278-4aea-a3d6-1dbec621117c 0fc63daf-8483-4772-8e79-3d69d8477de4 home                         27a2e552-98d9-4041-bdf5-ac7d64579dbc           128  0  0       0                                                          188.5G         root  disk  brw-rw----         0    512      0     512     512    0 none     1023 part        0      512B       2T         0    0B eui.002538b871b6c0f8    0 nvme0n1            nvme   block:nvme:pci                   none
lo1 wrote:

Edit 2: I omitted the part in which you read the PARTUUID from the lsblk file you just created, then edit /etc/grub.d/40_custom to add your entries. That's the best i can come up with, though you'll find multiple redundant entries at startup.

The problem is that AFAIK grub won't accept a PARTUUID for /boot.

lo1 wrote:

Edit 3: You should never edit your /boot/grub/grub.cfg manually, that's what /etc/grub.d/40_custom (plus grub-mkconfig) is for.

Yes, it wasn't meant to be a long-term fix… as I mentioned earlier in passing, it was just to test.

cfr wrote:
lo1 wrote:

Hmm, try with

lsblk -O | tee lsblk.txt

(for better readability)

Edit: If you're not able to log into a graphical session with a text editor, just do

lsblk -O | tee lsblk

What? Why not just ask for the output of lsblk -O? Why also write it to file? Why write it to two files if the user is in a GUI?

TBH I just did `lsblk -O | xclip -selection clipboard`. big_smile

Offline

#9 2017-10-20 08:33:09

lo1
Member
Registered: 2017-09-25
Posts: 584

Re: [SOLVED] Grub can't find vmlinuz-linux

cfr wrote:

What? Why not just ask for the output of lsblk -O? Why also write it to file? Why write it to two files if the user is in a GUI?

That's not what i meant. I just meant "pass that output to something (one file or another depending on the scenario) for better readability". I don't know what kind of desktop and fonts you're using, but for me (15" laptop screen size) output from lsblk -O is unreadable, with lines not respecting the header and titles they belong to.

cfr wrote:

Unless you plan to maintain it manually. In that case, you should, of course, never run grub-mkconfig, at least with your real grub.cfg as output.

Thanks, that's a better suggestion.

@Salkay, if you already know that PARTUUID isn't going to be read from grub (apparently that's a feature, not an issue...), and systemd is doing just fine, and you're ok with it..then just stick with it wink i don't know what else you can do with that duplicated ESP.

Offline

#10 2017-10-20 08:38:56

Salkay
Member
Registered: 2014-05-22
Posts: 619

Re: [SOLVED] Grub can't find vmlinuz-linux

lo1 wrote:

@Salkay, if you already know that PARTUUID isn't going to be read from grub (apparently that's a feature, not an issue...), and systemd is doing just fine, and you're ok with it..then just stick with it wink i don't know what else you can do with that duplicated ESP.

Yeah, I think you are right, and I'll have to use systemd-boot. I just wasn't 100% sure that grub couldn't read PARTUUID. Did you read that somewhere? If so, could you please post a link?

Offline

#11 2017-10-20 09:29:24

lo1
Member
Registered: 2017-09-25
Posts: 584

Re: [SOLVED] Grub can't find vmlinuz-linux

Not that i know, actually i'm running MBR/BIOS for the sake of simplicity. I'm willing to lend a hand, but wouldn't it be better to create an ESP manually for /dev/nvme0n1? That would be the most painless solution, you'll get two clean and indipendent disks, then you can do all the test you want with the possibility to isolate the problems properly.

Offline

#12 2017-10-20 10:58:46

progandy
Member
Registered: 2012-05-17
Posts: 5,190

Re: [SOLVED] Grub can't find vmlinuz-linux

AFAIK you can't change vfat UUIDs, so to test, I tried manually editing /boot/grub/grub.cfg . I replaced all references to

It should be possible with "mlabel -n" from mtools.

mlabel -i /dev/sd<your_partition> -n ::

| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#13 2017-10-23 06:57:56

Salkay
Member
Registered: 2014-05-22
Posts: 619

Re: [SOLVED] Grub can't find vmlinuz-linux

progandy wrote:

AFAIK you can't change vfat UUIDs, so to test, I tried manually editing /boot/grub/grub.cfg . I replaced all references to

It should be possible with "mlabel -n" from mtools.

mlabel -i /dev/sd<your_partition> -n ::

Thank you. That worked perfectly. For future reference, I had to reboot before blkid updated.

Offline

Board footer

Powered by FluxBB