Windows and Linux dual systems modify boot entry order __linux

Source: Internet
Author: User
Tags uuid

windows and Linux dual systems modify boot entry order

Install the Ubuntu dual system under windows and choose Ubuntu by default at startup, at least three ways to modify the boot sequence.

1. Modify/boot/grub/grub.cfg

sudo vim/boot/grub/grub.cfg (if you're not familiar with vim, try Sudo gedit/etc/default/grub)

Has the following content

#
# Don't 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

...

Menuentry ' Ubuntu,linux 3.0.0-28-generic '--class Ubuntu--class gnu-linux--class GNU--class os {
Recordfail
Set gfxpayload= $linux _gfx_mode
Insmod Gzio
Insmod Part_msdos
Insmod ext2
Set root= ' (Hd0,msdos8) '
Search--no-floppy--fs-uuid--set=root 6eaff320-f96f-4e63-91d3-9b45bb387d1d
Linux/boot/vmlinuz-3.0.0-28-generic root=uuid=6eaff320-f96f-4e63-91d3-9b45bb387d1d ro Quiet Splash vt.handoff=7
Initrd/boot/initrd.img-3.0.0-28-generic
}

...

We are modifying the set default= "0". There is a list of startup items in the boot screen, such as

Ubuntu,linux 3.0.0-28-generic

Ubuntu,linux 3.0.0-28-generic (Recovery mode)

Previous Linux Versions

Memory Test (memtest86+)

Memory Test (memtest86+, serial console 115200)

Windows 7 (loader) (ON/DEV/SDA1)

Count from 0, Windows is 5, so modify to set default= "5". Save the exit and don't change anything else. The next time you start, the default is Windows.

Note: Windows is generally the 5th, if you use for a long time Ubuntu, there will be kernel updates, will generally form the above launch list.


2. The/boot/grub/grub.cfg is still being modified.

The first method modifies the default sequence number, and, similarly, we can move windows to position No. 0. The specific thing is to put

Menuentry Windows 7 (loader) (ON/DEV/SDA1)--class windows--class os {
Insmod Part_msdos
Insmod NTFS
Set root= ' (HD0,MSDOS1) '
Search--no-floppy--fs-uuid--set=root a2de6972de693fa1
Chainloader +1
}

Cut to the first menuentry before the

If ["$linux _gfx_mode"!= "text"]; Then Load_video; Fi

Menuentry Windows 7 (loader) (ON/DEV/SDA1)--class windows--class os {
Insmod Part_msdos
Insmod NTFS
Set root= ' (HD0,MSDOS1) '
Search--no-floppy--fs-uuid--set=root a2de6972de693fa1
Chainloader +1
}
Menuentry ' Ubuntu,linux 3.0.0-28-generic '--class Ubuntu--class gnu-linux--class GNU--class os {
Recordfail
Set gfxpayload= $linux _gfx_mode
Insmod Gzio
Insmod Part_msdos
Insmod ext2
Set root= ' (Hd0,msdos8) '
Search--no-floppy--fs-uuid--set=root 6eaff320-f96f-4e63-91d3-9b45bb387d1d
Linux/boot/vmlinuz-3.0.0-28-generic root=uuid=6eaff320-f96f-4e63-91d3-9b45bb387d1d ro Quiet Splash vt.handoff=7
Initrd/boot/initrd.img-3.0.0-28-generic
}

Save exit.

Note: Do not cut the wrong, wrong words I do not know what will be the consequences, may be fine.


3. Modify the/etc/default/grub and then Update-grub.

sudo vim/etc/default/grub

The main content is

# If You change this file, run ' Update-grub ' afterwards to update
#/boot/grub/grub.cfg.
# for full documentation of the "options in" This file,
# 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= ""

Change the grub_default=0 to Grub_default=5, save the exit and run sudo update-grub.


Note: 1 The first two methods are only temporary, if the update kernel will revert back, from the comments we also see, do not we modify the Grub.cfg file

2 The third method is better, modify the default startup items, and then even update the kernel, the default will start from 5;

3 The method here is for GRUB2, starting from ubuntu11.04, grub upgrades, not using the original/BOOT/GRUB/MENU.LST, old version changes can query the network more content.

4 above are modified under Ubuntu, if you install a pure dual system, rather than Wubi, if the latter, need to be modified under Windows.



Reproduced from: Wang Runqing

Http://weibo.com/onesunisoneday



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.