LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Unable to change the grub (https://www.linuxquestions.org/questions/linux-newbie-8/unable-to-change-the-grub-4175587243/)

purpleyoast 08-17-2016 01:59 AM

Unable to change the grub
 
I am a total Linux noob, so it is probably something simple that I'm missing but I have exhausted all search options and nothing has worked. And possibly I am posting this in the wrong place, so my apologies if that is the case.

I did a clean install of Kodibuntu (Lubuntu with Kodi) and updated it as outlined by the wiki (sudo apt-get update && sudo apt-get upgrade). So the machine is now running Lubuntu 14.04 up to date as of 2016-08-17.

The issue I am having is with the Lubuntu shell. I am unable to get the grub at startup to disappear. It has been there since installation and is persistent after two clean installs. The grub being there is an issue as the machine running it is controlled via touchscreen and remote, so no option to select anything in the grub, and the grub never times out.


When I boot I see the following options without a timeout counter:
Code:

[  ] Ubuntu
[  ] Advanced options for Ubuntu with
[  ] Memory test (memtest86x)
[  ] Memory test (memtest86x. serial console 11520)

The content of "grub":
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=0
GRUB_TIMEOUT_STYLE=countdown
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"
GRUB_GFXPAYLOAD_LINUX=keep
GRUB_RECORDFAIL_TIMEOUT=1


The content of "grub.cfg":
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
if [ "${next_entry}" ] ; then
  set default="${next_entry}"
  set next_entry=
  save_env next_entry
  set boot_once=true
else
  set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

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 {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
  font=unicode
else
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5  801c66b8-e7e0-4b85-b050-aa5b1104ee11
else
  search --no-floppy --fs-uuid --set=root 801c66b8-e7e0-4b85-b050-aa5b1104ee11
fi
    font="/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_output gfxterm
 if [ "${recordfail}" = 1 ] ; then
  set timeout=1
 else
  if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=countdown
    set timeout=0
  # Fallback hidden-timeout code in case the timeout_style feature is
  # unavailable.
  elif sleep --interruptible 1 ; then
    set timeout=0
  fi
 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
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
function gfxmode {
    set gfxpayload="${1}"
    if [ "${1}" = "keep" ]; then
        set vt_handoff=vt.handoff=7
    else
        set vt_handoff=
    fi
}
set linux_gfx_mode=keep
export linux_gfx_mode

### END /etc/grub.d/10_linux ###

### 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  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

I followed several 'solutions' I found online, but nothing seems to work. I changed the grub file, moved several files (with number 30) from /etc/grub.d and ran "sudo update-grub" and saw "grub.cfg" update to what you see above. I would expect there to be no options like memtest in the grub anymore, but yet they are still appearing.

Also, setting "GRUB_HIDDEN_TIMEOUT_QUIET=false" and "GRUB_TIMEOUT=1" has no effect.

Does anybody know how I could get the grub to timeout (or better yet, not to come up at all)?

sundialsvcs 08-17-2016 01:10 PM

Just to cover all bases here: did you info -f grub -n 'Simple configuration' ??

purpleyoast 08-17-2016 01:18 PM

This post took some time before it was up, I stopped checking four hours after I posted it. Since then I actually found an answer.

Installing grub again made it adhere to what is in grub.cfg, but it did remove the splashscreen that was there before (and I haven't found a way of getting it back, or implementing a new one).

Installing again was done with:
Code:

sudo grub-install /dev/sda

malekmustaq 08-18-2016 07:12 AM

Quote:

I did a clean install of Kodibuntu (Lubuntu with Kodi) and updated it as outlined by the wiki (sudo apt-get update && sudo apt-get upgrade). So the machine is now running Lubuntu 14.04 up to date as of 2016-08-17.
There is no harm in general OS updating or upgrading so long as you can cope up the often nasty consequence. I am no longer using any *buntu, nay Mint, so I cannot say with certainty anymore what happens generally speaking after a universal upgrade or update. But the general attitude should be *not to update or upgrade if it is NOT broke*. Security patches in Gnu/Linux OS's are given in detailed bits so you can do it in *isolated* work out.

I wonder the recent trend of hastily upgrading and updating. This probably came with the Microsoft Mentality brought in by migrants from that world. Such an attitude was not decades ago in Gnu/Linux community, save on truly serious security issues where the upgraders talk first about the library and dependency issues, but not in a simple *click right away* action.

Just a reminder from those who came from Redmond mental conditioning machine: There is no need to update or upgrade, unless it is truly necessary.


Quote:

Also, setting "GRUB_HIDDEN_TIMEOUT_QUIET=false" and "GRUB_TIMEOUT=1" has no effect.
Does anybody know how I could get the grub to timeout (or better yet, not to come up at all)?

Set the timeout to 20 seconds and you will have a twenty lonely seconds wait.

Do this:
Code:

sudo vi /etc/default/grub <or you can use whatever text editor you have there>
sudo leafpad /etc/default/grub

edit the timeout:
GRUB_TIMEOUT=20
then run the update-grub to update /boot/grub/grub.cfg.
Code:

sudo /usr/sbin/update-grub
there is no need to run grub-mkconfig nor change anything from the scripts in /etc/grub.d.
However, should your distro need run mkconfig then by all means run it first:
Be sure first where the grub.cfg file is located and make it your target -o file, example:
Code:

sudo grub-mkconfig -o /boot/grub/grub.cfg
sudo update-grub

Reboot.

Hope that helps. Good luck and enjoy.

m.m.

purpleyoast 08-19-2016 08:09 AM

Quote:

Originally Posted by malekmustaq (Post 5592458)
There is no harm in general OS updating or upgrading so long as you can cope up the often nasty consequence. I am no longer using any *buntu, nay Mint, so I cannot say with certainty anymore what happens generally speaking after a universal upgrade or update. But the general attitude should be *not to update or upgrade if it is NOT broke*. Security patches in Gnu/Linux OS's are given in detailed bits so you can do it in *isolated* work out.

I wonder the recent trend of hastily upgrading and updating. This probably came with the Microsoft Mentality brought in by migrants from that world. Such an attitude was not decades ago in Gnu/Linux community, save on truly serious security issues where the upgraders talk first about the library and dependency issues, but not in a simple *click right away* action.

Just a reminder from those who came from Redmond mental conditioning machine: There is no need to update or upgrade, unless it is truly necessary.

The reason I sun the update is to update Kodi. That software has gotten some essential updates. For one of the clean installations I ran an update just on Kodi and the same error occurred with the grub. The last time I just took the easier route of running "sudo apt-get update && sudo apt-get upgrade" as that involved a lot less keystrokes ;)

Quote:

Originally Posted by malekmustaq (Post 5592458)
Set the timeout to 20 seconds and you will have a twenty lonely seconds wait.

Do this:
Code:

sudo vi /etc/default/grub <or you can use whatever text editor you have there>
sudo leafpad /etc/default/grub

edit the timeout:
GRUB_TIMEOUT=20
then run the update-grub to update /boot/grub/grub.cfg.
Code:

sudo /usr/sbin/update-grub
there is no need to run grub-mkconfig nor change anything from the scripts in /etc/grub.d.
However, should your distro need run mkconfig then by all means run it first:
Be sure first where the grub.cfg file is located and make it your target -o file, example:
Code:

sudo grub-mkconfig -o /boot/grub/grub.cfg
sudo update-grub

Reboot.

Hope that helps. Good luck and enjoy.

m.m.

Setting the timeout to any number had no effect. Although I didn't test with 20 (only with 1, 5, 10 and 30), I am sure that setting it to 20 would have made no difference. I waited for 5 minutes with the timeout set to 30 and the grub didn't do anything...

It was clear that I could make changes to /etc/default/grub and then run "sudo update-grub" to see /boot/grub/grub.cfg change accordingly. However, these changes have no effect on the grub displayed during boot. Even after installing grub again, I am unable to make any changes to the grub via this route.

malekmustaq 08-19-2016 08:25 AM

Can you run post us first what is seen by grub inside after running */usr/sbin/grub-probe*?

purpleyoast 08-19-2016 10:56 AM

Quote:

Originally Posted by malekmustaq (Post 5593010)
Can you run post us first what is seen by grub inside after running */usr/sbin/grub-probe*?

I didn't know about that feature. I'll try it when I'm back home on Monday. Thank you for all the help BTW, it is much appreciated!

purpleyoast 08-24-2016 10:11 AM

It took some time for me to get around to working on this issue.

I must have misunderstood what you wanted me to try, because running */usr/sbin/grub-probe* resulted in "No path or device is specified.".

So I looked online as what would normally be commands for grub-probe to get any results and I did the following:

*grub-probe -t device /boot/grub* results in "/dev/sda1"

and

*grub-probe --target=drive --device /dev/sda1* results in "warning: disk does not exist"

But I have no idea if this helps at all. Note that I have a separate boot partition.

IsaacKuo 08-24-2016 11:27 AM

Make sure to install grub to the mbr with the following procedure:

step 1 - confirm the device you want to install to with

Code:

sudo fdisk -l
Since you already have a separate /boot partition, it should be pretty obvious which device is the correct one. I'll assume it is /dev/sda.

Then, you want to install grub with

Code:

sudo grub-install /dev/sda
This is assuming you have already updated grub with update-grub, which I'm supposing you have already done multiple times so far. However, I am worried. The grub.cfg you posted above does NOT look like it has any valid menu entries at all. To me, it looks like the mbr either has LILO or an old legacy grub setup, and it's kind of a miracle that you can boot into your newly installed OS at all.

So I'd recommend doing a more comprehensive procedure:

1st - check /etc/fstab to make sure the entry for /boot is sane. It should be some normal file system probably referencing a UUID but also with a comment indicating which partition it was when originally installed (something like /dev/sda5)

2nd - assuming /boot seems sane, update /boot/grub/grub.cfg with:

Code:

sudo update-grub
This should give feedback indicating that it has found at least one Linux OS. If not, then...well that's not good. Don't procede with the rest of this.

3rd - Check the contents of /boot/grub/grub.cfg to see if it looks sane. There should hopefully be one or more menuentry for your Linux OS. Look at the top one. There should be a line saying something like "set root='hd0,msdos4'", where 0=sda, 4=sda5 (add one to both numbers). Since you have a separate /boot partition, the linux and initrd lines should look something like:

echo 'Loading Linux ...'
linux /vmlinuz-3.16.0-4-646-pae root=UUID=5345325342634 ro quiet
echo 'Loading initial ramdisk ...'
initrd /initrd.img-3.16.0-4-686-pae

4th - If this looks sane, then install grub to the disk's main boot record (mbr) with:

Code:

sudo grub-install /dev/sda
Like I said, if sda isn't the right device, then adjust all of the above accordingly.

purpleyoast 09-02-2016 05:44 AM

Quote:

Originally Posted by IsaacKuo (Post 5595428)
Make sure to install grub to the mbr with the following procedure:

step 1 - confirm the device you want to install to with

Code:

sudo fdisk -l
Since you already have a separate /boot partition, it should be pretty obvious which device is the correct one. I'll assume it is /dev/sda.

Then, you want to install grub with

Code:

sudo grub-install /dev/sda
This is assuming you have already updated grub with update-grub, which I'm supposing you have already done multiple times so far. However, I am worried. The grub.cfg you posted above does NOT look like it has any valid menu entries at all. To me, it looks like the mbr either has LILO or an old legacy grub setup, and it's kind of a miracle that you can boot into your newly installed OS at all.

Thank you for taking time to help me with this. I wish I had more time to respond quickly, but with the machine not being mine, I don't always have access to it. As I posted above, I did update the grub with update-grub, and installed grub again using sudo grub-install /dev/sda (which is the correct drive). This fixed the issue with the grub appearing, but did not fix the issue with the grub not responding to grub.cfg.

Maybe the reason it looks so strange/old to you is that this is a LUBUNTU v14.04 install?

I tested the grub with grub emulator (grub-emu). I don't remember what the results were exactly for the grub I posted in the top post, but it works with the following. I used the GUI of grub customizer to update the grub to include a custom menu entry and it shows up in the emulated grub as expected.

grub
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="Kodi"
#GRUB_HIDDEN_TIMEOUT="0"
GRUB_HIDDEN_TIMEOUT_QUIET="true"
GRUB_TIMEOUT="5"
GRUB_TIMEOUT_STYLE="hidden"
GRUB_RECORDFAIL_TIMEOUT="0"
GRUB_DISTRIBUTOR="`lsb_release -i -s 2> /dev/null || echo Debian`"
GRUB_CMDLINE_LINUX_DEFAULT="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"

#GRUB_GFXPAYLOAD_LINUX="keep"

#GRUB_DISABLE_OS_PROBER="false"
#GRUB_DISABLE_LINUX_RECOVERY="true"
GRUB_SAVEDEFAULT="false"

grub.cfg
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
if [ "${next_entry}" ] ; then
  set default="${next_entry}"
  set next_entry=
  save_env next_entry
  set boot_once=true
else
  set default="Kodi"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

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 {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
  font=unicode
else
insmod part_msdos
insmod ext2
set root='hd0,msdos5'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos5 --hint-efi=hd0,msdos5 --hint-baremetal=ahci0,msdos5  801c66b8-e7e0-4b85-b050-aa5b1104ee11
else
  search --no-floppy --fs-uuid --set=root 801c66b8-e7e0-4b85-b050-aa5b1104ee11
fi
    font="/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_output gfxterm
 if [ "${recordfail}" = 1 ] ; then
  set timeout=0
 else
  if [ x$feature_timeout_style = xy ] ; then
    set timeout_style=hidden
    set timeout=5
  # Fallback hidden-timeout code in case the timeout_style feature is
  # unavailable.
  elif sleep --interruptible 5 ; then
    set timeout=0
  fi
 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
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
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

### END /etc/grub.d/10_linux ###

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

### BEGIN /etc/grub.d/21_memtest86+ ###
### END /etc/grub.d/21_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

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

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

### BEGIN /etc/grub.d/44_custom_proxy ###
menuentry "Kodi"{
        set root='(hd0,3)'
        search --no-floppy --fs-uuid --set=root 6dd07524-ce55-48d9-8431-ae0af032fb9d
        linux /vmlinuz root=UUID=6dd07524-ce55-48d9-8431-ae0af032fb9d
        initrd /initrd.img
}

# 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/44_custom_proxy ###

However, now that I run "sudo grub-install /dev/sda" again, I get the following message (which I might have gotten the first time as well, I don't remember):
Code:

Sector 32 is already use by the program 'FlexNet' avoiding it. This software may cause boot or other problems in future. Please ask its authors not to store data in the boot track. Installation finished. No error reported.
I have no idea what this means or how it will affect the grub, but I'm guessing it has something to do with my problem.

Emerson 09-02-2016 06:00 AM

https://ubuntuforums.org/showthread....1661254&page=2


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