LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Something's wrong with GRUB (https://www.linuxquestions.org/questions/linux-newbie-8/somethings-wrong-with-grub-4175541281/)

jnojr 04-30-2015 11:51 PM

Something's wrong with GRUB
 
Ubuntu 12.04

I installed updates, which included a new kernel. I went to remove one of the older kernels and got:

Code:

jnojr@DEV:~$ sudo apt-get purge linux-image-3.13.0-46-generic
Reading package lists... Done
Building dependency tree     
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-3.13.0-46-generic gir1.2-ubuntuoneui-3.0 wireless-regdb iw
  linux-headers-3.13.0-46 crda linux-headers-3.5.0-23-generic lesstif2
  linux-headers-3.5.0-23 libubuntuoneui-3.0-1 thunderbird-globalmenu
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  linux-image-3.13.0-46-generic*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 197 MB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 340656 files and directories currently installed.)
Removing linux-image-3.13.0-46-generic ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.13.0-46-generic /boot/vmlinuz-3.13.0-46-generic
update-initramfs: Deleting /boot/initrd.img-3.13.0-46-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.13.0-46-generic /boot/vmlinuz-3.13.0-46-generic
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.13.0-51-generic
Found initrd image: /boot/initrd.img-3.13.0-51-generic
Found linux image: /boot/vmlinuz-3.13.0-49-generic
Found initrd image: /boot/initrd.img-3.13.0-49-generic
Found linux image: /boot/vmlinuz-3.13.0-48-generic
Found initrd image: /boot/initrd.img-3.13.0-48-generic
Found Windows Vista (loader) on /dev/sda1
Found CentOS release 6.6 (Final) on /dev/sdb1
Found linux image: /boot/vmlinuz-3.13.0-51-generic
Found initrd image: /boot/initrd.img-3.13.0-51-generic
Found linux image: /boot/vmlinuz-3.13.0-49-generic
Found initrd image: /boot/initrd.img-3.13.0-49-generic
Found linux image: /boot/vmlinuz-3.13.0-48-generic
Found initrd image: /boot/initrd.img-3.13.0-48-generic
Found Windows Vista (loader) on /dev/sda1
Found CentOS release 6.6 (Final) on /dev/sdb1
Found memtest86+ image: /boot/memtest86+.bin
error: syntax error.
error: Incorrect command.
error: syntax error.
error: Incorrect command.
error: syntax error.
error: line no: 146
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.
done
Purging configuration files for linux-image-3.13.0-46-generic ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.13.0-46-generic /boot/vmlinuz-3.13.0-46-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.13.0-46-generic /boot/vmlinuz-3.13.0-46-generic

I have no idea how I'd "ensure there are no errors" in the /etc/grub related files... I have no idea what's supposed to be there. Looking at the line it's complaining about in /boot/grub/grub.cfg.new doesn't tell me anything. How do i find out what it's unhappy about?

Keruskerfuerst 05-01-2015 12:49 AM

Please post /etc/grub/grub.cfg.

Soadyheid 05-01-2015 10:43 AM

How exactly did you remove the old kernel? --> Oops! OK, I caught it on the "re-read!"
I haven't tried this yet on my present Mint 17 system but when I was running Ubuntu 10.4 I just went in to /boot and ran
Code:

$sudo rm abi-3.xx.x-xx-generic
$sudo rm config-3.xx.x-xx-generic
$sudo rm initrd.img-3.xx.x-xx-generic
$sudo rm System.map-3.xx.x-xx-generic
$sudo rm vmlinuz-3.xx.x-xx-generic
$sudo update-grub

