Update bootloader fails

Just did a “zypper up” and got the following error…

    Update bootloader...
    Perl-Bootloader: 2015-06-16 18:53:00 <3> pbl-5305.2 Core::RunCommand.1658: Error: '/usr/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg' failed with exit code 127, output:
    <<<<<<<<<<<<<<<<
    /etc/default/grub: line 12: quiet: command not found
    
    >>>>>>>>>>>>>>>>
Updating bootloader failed
 

Any suggestions?

Looking at that file here, I see that line 12 is:


GRUB_CMDLINE_LINUX_DEFAULT=" resume=/dev/nwr2sea/swap splash=silent quiet showopts"

I would guess that the file has become corrupted – perhaps it was edited with an editor that wraps long lines.

Maybe post the first 20 lines of “/etc/default/grub” with code tags. But makes sure that there isn’t any private information there that you want to restrict.

In my case, I suppose that “/dev/nwr2sea/swap” is, technically, private information (the reference to the swap volume of an encrypted LVM), but it doesn’t seem to be anything that I should worry about revealing. I’m not seeing anything that raises particular concern in the first 20 lines. (I think the main privacy issue is if you set a password for accessing the grub menu, and I don’t do that).

As requested…

# cat /etc/default/grub
# Modified by YaST2. Last modification on Fri May 29 11:19:34 CEST 2015
# THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader
# For the new kernel it try to figure out old parameters. In case we are not able to recognize it (e.g. change of flavor or strange install order ) it it use as fallback installation parameters from /etc/sysconfig/bootloader

# If you change this file, run 'grub2-mkconfig -o /boot/grub2/grub.cfg' afterwards to update
# /boot/grub2/grub.cfg.
GRUB_DISTRIBUTOR=openSUSE
GRUB_DEFAULT=saved
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=8
GRUB_CMDLINE_LINUX_DEFAULT=" " resume=/dev/disk/by-uuid/40c9d08d-be72-4b80-abb0-b4d42c874871 splash=silent quiet showopts"
i915.modeset="1 tpm_tis.interrupts=0""
# kernel command line options for failsafe mode
GRUB_CMDLINE_LINUX_RECOVERY="showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe"
GRUB_CMDLINE_LINUX=""
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM=0x01234567,0xfefefefe,0x89abcdef,0xefefefef
# Uncomment to disable graphical terminal (grub-pc only)
GRUB_TERMINAL=gfxterm
# 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'
GRUB_GFXMODE=auto
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_LINUX_RECOVERY=true
# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
# Skip 30_os-prober if you experienced very slow in probing them
# WARNING foregin OS menu entries will be lost if set true here
GRUB_DISABLE_OS_PROBER=false
# Set to 'y' for grub to be installed on an encrypted partition
GRUB_ENABLE_CRYPTODISK=n
SUSE_BTRFS_SNAPSHOT_BOOTING=true
GRUB_BACKGROUND=/boot/grub2/themes/openSUSE/background.png
GRUB_THEME=/boot/grub2/themes/openSUSE/theme.txt

GRUB_CMDLINE_LINUX_DEFAULT=" " resume=/dev/disk/by-uuid/40c9d08d-be72-4b80-abb0-b4d42c874871 splash=silent quiet showopts" i915.modeset="1 tpm_tis.interrupts=0"" 

Is there something up with the quotation marks here? Seems like there are too many double-quotes in that line.

Yes, exactly. And maybe the line is wrapped, though that might be the copy/paste for posting.

The messed up quoting is surely the problem.

Try (for that one line):


GRUB_CMDLINE_LINUX_DEFAULT=" resume=/dev/disk/by-uuid/40c9d08d-be72-4b80-abb0-b4d42c874871 splash=silent quiet showopts i915.modeset=1 tpm_tis.interrupts=0"

And remember that is just one long line

I corrected /etc/default/grub so it reads as follows…

cat /etc/default/grub
# Modified by YaST2. Last modification on Fri May 29 11:19:34 CEST 2015
# THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader
# For the new kernel it try to figure out old parameters. In case we are not able to recognize it (e.g. change of flavor or strange install order ) it it use as fallback installation parameters from /etc/sysconfig/bootloader

