LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-30-2015, 11:51 PM   #1
jnojr
Member
 
Registered: Sep 2007
Location: Chandler, AZ
Posts: 227

Rep: Reputation: 20
Question 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?
 
Old 05-01-2015, 12:49 AM   #2
Keruskerfuerst
Senior Member
 
Registered: Oct 2005
Location: Horgau, Germany
Distribution: Manjaro KDE, Win 10
Posts: 2,199

Rep: Reputation: 164Reputation: 164
Please post /etc/grub/grub.cfg.
 
Old 05-01-2015, 10:43 AM   #3
Soadyheid
Senior Member
 
Registered: Aug 2010
Location: Near Edinburgh, Scotland
Distribution: Cinnamon Mint 20.1 (Laptop) and 20.2 (Desktop)
Posts: 1,672

Rep: Reputation: 486Reputation: 486Reputation: 486Reputation: 486Reputation: 486
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!

Last edited by Soadyheid; 05-01-2015 at 10:46 AM. Reason: Missed the Ops command on first read. Duh!
 
1 members found this post helpful.
Old 05-01-2015, 11:25 AM   #4
jnojr
Member
 
Registered: Sep 2007
Location: Chandler, AZ
Posts: 227

Original Poster
Rep: Reputation: 20
Quote:
Originally Posted by Keruskerfuerst View Post
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"
 
Old 05-01-2015, 12:49 PM   #5
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,508

Rep: Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491
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.
 
Old 05-01-2015, 01:40 PM   #6
jnojr
Member
 
Registered: Sep 2007
Location: Chandler, AZ
Posts: 227

Original Poster
Rep: Reputation: 20
Quote:
Originally Posted by yancek View Post
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 ###
 
Old 05-01-2015, 04:23 PM   #7
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,508

Rep: Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491Reputation: 2491
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.
 
Old 05-02-2015, 06:07 AM   #8
Head_on_a_Stick
Senior Member
 
Registered: Dec 2014
Location: London, England
Distribution: Debian stable (and OpenBSD-current)
Posts: 1,187

Rep: Reputation: 285Reputation: 285Reputation: 285
Quote:
Originally Posted by jnojr View Post
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
 
Old 05-02-2015, 08:05 AM   #9
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Quote:
Originally Posted by Soadyheid View Post
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!
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.
 
Old 05-03-2015, 01:17 PM   #10
Soadyheid
Senior Member
 
Registered: Aug 2010
Location: Near Edinburgh, Scotland
Distribution: Cinnamon Mint 20.1 (Laptop) and 20.2 (Desktop)
Posts: 1,672

Rep: Reputation: 486Reputation: 486Reputation: 486Reputation: 486Reputation: 486
Hi 273,

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

Play Bonny!

 
Old 05-05-2015, 09:10 PM   #11
jnojr
Member
 
Registered: Sep 2007
Location: Chandler, AZ
Posts: 227

Original Poster
Rep: Reputation: 20
Quote:
Originally Posted by Soadyheid View Post
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.
 
Old 05-05-2015, 09:14 PM   #12
jnojr
Member
 
Registered: Sep 2007
Location: Chandler, AZ
Posts: 227

Original Poster
Rep: Reputation: 20
Quote:
Originally Posted by Head_on_a_Stick View Post
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
 
Old 05-06-2015, 01:47 AM   #13
Head_on_a_Stick
Senior Member
 
Registered: Dec 2014
Location: London, England
Distribution: Debian stable (and OpenBSD-current)
Posts: 1,187

Rep: Reputation: 285Reputation: 285Reputation: 285
Quote:
Originally Posted by jnojr View Post
I did, in post #6
No, you didn't -- you posted /boot/grub/grub.cfg

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


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
grub using the wrong grub.conf file Erik99 Linux - Newbie 2 02-20-2008 09:34 PM
Grub on wrong hdd mjmeche Linux - Newbie 2 12-06-2007 08:34 AM
what's wrong with grub? cucmi Linux - Newbie 7 05-08-2006 08:39 PM
Something wrong with GRUB Cybes51 Linux - Software 13 03-16-2005 06:22 PM
Grub wrong can't boot *anything* Bruce Hill Linux - Newbie 3 07-23-2003 09:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration