Several ways Windows Linux dual system starts Windows by default

Source: Internet
Author: User


Installed dual system, when the boot always want to let a system by default, when the general installation of Ubuntu and XP dual system, the default is to start the Ubuntu system when booting, but when you want to let XP as the default boot system?
In the early Ubuntu system, the boot manager was grub, to change the boot default boot system, just to change the/boot/grub/ Under the Menu.lst, but in the later Ubuntu system used is GRUB2, and GRUB2 has no menu.lst files.

GRUB2 consists of three parts:/etc/default/grub file,/ETC/GRUB.D directory

and/boot/grub/grub.cfg files, the boot menu interface with the computer boot is the grub.cfg file. How do you understand the relationship between the three parts? I think it's possible to think that after we run the Update-grub (Update boot menu) command, the system will generate the/boot/grub/folder based on the contents of the/etc/default/grub file and the/etc/grub.d folder. grub.cfg files, so when/etc/default/grub files and/ETC/GRUB.D directories are changed, the contents of the Update-grub,grub.cfg file are changed or updated.

/etc/default/grub file---The contents of the default startup item, the time when it is inverted
/ETC/GRUB.D Directory-There are various startup items, such as the following

00_header10_linux30-os-proberReadme
05_debian_theme20_memtest86+40_custom

Among them, 30-os-prober is the startup item of the Windows system, of course 10_linux is the startup item of the Linux system, notice that each file has a number in front of it, In the Grub.cfg file generated after running Update-grub, the smaller the number will be in the front, that is, in the boot menu will be queued up. Like above, in the boot menu, the Linux system will be at the front.


Here are the three ways to change.

first, directly change the grub.cfg file
sudo-i
gedit/boot/grub/grub.cfg

Inside
# # # begin/etc/grub.d/*** # #
Menuentry "..." {
......
}
# # # end/etc/grub.d/*** # #
Each represents each startup item, and the higher the position, the more it will be in the boot menu.

The set default= "0" on line 12th represents the default selection, which is the initial selection of the cursor at power-on, noting that the subscript of the item starts at 0, For example, in Grub.cfg, the XP system is located in the fifth startup item (a simple way to see how many Menuentry "..." in front of it), then the set default= "0" is changed to set default= "4"

The 54th line (possibly different) of Set timeout=5 represents the countdown time, and 5 represents 5 seconds.

After the change, save, once again will be able to see the effect, this drawback is after Update-grub will be back to the original, and the system in the installation of updates often run Update-grub command, so this change method is not recommended.


Second, change/ETC/DEFAULT/GRUB.D
sudo-i
CD/ETC/GRUB.D
ls
Then we can see
00_header 10_linux30-os-proberReadme
05_debian_theme20_memtest86+40_custom
(This is in my system, you may not be the same)

MV 30_os-prober06_os-prober(30_os-prober renamed to 06_os-prober)
Update-grub

Then open grub.cfg will see XP system is already in the front, such a simple method, and no matter how many times the UPDATE-GRUB,XP system items will always be ranked first, recommended to use.


Third, change/etc/default/grub
sudo-i
Gedit/etc/default/grub

Change the grub_default=0 (select the position of the cursor by default, like this is in the first place, assuming that the XP system is in the 5th place of the menu item, change to grub_default=4)
Grub_timeout=5 (Time to rewind)

After the change, save, again Update-grub, this method because it is a direct change to select the initial position of the cursor, and when the XP item before assuming a few more items (like after updating the kernel), it is not. This method is not recommended.


Original from:

Http://blog.sina.com.cn/s/blog_64d57e710100mjuk.html

Several ways Windows Linux dual system starts Windows by default

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.