# If you change this file, run 'grub2-mkconfig -o /boot/grub2/grub.cfg' afterwards to update
# /boot/grub2/grub.cfg.
GRUB_DISTRIBUTOR=openSUSE
GRUB_DEFAULT=saved
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=8
GRUB_CMDLINE_LINUX_DEFAULT=" resume=/dev/disk/by-uuid/40c9d08d-be72-4b80-abb0-b4d42c874871 splash=silent quiet showopts"
i915.modeset="1 tpm_tis.interrupts=0""
# kernel command line options for failsafe mode
GRUB_CMDLINE_LINUX_RECOVERY="showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe"
GRUB_CMDLINE_LINUX=""
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM=0x01234567,0xfefefefe,0x89abcdef,0xefefefef
# Uncomment to disable graphical terminal (grub-pc only)
GRUB_TERMINAL=gfxterm
# 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'
GRUB_GFXMODE=auto
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_LINUX_RECOVERY=true
# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
# Skip 30_os-prober if you experienced very slow in probing them
# WARNING foregin OS menu entries will be lost if set true here
GRUB_DISABLE_OS_PROBER=false
# Set to 'y' for grub to be installed on an encrypted partition
GRUB_ENABLE_CRYPTODISK=n
SUSE_BTRFS_SNAPSHOT_BOOTING=true
GRUB_BACKGROUND=/boot/grub2/themes/openSUSE/background.png
GRUB_THEME=/boot/grub2/themes/openSUSE/theme.txt
 

When I execute