then I rebooted the system and it was gone! (Be VERY careful you don't zap a wrong file!)

I now usually try to keep at least three kernels in /boot as if I do an update which screws up, I just reboot and select an older one then remove the flakey one as above.

I think Ubuntu 12.04 may use Grub2(?) in which case check this out

Play Bonny!
:hattip:

jnojr 05-01-2015 11:25 AM

Quote:

Originally Posted by Keruskerfuerst (Post 5356027)
Please post /etc/grub/grub.cfg.

I didn't because it's so incredibly basic...

Code:

# 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_HIDDEN_TIMEOUT="0"
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
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="640x480"

# 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"


yancek 05-01-2015 12:49 PM

The message in your initial post indicates there is a syntax error on line 146 of the /boot/grub/grub.cfg file which is why you were asked to post at least that part of it. Someone might be able to tell you what is wrong with the line if you posted it.

jnojr 05-01-2015 01:40 PM

Quote:

Originally Posted by yancek (Post 5356270)
The message in your initial post indicates there is a syntax error on line 146 of the /boot/grub/grub.cfg file which is why you were asked to post at least that part of it. Someone might be able to tell you what is wrong with the line if you posted it.

They'd asked about /etc, not /boot.

Code:

#
# 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 ###
if [ -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
set default="0"
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 recordfail {
  set recordfail=1
  if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}

function load_video {
  insmod vbe
  insmod vga
  insmod video_bochs
  insmod video_cirrus
}

insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  insmod part_msdos
  insmod ext2
  set root='(hd0,msdos3)'
  search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
  set locale_dir=($root)/boot/grub/locale
  set lang=en_US
  insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
  set timeout=-1
else
  set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
if background_color 44,0,30; then
  clear
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux_proxy ###
menuentry "Ubuntu, with Linux 3.13.0-48-generic" --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        gfxmode $linux_gfx_mode
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos3)'
        search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
        linux        /boot/vmlinuz-3.13.0-48-generic root=UUID=105996f5-ba7e-46f4-b0de-eb5299a19563 ro  quiet splash $vt_handoff
        initrd        /boot/initrd.img-3.13.0-48-generic
}
menuentry "Ubuntu, with Linux 3.13.0-48-generic (recovery mode)" --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos3)'
        search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
        echo        'Loading Linux 3.13.0-48-generic ...'
        linux        /boot/vmlinuz-3.13.0-48-generic root=UUID=105996f5-ba7e-46f4-b0de-eb5299a19563 ro recovery nomodeset
        echo        'Loading initial ramdisk ...'
        initrd        /boot/initrd.img-3.13.0-48-generic
}
function gfxmode {
        set gfxpayload="${1}"
        if [ "${1}" = "keep" ]; then
                set vt_handoff=vt.handoff=7
        else
                set vt_handoff=
        fi
}
if [ "${recordfail}" != 1 ]; then
  if [ -e ${prefix}/gfxblacklist.txt ]; then
    if hwmatch ${prefix}/gfxblacklist.txt 3; then
      if [ ${match} = 0 ]; then
        set linux_gfx_mode=keep
      else
        set linux_gfx_mode=text
      fi
    else
      set linux_gfx_mode=text
    fi
  else
    set linux_gfx_mode=keep
  fi
else
  set linux_gfx_mode=text
fi
export linux_gfx_mode
if [ "${linux_gfx_mode}" != "text" ]; then load_video; fi
menuentry "Ubuntu, with Linux 3.13.0-46-generic" --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        gfxmode $linux_gfx_mode
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos3)'
        search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
        linux        /boot/vmlinuz-3.13.0-46-generic root=UUID=105996f5-ba7e-46f4-b0de-eb5299a19563 ro  quiet splash $vt_handoff
        initrd        /boot/initrd.img-3.13.0-46-generic
}
### END /etc/grub.d/10_linux_proxy ###

### BEGIN /etc/grub.d/30_os-prober_proxy ###
set timeout_style=menu
if [ "${timeout}" = 0 ]; then
  set timeout=10
fi
menuentry "CentOS release 6.6 (Final) (on /dev/sdb1)" --class gnu-linux --class gnu --class os {
        insmod part_msdos
        insmod ext2
        set root='(hd1,msdos1)'
        search --no-floppy --fs-uuid --set=root 3bc75d12-4328-4e95-9274-8a825181d0d2
        linux /boot/vmlinuz-2.6.32-504.12.2.el6.x86_64 root=/dev/sdb1
        initrd /boot/initramfs-2.6.32-504.12.2.el6.x86_64.img
}
menuentry "Windows Vista (on /dev/sda1)" --class windows --class os {
        insmod part_msdos
        insmod ntfs
        set root='(hd0,msdos1)'
        search --no-floppy --fs-uuid --set=root 5E286952286929EB
        chainloader +1
}
### END /etc/grub.d/30_os-prober_proxy ###

