[Grub]NVME Errors during update


So after running my second Octopi update on this system, I got this error out in the post-transaction (I spaced out the important parts):

: Running post-transaction hooks...

Updating linux49 initcpios
==> Building image from preset: /etc/mkinitcpio.d/linux49.preset: 'default'
-> -k /boot/vmlinuz-4.9-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-4.9-x86_64.img
==> Starting build: 4.9.48-1-MANJARO
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: /boot/initramfs-4.9-x86_64.img
==> Image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux49.preset: 'fallback'
-> -k /boot/vmlinuz-4.9-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-4.9-x86_64-fallback.img -S autodetect
==> Creating gzip-compressed initcpio image: /boot/initramfs-4.9-x86_64-fallback.img
Updating Grub-Bootmenu
Generating grub configuration file ...
Found background: /usr/share/grub/background.png
Found Intel Microcode image
Found linux image: /boot/vmlinuz-4.9-x86_64
Found initrd image: /boot/initramfs-4.9-x86_64.img
Found initrd fallback image: /boot/initramfs-4.9-x86_64-fallback.img
Found Slackware 14.2 on /dev/sda7
Found memtest86+ image: /boot/memtest86+/memtest.bin

/usr/bin/grub-probe: warning: unknown device type nvme0n1.

error: syntax error. _
error: Incorrect command._ 