# grub2-mkconfig -o /boot/grub2/grub.cfg
 /etc/default/grub: line 32: unexpected EOF while looking for matching `"'

I don’t see the problem especially since line 32 is commented out.

Is line 32 the last line?

That’s typical of these errors. It’s the line where the missing quote was discovered, not where it was caused.

I’m seeing in your code block:


GRUB_CMDLINE_LINUX_DEFAULT=" resume=/dev/disk/by-uuid/40c9d08d-be72-4b80-abb0-b4d42c874871 splash=silent quiet showopts"
i915.modeset="1 tpm_tis.interrupts=0""

That still looks to me as if it is two lines, but should be one. Try (as a single line)


GRUB_CMDLINE_LINUX_DEFAULT=" resume=/dev/disk/by-uuid/40c9d08d-be72-4b80-abb0-b4d42c874871 splash=silent quiet showopts i915.modeset=1 tpm_tis.interrupts=0"

What editor are you using.

My guess is that you are using an editor intended for word processing documents, and it is “fixing” your bad grammar, thus breaking the script.

Try “vi” (steep learning curve), or “nano” (fairly easy), or “joe” (I never tried it, but it is supposed to be okay for these kinds of tasks).

Joe is what I always use. It always worked in the past. Besides, wouldn’t “cat -A” show any illegal characters? I tried that already.

By the way this is what “hexedit” shows for the guilty line 32…

000006D8   20 73 74 61  72 74 0A 23  47 52 55 42  5F 49 4E 49  54 5F 54 55  4E 45 3D 22   start.#GRUB_INIT_TUNE="
000006F0   34 38 30 20  34 34 30 20  31 22 0A 23  20 53 6B 69  70 20 33 30  5F 6F 73 2D  480 440 1".# Skip 30_os-

I don’t see anything odd.

Sorry I forgot to answer your question, line 32 is NOT the last line.

On 2015-06-17 15:46, ionmich wrote:

> Joe is what I always use. It always worked in the past.

And it does, but by default it wraps lines. You have to toggle this
behaviour.

If you use “joe” in the “jstar” flavour, you type “ctrl-o”, to reach the
options, then “W” (W Word wrap ON) to set it off.

> Besides,
> wouldn’t “cat -A” show any illegal characters? I tried that already.

But it wraps.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

On 2015-06-17 15:26, nrickert wrote:
> Try “vi” (steep learning curve), or “nano” (fairly easy), or “joe” (I
> never tried it, but it is supposed to be okay for these kinds of tasks).

It is what I use, as “jstar”. There is also “jmacs” and “jpico” - all of
them are the same editor with different behaviour.

Another good one is “mcedit”, if ‘mc’, midnight commander is installed,
and I always do.

None of them add ‘"’, as far as I know.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

Many thanks! Jstar worked. But I did a get a warning…

  WARNING: lvmetad is running but disabled. Restart lvmetad before enabling it!
  No volume groups found
done

I have no idea what lvmetad does.

On 2015-06-17 16:06, ionmich wrote:
>
> By the way this is what “hexedit” shows for the guilty line 32…
>
>
> Code:
> --------------------
> 000006D8 20 73 74 61 72 74 0A 23 47 52 55 42 5F 49 4E 49 54 5F 54 55 4E 45 3D 22 start.#GRUB_INIT_TUNE="
> 000006F0 34 38 30 20 34 34 30 20 31 22 0A 23 20 53 6B 69 70 20 33 30 5F 6F 73 2D 480 440 1".# Skip 30_os-
> --------------------
>
>
> I don’t see anything odd.
>
> Sorry I forgot to answer your question, line 32 is NOT the last line.
>
>

nrickert is absolutely right. These two lines:


GRUB_CMDLINE_LINUX_DEFAULT=" resume=/dev/disk/by-uuid/40c9d08d-be72-4b80-abb0-b4d42c874871 splash=silent quiet showopts"
i915.modeset="1 tpm_tis.interrupts=0""

Should be one:


GRUB_CMDLINE_LINUX_DEFAULT=" resume=/dev/disk/by-uuid/40c9d08d-be72-4b80-abb0-b4d42c874871 splash=silent quiet showopts i915.modeset=1 tpm_tis.interrupts=0"

And beware of where the quotes are placed.
The original has an odd number of quotes, which offsets the parser and makes it issue an error on the wrong line number.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

That’s a standard “warning” which I standardly ignore.

As I understand it, “lvmetad” is a daemon that provides meta-data for logical volumes. It’s main purpose seems to be to create annoying messages that everybody ignores :stuck_out_tongue:

Yes “grub2-mkconfig” completed without an error but now I have a computer that will not boot. The usual login screen blacks out and asks for a username and password which then fails. This all started with a “zypper up”. Since I don’t understand how grub2 works I never fooled with /etc/default/grub, never edited it until “grub2-mkconfig” errored out.

So now what is the simplest way to get rid of grub2, revert to grub and fix things from a live USB boot? I understand grub and it has always worked for me.

On 2015-06-17 16:26, ionmich wrote:

> I have no idea what lvmetad does.


cer@Telcontar:~> apropos lvmetad
lvmetad (8)          - LVM metadata cache daemon
cer@Telcontar:~>


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

On 2015-06-17 16:46, ionmich wrote:
>
> Yes “grub2-mkconfig” completed without an error but now I have a
> computer that will not boot. The usual login screen blacks out and asks
> for a username and password which then fails. This all started with a
> “zypper up”. Since I don’t understand how grub2 works I never fooled
> with /etc/default/grub, never edited it until “grub2-mkconfig” errored
> out.

If you get a login prompt, the issue is not grub at all. You may try
login in text mode.

> So now what is the simplest way to get rid of grub2, revert to grub and
> fix things from a live USB boot? I understand grub and it has always
> worked for me.

You can not do that. Recently YaST does not support grub 1. Yes, I also
prefer grub 1.


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

Grub 1 is fine if you don’t have to deal with EFI. IMO get used to grub2 since grub 1 will die as more machine have UEFI

Well it’s nice to know about jstar and the wrap problem. And the news is not that bad. The upper part of the green lizard displays with a small black window under it. It asks for a username and password. I can log in as root. Then the screen clears and it displays the normal login box where I can now login as user.

I tried to re-configure the loader using YaST but it had no effect. I suspect I have to delete some grub2 file in order for YaST to work. Is my assumption something I should follow? This is my current /etc/default/grub…

cat /etc/default/grub  

# Modified by YaST2. Last modification on Wed Jun 17 19:30:08 EEST 2015
# THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader
# For the new kernel it try to figure out old parameters. In case we are not able to recognize it (e.g. change of flavor or strange install order ) it it use as fallback installation parameters from /etc/sysconfig/bootloader

# If you change this file, run 'grub2-mkconfig -o /boot/grub2/grub.cfg' afterwards to update
# /boot/grub2/grub.cfg.
GRUB_DISTRIBUTOR=openSUSE
GRUB_DEFAULT=saved
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=8
 GRUB_CMDLINE_LINUX_DEFAULT=" resume=/dev/disk/by-uuid/40c9d08d-be72-4b80-abb0-b4d42c874871 splash=silent quiet showopts  i915.modeset=1  tpm_tis.interrupts=0 vga=0x37d"
# kernel command line options for failsafe mode
GRUB_CMDLINE_LINUX_RECOVERY="showopts apm=off noresume edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe"
GRUB_CMDLINE_LINUX=""
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM=0x01234567,0xfefefefe,0x89abcdef,0xefefefef
# Uncomment to disable graphical terminal (grub-pc only)
GRUB_TERMINAL=gfxterm
# 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'
GRUB_GFXMODE=auto
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_LINUX_RECOVERY=true
# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
# Skip 30_os-prober if you experienced very slow in probing them
# WARNING foregin OS menu entries will be lost if set true here
GRUB_DISABLE_OS_PROBER=false
# Set to 'y' for grub to be installed on an encrypted partition
GRUB_ENABLE_CRYPTODISK=n
SUSE_BTRFS_SNAPSHOT_BOOTING=true
GRUB_BACKGROUND=/boot/grub2/themes/openSUSE/background.png
GRUB_THEME=/boot/grub2/themes/openSUSE/theme.txt

I’m wondering which green lizard that is. Is the the KDM login screen?

Comparing your “/etc/default/grub” with mine, the main difference is that for me the “GRUB_CMDLINE_LINUX_DEFAULT” line ends with:

... quiet showopts"

It does not have those extra options.