### BEGIN /etc/grub.d/31_linux_proxy ###
menuentry "Ubuntu, with Linux 3.13.0-46-generic (recovery mode)" --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos3)'
        search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
        echo        'Loading Linux 3.13.0-46-generic ...'
        linux        /boot/vmlinuz-3.13.0-46-generic root=UUID=105996f5-ba7e-46f4-b0de-eb5299a19563 ro recovery nomodeset
        echo        'Loading initial ramdisk ...'
        initrd        /boot/initrd.img-3.13.0-46-generic
}
submenu "Previous Linux versions"{
menuentry "Ubuntu, with Linux 3.5.0-54-generic" --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        gfxmode $linux_gfx_mode
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos3)'
        search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
        linux        /boot/vmlinuz-3.5.0-54-generic root=UUID=105996f5-ba7e-46f4-b0de-eb5299a19563 ro  quiet splash $vt_handoff
        initrd        /boot/initrd.img-3.5.0-54-generic
}
menuentry "Ubuntu, with Linux 3.5.0-54-generic (recovery mode)" --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos3)'
        search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
        echo        'Loading Linux 3.5.0-54-generic ...'
        linux        /boot/vmlinuz-3.5.0-54-generic root=UUID=105996f5-ba7e-46f4-b0de-eb5299a19563 ro recovery nomodeset
        echo        'Loading initial ramdisk ...'
        initrd        /boot/initrd.img-3.5.0-54-generic
}
menuentry "CentOS release 6.6 (Final) (on /dev/sdb1)" --class gnu-linux --class gnu --class os {
        insmod part_msdos
        insmod ext2
        set root='(hd1,msdos1)'
        search --no-floppy --fs-uuid --set=root 3bc75d12-4328-4e95-9274-8a825181d0d2
        linux /boot/vmlinuz-2.6.32-504.8.1.el6.x86_64 root=/dev/sdb1
        initrd /boot/initramfs-2.6.32-504.8.1.el6.x86_64.img
}
}
### END /etc/grub.d/31_linux_proxy ###

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

### BEGIN /etc/grub.d/34_memtest86+ ###
menuentry "Memory test (memtest86+)" {
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos3)'
        search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
        linux16        /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos3)'
        search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
        linux16        /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/34_memtest86+ ###

### BEGIN /etc/grub.d/35_uefi-firmware ###
### END /etc/grub.d/35_uefi-firmware ###

### 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  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###


yancek 05-01-2015 04:23 PM

Quote:

They'd asked about /etc, not /boot.
The end of the message suggests you also check /etc/default/grub for possible errors. The file you posted is the standard default. The error message was produced while "Generating grub.cfg" file. It specifically states a syntax error on line 146 of that file not /etc/default/grub which has no where near 146 lines. It might have been a good idea to point out that line yourself rather than waiting for someone here willing to do it.

Head_on_a_Stick 05-02-2015 06:07 AM

Quote:

Originally Posted by jnojr (Post 5356017)
Code:

error: syntax error.
error: Incorrect command.
error: syntax error.
error: Incorrect command.
error: syntax error.
error: line no: 146
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.


Post the content of /boot/grub/grub.cfg.new -- this contains the syntax error.

Please also post the content of /etc/kernel/postrm.d/zz-update-grub

273 05-02-2015 08:05 AM

Quote:

Originally Posted by Soadyheid (Post 5356209)
How exactly did you remove the old kernel? --> Oops! OK, I caught it on the "re-read!"
I haven't tried this yet on my present Mint 17 system but when I was running Ubuntu 10.4 I just went in to /boot and ran
Code:

$sudo rm abi-3.xx.x-xx-generic
$sudo rm config-3.xx.x-xx-generic
$sudo rm initrd.img-3.xx.x-xx-generic
$sudo rm System.map-3.xx.x-xx-generic
$sudo rm vmlinuz-3.xx.x-xx-generic
$sudo update-grub