Syntax error at line 223
Syntax errors are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub
and /etc/grub.d/* files or please file a bug report with
/boot/grub/grub.cfg.new file attached.

error: command failed to execute correctly 

Warn about old perl modules
Updating icon theme caches...
Creating temporary files...
Arming ConditionNeedsUpdate...
Updating the info directory file...
Updating the appstream cache...
AppStream cache update completed successfully.
Updating the desktop file MIME type cache...
Updating the MIME type database...
Unknown media type in type 'all/all'
Unknown media type in type 'all/allfiles'

Command finished OK!

So, I have very little idea of how grub works, as I have used Lilo for a long time. You also might notice I have a drive plugged in (SDA7) that is an independent slackware install from an old computer (I was toying around with Slackware before I built my new computer and now have manjaro on it... best software of any distro I have heard, not to mention easy to work with) Is that in any way related, or did something just go wrong?
Or where should I look to fix the issue (if there even is any)?
And if it is of any consequence, no I have not restarted since then, and wanted to get an answer before doing so.


What is the output of
cat /etc/default/grub


# If you want to enable the save default function, uncomment the following
# line, and set GRUB_DEFAULT to saved.

# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"

# Uncomment to enable Hidden Menu, and optionally hide the timeout count

# Uncomment to use basic console

# Uncomment to disable graphical terminal

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'

# Uncomment to allow the kernel use the same resolution used by grub

# Uncomment if you want GRUB to pass to the Linux kernel the old parameter
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"

# Uncomment to disable generation of recovery mode menu entries

# Uncomment and set to the desired menu colors.  Used by normal and wallpaper
# modes only.  Entries specified as foreground/background.                                                                                                                                                                                                                                                                   
# Uncomment one of them for the gfx desired, a image background or a gfxtheme                                                                                                                                                                                                                                                
# Uncomment to get a beep at GRUB start                                                                                                                                                                                                                                                                                      
#GRUB_INIT_TUNE="480 440 1" 

I didn't notice anything glaringly wrong (I checked this before), thought it is late, and I have had a pretty busy week

Oops, this is probably the one containing the error:
And its coming from the files in /etc/grub.d/
But I dont know if that has to do with the nvme thing or not. I do know that there was a time when folks who ran into this generally changed to another bootloader, but that shouldnt be necessary anymore, AFAIK.

I don't think nvme is a thing here, i got the same unknown warning since i don't remember :

sudo update-grub                                  
Création du fichier de configuration GRUB…
Found Intel Microcode image
Image Linux trouvée : /boot/vmlinuz-4.13-x86_64
Image mémoire initiale trouvée : /boot/initramfs-4.13-x86_64.img
Found initrd fallback image: /boot/initramfs-4.13-x86_64-fallback.img
Image Linux trouvée : /boot/vmlinuz-4.12-x86_64
Image mémoire initiale trouvée : /boot/initramfs-4.12-x86_64.img
Found initrd fallback image: /boot/initramfs-4.12-x86_64-fallback.img
Found memtest86+ image: /boot/memtest86+/memtest.bin

/usr/bin/grub-probe : attention : type de périphérique nvme0n1 inconnu.


robinspi, provide

ls /etc/grub.d/
cat /proc/cmdline


ls /etc/grub.d/

 00_header  10_linux  20_linux_xen  30_os-prober  40_custom  41_custom  60_memtest86+  README

cat /proc/cmdline

BOOT_IMAGE=/boot/vmlinuz-4.9-x86_64 root=UUID=062fb37e-8999-4d29-b474-48d80506a815 rw quiet

Okay, nothing to worry about. You're booting up the right image.

But just to be sure, compare the 2 files - /boot/grub/grub.cfg and /boot/grub/grub.cfg.new and if there's something you think is not right, get back to us.


I won't really know if what I'm looking for, as I said... I haven't used grub, mostly just lilo. But if I do notice anything, I'll be sure to be back.

Look at line 233 on the file /boot/grub/grub.cfg (You need root to access grub.cfg)

Also just a small question, are you by any chance using grub-customizer?

is it not grub.cfg.new instead ? (the error preventing the overwrite of grub.cfg)

Both of them just to make a little bit sure..

Just found that, the answer is really nice you should take a eye on it : https://unix.stackexchange.com/questions/209152/syntax-error-in-grub-cfg-on-update-grub-grub-2-memtest86

I'm also wondering if it's possible to hide /etc/grub.d/* files to check if the update-grub pass without them and eliminate candidates :thinking:
EDIT : It's possible, update-grub work without "/etc/grub.d/60_memtest86+" for example :man_scientist:
And the best one : The nvme warning disappear without the 60_memtest86+ file :scream:



Another potential casualty... :slightly_frowning_face:

@thefallenrat @sueridgepipe No, AFAIK I am just using default grub and not grub customizer. This system is pretty much stock 17.0.3 with a some of my own software (GIMP, Blender, Wine, etc) installed. I haven't gotten around to messing with anything as college has started.

@thefallenrat: As for looking in grub configs, grub.cfg doesn't go to 233, but grub.cfg.new does.


### 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;
### END /etc/grub.d/41_custom ###

None of that looks all that wrong to me (though I am dead tired right now, maybe you can point out something I am missing) And as I said, I don't really know grub either (though this right here is decently simple. I could probably wrap my head around it with some effort.)

Is it a typo or you just pasted 233-239 while the error is in 223 ? :nerd_face:
If 233 correspond to your 41_custom 223 is your 40_custom ? :thinking:
Mine contain only a tail + comment can you show your /etc/grub.d/40_custom ?

$ cat /etc/grub.d/40_custom 
exec tail -n +3 $0
# 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.

And the 223ish lines of grub.cfg.new :stuck_out_tongue_winking_eye: ?

Are you positive you've never installed and used grub-customizer previously?

Removing the package does not remove the mess, I mean custom grub configuration scripts, it creates.

fdisk -l
ls -al /etc/grub.d
ls -al /boot/grub


What I posted is lines 233, 234, 235... 239 I double checked that. And those are the correct ones, as I copy-pasted it straight from the octopi logs. Line 223 is a close brace (and yes, its matched up with another one, so there is no issue there either)

exec tail -n +3 $0
# 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.

^ That would be my 40_custom, and its the same as yours so...


Like I said, this is a stock manjaro system with the exception of a few added user programs, like Gimp, Blender, and a couple of libs for wine. So I have not edited any startup files, any configs, or anything (with the exception of wine stuff, but that is totoally unrelated) I have very little knowledge of grub like I said before, so I don't think I would install and use grub-customizer in the first place. Unless either it comes with manjaro default or I somehow used it unknowingly, I am sure that I neither used nor installed it.

I am looking to dual boot windows eventually (Hinted somewhat by the wine thing above.. It works, but the performance hit is too much for me), though it should be noted A, it will not even be on the same drive, and B, I will be learning a lot more about grub before that happens. And I also have more important things to worry about as college has started.

I just seen it here and I'm wondering if i miss something obvious :neutral_face:.

ok ok, revenons à nos moutons :
${config_directory} : This variable is automatically set by GRUB to the directory part of current configuration file name
$prefix : The location of the ‘/boot/grub’ directory as an absolute file name, provided by grub-install.
source : https://www.gnu.org/software/grub/manual/grub/grub.html

if the file ${config_directory}/custom.cfg ] exist then
source ${config_directory}/custom.cfg
elif ${config_directory} is empty (not talking of the folder), the file /boot/grub/custom.cfg exist then
source /boot/grub/custom.cfg

I'm not sure of what ${config_directory} is :thinking:, i vote for /boot/grub as grub.cfg is in it or /boot/grub/$fubar/
Are you able to find custom.cfg somewhere in /boot/grub or in ${config_directory} ?

PS: Gentoo wiki tell : /boot/grub/custom.cfg -> The /etc/grub.d/41_custom script will reference this file to be read in at boot time if it exists.
source : https://wiki.gentoo.org/wiki/GRUB2

This (custom.cfg) is manually generated if one needs it. It will not be present in default installs (and that is correct). But it has nothing to do with the error message. And yes, you did not install grub-customizer either.

As noted, there is really nothing wrong with your booting up. If this error bothers you, you can remove (or move it away to another place) /etc/grub.d/60_memtest86+ The error should not occur. For another thing, the memtest does not work in a uefi system anyway. See its script

if [ "${grub_platform}" == "pc" ]; then ......

note grub_platform is 'pc' for bios-legacy and 'efi' for uefi system.
We can safely remove it.

Perhaps the script is not wriiten well for nvme devices but I cannot verify this as I don't have nvme devices. If Yoyo has another distro, he can check if error occurs in that distro as well. The 'arrangement' of the script in memtest is different in other distros.

Whatever, I think we can put all this to rest.

1 Like

Forum kindly sponsored by