Grub.cfg malformed file error.

Started by Taliesin, 2014/10/11, 22:21:34

Previous topic - Next topic

Taliesin

Apologies if this is not in the correct forum section.

For some time now when booting my system I've been getting an "error: malformed file" in relation to GRUB2.

I'm still able to boot both Linux and Windows 7 (soley for gaming).

Unfortunately though I need to select Linux manually using the arrow keys, where it was the automatic default previously.

While not essential it is annoying.

Is it possible to repair grub.cfg?

If so how.

der_bud

Do you have a line starting with GRUB_SAVEDEFAULT in your /etc/default/grub?
Please post the content of /etc/default/grub and the output of ls -la /etc/grub.d/ . What happens when you issue (as root) the command os-prober ? Does another run of update-grub repeat that malformed-file-message?
Du lachst? Wieso lachst du? Das ist doch oft so, Leute lachen erst und dann sind sie tot.

Taliesin

Thank you for responding.

Below is the contents of my /etc/default/grub

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
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=console

# 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=1280x800x32
GRUB_GFXPAYLOAD_LINUX=1280x800x32
GRUB_GFXPAYLOAD_LINUX=keep

# 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_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"


It seems the lineGRUB_SAVEDEFAULT isn't present for some reason.

Also as asked for here is the output of ls -la /etc/grub.d/

drwxr-xr-x   2 root root  4096 Oct 11 12:58 .
drwxr-xr-x 152 root root 12288 Oct 11 13:00 ..
-rwxr-xr-x   1 root root  9424 Mar 18  2014 00_header
-rwxr-xr-x   1 root root  6058 Mar 31  2014 05_debian_theme
-rwxr-xr-x   1 root root 11611 Jul 24 11:06 10_linux
-rwxr-xr-x   1 root root   526 Feb  3  2012 20_ipxe
-rwxr-xr-x   1 root root 10418 Jul 24 11:06 20_linux_xen
-rwxr-xr-x   1 root root  1570 Nov 13  2011 20_memtest86+
-rwxr-xr-x   1 root root 11692 Apr 10  2014 30_os-prober
-rwxr-xr-x   1 root root  1416 Mar 18  2014 30_uefi-firmware
-rwxr-xr-x   1 root root   214 Nov 13  2011 40_custom
-rwxr-xr-x   1 root root   216 Feb  1  2013 41_custom
-rw-r--r--   1 root root   483 Nov 13  2011 README


Here also is the output of os-prober run as root.


  No volume groups found
/dev/sdb1:Windows 7 (loader):Windows:chain
/dev/sdc3:Debian GNU/Linux (5.0.8):Debian:linux


The listing for /dev/sdc3, refers to an old install of Debian Stable on a drive I have since installed on my PC from my old file server.

piper

QuoteIt seems the lineGRUB_SAVEDEFAULT isn't present for some reason.

It shouldn't be unless you added it yourself, the only distro that I have used that comes with it default is manjaro (arch), their might be more, but I haven't used one ;)


You could try and  take a copy of os-prober and put it somewhere safe and delete the original and then do update-grub and reboot, if the same error shows put back your copy and do update-grub again, no harm done, then I would look at ipxe next
I have a Lucky Rabbit:    "Svoot" ..... (It's Swedish)

I am MAGA

der_bud

Quote from: Taliesin on 2014/10/12, 00:49:07
... It seems the lineGRUB_SAVEDEFAULT isn't present for some reason...
It is ok this line isn't there (=default), I just asked because it often seems to be the reason for trouble.
Odd is you have a double GRUB_GFXPAYLOAD_LINUX, that is unnecessary or perhaps already the reason for 'malformed file'. Leave the one ending with keep and comment # the other one.
Du lachst? Wieso lachst du? Das ist doch oft so, Leute lachen erst und dann sind sie tot.