then I rebooted the system and it was gone! (Be VERY careful you don't zap a wrong file!)

I now usually try to keep at least three kernels in /boot as if I do an update which screws up, I just reboot and select an older one then remove the flakey one as above.

I think Ubuntu 12.04 may use Grub2(?) in which case check this out

Play Bonny!
:hattip:

I want to point to this post as the more likely answer. I have seen pretty much the same error as the OP (I don't recall the line reported as the error but I recall the error) and simply running update-grub resolved it. I should say I am running Debian Sid not Ubuntu but my packages will be pretty close to the Ubuntu ones.

Soadyheid 05-03-2015 01:17 PM

Hi 273,

Thanks for the recognition. (The cheque's in the post... :D )

Play Bonny!

:hattip:

jnojr 05-05-2015 09:10 PM

Quote:

Originally Posted by Soadyheid (Post 5356209)
How exactly did you remove the old kernel? --> Oops! OK, I caught it on the "re-read!"
I haven't tried this yet on my present Mint 17 system but when I was running Ubuntu 10.4 I just went in to /boot and ran
Code:

$sudo rm abi-3.xx.x-xx-generic
$sudo rm config-3.xx.x-xx-generic
$sudo rm initrd.img-3.xx.x-xx-generic
$sudo rm System.map-3.xx.x-xx-generic
$sudo rm vmlinuz-3.xx.x-xx-generic
$sudo update-grub

then I rebooted the system and it was gone! (Be VERY careful you don't zap a wrong file!)

Code:

joliver@JOHN-DEV:~$ sudo update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.13.0-51-generic
Found initrd image: /boot/initrd.img-3.13.0-51-generic
Found linux image: /boot/vmlinuz-3.13.0-49-generic
Found initrd image: /boot/initrd.img-3.13.0-49-generic
Found Windows Vista (loader) on /dev/sda1
Found CentOS release 6.6 (Final) on /dev/sdb1
Found linux image: /boot/vmlinuz-3.13.0-51-generic
Found initrd image: /boot/initrd.img-3.13.0-51-generic
Found linux image: /boot/vmlinuz-3.13.0-49-generic
Found initrd image: /boot/initrd.img-3.13.0-49-generic
Found Windows Vista (loader) on /dev/sda1
Found CentOS release 6.6 (Final) on /dev/sdb1
Found memtest86+ image: /boot/memtest86+.bin
error: syntax error.
error: Incorrect command.
error: syntax error.
error: Incorrect command.
error: syntax error.
error: line no: 146
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.
done
joliver@JOHN-DEV:~$ cat /boot/grub/grub.cfg.new
#
# 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 ###
if [ -s $prefix/grubenv ]; then
  set have_grubenv=true
  load_env
fi
set default="0"
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 recordfail {
  set recordfail=1
  if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}

function load_video {
  insmod vbe
  insmod vga
  insmod video_bochs
  insmod video_cirrus
}

insmod part_msdos
insmod ext2
set root='(hd0,msdos3)'
search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  insmod part_msdos
  insmod ext2
  set root='(hd0,msdos3)'
  search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
  set locale_dir=($root)/boot/grub/locale
  set lang=en_US
  insmod gettext
fi
terminal_output gfxterm
if [ "${recordfail}" = 1 ] ; then
  set timeout=-1
else
  set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
if background_color 44,0,30; then
  clear
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux_proxy ###
menuentry "Ubuntu, with Linux 3.13.0-51-generic" --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        gfxmode $linux_gfx_mode
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos3)'
        search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
        linux        /boot/vmlinuz-3.13.0-51-generic root=UUID=105996f5-ba7e-46f4-b0de-eb5299a19563 ro  quiet splash $vt_handoff
        initrd        /boot/initrd.img-3.13.0-51-generic
}
menuentry "Ubuntu, with Linux 3.13.0-51-generic (recovery mode)" --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos3)'
        search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
        echo        'Loading Linux 3.13.0-51-generic ...'
        linux        /boot/vmlinuz-3.13.0-51-generic root=UUID=105996f5-ba7e-46f4-b0de-eb5299a19563 ro recovery nomodeset
        echo        'Loading initial ramdisk ...'
        initrd        /boot/initrd.img-3.13.0-51-generic
}
### END /etc/grub.d/10_linux_proxy ###

### BEGIN /etc/grub.d/30_os-prober_proxy ###
set timeout_style=menu
if [ "${timeout}" = 0 ]; then
  set timeout=10
fi
menuentry "CentOS release 6.6 (Final) (on /dev/sdb1)" --class gnu-linux --class gnu --class os {
        insmod part_msdos
        insmod ext2
        set root='(hd1,msdos1)'
        search --no-floppy --fs-uuid --set=root 3bc75d12-4328-4e95-9274-8a825181d0d2
        linux /boot/vmlinuz-2.6.32-504.12.2.el6.x86_64 root=/dev/sdb1
        initrd /boot/initramfs-2.6.32-504.12.2.el6.x86_64.img
}
menuentry "Windows Vista (on /dev/sda1)" --class windows --class os {
        insmod part_msdos
        insmod ntfs
        set root='(hd0,msdos1)'
        search --no-floppy --fs-uuid --set=root 5E286952286929EB
        chainloader +1
}
### END /etc/grub.d/30_os-prober_proxy ###

