LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   GRUB editing (https://www.linuxquestions.org/questions/linux-newbie-8/grub-editing-4175597459/)

henrig 01-14-2017 12:13 PM

GRUB editing
 
I have installed Ubuntu Mate alongside Linux Mint and other OSes. I believe grub from ubuntu has overwritten the previous grub.
I now want to edit grub so it boots into Mint by default and straightaway, without showing me the boot options. So I will need to edit Ubuntu's grub file.
That means Ubuntu's grub file will boot me straight to Mint without showing me the boot options.

But in the future if I wish to modify this grub file again, I cannot boot into Ubuntu to make the changes to its grub file. Can I access it from Mint and make the changes successfully? I've managed that but got stuck when it came to running update-grub. How do I specify which grub?

Alternatively, is there a way for me to get Linux Mint's grub file to take over or overwrite Ubuntu's grub file? So if I want to make changes to grub in the future, I'll be in the right OS.

Mint is my default OS by the way, so I'd rather control everything from it.

Keruskerfuerst 01-14-2017 12:39 PM

Just read through the grub manual here: https://www.gnu.org/software/grub/manual/grub.html

Can you post the grub2.conf file here?

jailbait 01-14-2017 12:44 PM

Quote:

Originally Posted by henrig (Post 5654927)
Alternatively, is there a way for me to get Linux Mint's grub file to take over or overwrite Ubuntu's grub file? So if I want to make changes to grub in the future, I'll be in the right OS.

Yes. Boot into Mint and run two grub instructions as root. grub-mkconfig creates a grub configuration file on Mint which will also include Ubuntu:

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

Then install the Mint grub on your boot device:

grub-install /dev/sda
(or whichever device you boot from)

-------------------------
Steve Stites

henrig 01-15-2017 04:04 AM

Quote:

Originally Posted by jailbait (Post 5654951)
Yes. Boot into Mint and run two grub instructions as root. grub-mkconfig creates a grub configuration file on Mint which will also include Ubuntu:

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

Then install the Mint grub on your boot device:

grub-install /dev/sda
(or whichever device you boot from)

-------------------------
Steve Stites

Works a treat, thanks.
By the way, what's the difference with running grub-mkconfig and update-grub?
Both seem to give the same output in CLI. Though when I ran update-grub previously in Mint, I didn't remember seeing the last OS installed, Ubuntu, in the output.


For some reason, I'm unable to edit my grub and get my PC to boot directly to the selected OS.

I've edited my grub file in /etc/default/grub according to documentation.

I've uncommented #GRUB_HIDDEN_TIMEOUT=0
and set GRUB_TIMEOUT=0
but it defaults to 10 sec and the menu is displayed.

If I change to GRUB_TIMEOUT=-1, there is no countdown (as expected) but the menu is still displayed.
If I remove GRUB_HIDDEN_TIMEOUT=0 (comment it out again)
and set GRUB_TIMEOUT=0
I still get a countdown from 10 sec. The quickest boot I can get is 1 sec.
Basically, GRUB_HIDDEN_TIMEOUT doesn't work and GRUB_TIMEOUT=0 with this value doesn't work either.
I run update-grub after saving all changes.

Here's the content of the grub file I am now currently using:



# 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=saved
GRUB_SAVEDEFAULT=true
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=1
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"

ondoho 01-15-2017 05:14 AM

Quote:

Originally Posted by henrig (Post 5655200)
By the way, what's the difference with running grub-mkconfig and update-grub?

update-grub is just a shortcut for 'grub-mkconfig -o /boot/grub/grub.cfg'.
update-grub is not present on all linux systems, grub-mkconfig is.

jailbait 01-15-2017 11:44 AM

Quote:

Originally Posted by henrig (Post 5655200)

I've uncommented #GRUB_HIDDEN_TIMEOUT=0
and set GRUB_TIMEOUT=0
but it defaults to 10 sec and the menu is displayed.

If I change to GRUB_TIMEOUT=-1, there is no countdown (as expected) but the menu is still displayed.
If I remove GRUB_HIDDEN_TIMEOUT=0 (comment it out again)
and set GRUB_TIMEOUT=0
I still get a countdown from 10 sec. The quickest boot I can get is 1 sec.
Basically, GRUB_HIDDEN_TIMEOUT doesn't work and GRUB_TIMEOUT=0 with this value doesn't work either.

I think that you have run into a bug in grub:

https://bugs.launchpad.net/ubuntu/+s...2/+bug/1258597

If you want to fix the bug then you can report the bug here:

https://www.gnu.org/software/grub/grub-bugs.html

-----------------------
Steve Stites


All times are GMT -5. The time now is 11:14 AM.