7/10/2014

How to setup the default OS in GRUB dual boot system (eg. Ubuntu and Windows)?

Of course it works with Ubuntu, Linux Mint, Linux Mint Debian Edition, or other Ubuntu based linux distro.

When system starts write down exactly each rows of GRUB menu (e.g.: Linux, recovery mode, memtest86+, Windows).
Or type in Terminal:
fgrep menuentry /boot/grub/grub.cfg

Choose which OS you want to start as default.
Write down the line number of the Operating System you want to boot first.
The first line starts from 0

eg:

Ubuntu, Linux 2.6.31-14-generic
Ubuntu, Linux 2.6.31-14-generic (recovery mode)
memory test (memtest86+)
memory test (memtest86+, serial console 115200)
Windows 7 (loader) (on /dev/sda1)

Where
"Ubuntu, Linux 2.6.31-14-generic" is 0 (zero row ) and
"Windows 7 (loader) (on /dev/sda1)" is 4 (4th row)

Open a Terminal, and type:
# sudo nano /etc/default/grub
(of course you can use other editor as well)

Search *GRUB_DEFAULT* row, change the default value (which is 0) to the value you wrote down before.

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10

In grub config file, you can also change the GRUB default time out length.
Then save the GRUB file.

Don't forget to update GRUB.
Run a command in the terminal:

# sudo update-grub

If you want to do these steps with GUI, you can use GRUB customizer software.
Read more about it here.

Source: NAM HUY LINUX

No comments:

Post a Comment