### BEGIN /etc/grub.d/33_linux_proxy ###
submenu "Previous Linux versions"{
menuentry "Ubuntu, with Linux 3.13.0-49-generic" --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        gfxmode $linux_gfx_mode
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos3)'
        search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
        linux        /boot/vmlinuz-3.13.0-49-generic root=UUID=105996f5-ba7e-46f4-b0de-eb5299a19563 ro  quiet splash $vt_handoff
        initrd        /boot/initrd.img-3.13.0-49-generic
}
menuentry "Ubuntu, with Linux 3.13.0-49-generic (recovery mode)" --class ubuntu --class gnu-linux --class gnu --class os {
        recordfail
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos3)'
        search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
        echo        'Loading Linux 3.13.0-49-generic ...'
        linux        /boot/vmlinuz-3.13.0-49-generic root=UUID=105996f5-ba7e-46f4-b0de-eb5299a19563 ro recovery nomodeset
        echo        'Loading initial ramdisk ...'
        initrd        /boot/initrd.img-3.13.0-49-generic
}
function gfxmode {
        set gfxpayload="${1}"
        if [ "${1}" = "keep" ]; then
                set vt_handoff=vt.handoff=7
        else
                set vt_handoff=
        fi
}
if [ "${recordfail}" != 1 ]; then
  if [ -e ${prefix}/gfxblacklist.txt ]; then
    if hwmatch ${prefix}/gfxblacklist.txt 3; then
      if [ ${match} = 0 ]; then
        set linux_gfx_mode=keep
      else
        set linux_gfx_mode=text
      fi
    else
      set linux_gfx_mode=text
    fi
  else
    set linux_gfx_mode=keep
  fi
else
  set linux_gfx_mode=text
fi
export linux_gfx_mode
if [ "${linux_gfx_mode}" != "text" ]; then load_video; fi
menuentry "CentOS release 6.6 (Final) (on /dev/sdb1)" --class gnu-linux --class gnu --class os {
        insmod part_msdos
        insmod ext2
        set root='(hd1,msdos1)'
        search --no-floppy --fs-uuid --set=root 3bc75d12-4328-4e95-9274-8a825181d0d2
        linux /boot/vmlinuz-2.6.32-504.8.1.el6.x86_64 root=/dev/sdb1
        initrd /boot/initramfs-2.6.32-504.8.1.el6.x86_64.img
}
}
### END /etc/grub.d/33_linux_proxy ###

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

### BEGIN /etc/grub.d/35_memtest86+ ###
menuentry "Memory test (memtest86+)" {
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos3)'
        search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
        linux16        /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos3)'
        search --no-floppy --fs-uuid --set=root 105996f5-ba7e-46f4-b0de-eb5299a19563
        linux16        /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/35_memtest86+ ###

### BEGIN /etc/grub.d/36_uefi-firmware ###
### END /etc/grub.d/36_uefi-firmware ###

### 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  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

:(

Line 146 is:

Code:

function gfxmode {
All open '{' are closed with '}' That is inside the 'submenu' section, maybe something's confusing it that way? But the submenu is closed as well.

jnojr 05-05-2015 09:14 PM

Quote:

Originally Posted by Head_on_a_Stick (Post 5356579)
Post the content of /boot/grub/grub.cfg.new -- this contains the syntax error.

I did, in post #6

Quote:

Please also post the content of /etc/kernel/postrm.d/zz-update-grub
Code:

joliver@JOHN-DEV:~$ cat /etc/kernel/postrm.d/zz-update-grub
#! /bin/sh
set -e

which update-grub >/dev/null 2>&1 || exit 0

if type running-in-container >/dev/null 2>&1 && \
  running-in-container >/dev/null; then
        exit 0
fi

set -- $DEB_MAINT_PARAMS
mode="${1#\'}"
mode="${mode\'}"
case $0:$mode in
    # Only run on postinst configure and postrm remove, to avoid wasting
    # time by calling update-grub multiple times on upgrade and removal.
    # Also run if we have no DEB_MAINT_PARAMS, in order to work with old
    # kernel packages.
    */postinst.d/*:|*/postinst.d/*:configure|*/postrm.d/*:|*/postrm.d/*:remove)
        exec update-grub
        ;;
esac

exit 0


Head_on_a_Stick 05-06-2015 01:47 AM

Quote:

Originally Posted by jnojr (Post 5358522)
I did, in post #6

No, you didn't -- you posted /boot/grub/grub.cfg

We need to see /boot/grub/grub.cfg.new


All times are GMT -5. The time now is 10:47 PM.