Change the startup sequence of Ubuntu10.04 and Windows7

Source: Internet
Author: User
Tags wubi
Two systems have just been installed: Windows 7 (first) and Ubuntu10.04 (later) (non-wubi installation ),. by default, Windows is started in Linux. After Windows 7 is started by default, enter: Back up sudocp/boot/grub in the terminal. cfg/boot/grub. cfg. backup to modify the startup list: sudogedit/boot/grub/gr has just installed two systems, Windows 7 (first) and Ubuntu10.04 (later) (non-wubi installation ),. by default, Windows is started in Linux. You can change Windows 7 to the default system through the following operations.

After ubuntu is started, enter:

Back up sudo cp first/Boot/grub. cfg/Boot/grub. cfg. Backup


Modify the startup list:Sudo gedit/boot/grub. cfg (note that it is not sudo gedit/boot/grub/menu. lst,

It looks like 9.10 is changed to grub. cfg)

Then find
Default 0
Next, look for the operating system you want to start by default! Modify the number next to the default value. 0 corresponds to the first value and 1 corresponds to the second value! Below is my grub. cfg
The default value is ubuntu! Change 0 to 4! (Modify the number after kernel upgrade as appropriate)

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by/usr/sbin/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
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

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
}
Insmod ext2
Set root = '(hd0, 3 )'
Search -- no-floppy -- fs-uuid -- set 0ee185d8-a603-4409-97b7-6440643becb7
If loadfont/usr/share/grub/unicode. pf2; then
Set gfxmode = 640x480
Insmod gfxterm
Insmod vbe
If terminal_output gfxterm; then true; else
# For backward compatibility with versions of terminal. mod that don't
# Understand terminal_output
Terminal gfxterm
Fi
Fi
Insmod ext2
Set root = '(hd0, 3 )'
Search -- no-floppy -- fs-uuid -- set 0ee185d8-a603-4409-97b7-6440643becb7
Set locale_dir = ($ root)/boot/grub/locale
Set lang = zh
Insmod gettext
If [$ {recordfail} = 1]; then
Set timeout =-1
Else
Set timeout = 10
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 ###
Menuentry'Ubuntu, Linux 2.6.32-21-generic'-- Class ubuntu -- class gnu-linux -- class gnu -- class OS {
Recordfail
Insmod ext2
Set root = '(hd0, 3 )'
Search -- no-floppy -- fs-uuid -- set 0ee185d8-a603-4409-97b7-6440643becb7
Linux/boot/vmlinuz-2.6.32-21-generic root = UUID = 0ee185d8-a603-4409-97b7-6440643becb7 ro quiet splash
Initrd/boot/initrd. img-2.6.32-21-generic
}
Menuentry'Ubuntu, Linux 2.6.32-21-generic (recovery mode )'-- Class ubuntu -- class gnu-linux -- class gnu -- class OS {
Recordfail
Insmod ext2
Set root = '(hd0, 3 )'
Search -- no-floppy -- fs-uuid -- set 0ee185d8-a603-4409-97b7-6440643becb7
Echo 'Load Linux ...'
Linux/boot/vmlinuz-2.6.32-21-generic root = UUID = 0ee185d8-a603-4409-97b7-6440643becb7 ro single
Echo 'Load the boot virtual disk ...'
Initrd/boot/initrd. img-2.6.32-21-generic
}
### END/etc/grub. d/10_linux ###

### BEGIN/etc/grub. d/20_memtest86 + ###
Menuentry"Memory test (memtest86 + )"{
Insmod ext2
Set root = '(hd0, 3 )'
Search -- no-floppy -- fs-uuid -- set 0ee185d8-a603-4409-97b7-6440643becb7
Linux16/boot/memtest86 +. bin
}
Menuentry "Memory test (memtest86 +, serial console 115200 )"{
Insmod ext2
Set root = '(hd0, 3 )'
Search -- no-floppy -- fs-uuid -- set 0ee185d8-a603-4409-97b7-6440643becb7
Linux16/boot/memtest86 +. bin console = ttyS0, 115200n8
}
### END/etc/grub. d/20_memtest86 + ###

### BEGIN/etc/grub. d/30_os-prober ###
Menuentry "Windows 7 (loader) (on/dev/sda1 )"{
Insmod ntfs
Set root = '(hd0, 1 )'
Search -- no-floppy -- fs-uuid -- set 6e40b6ff40b6ccd9
Chainloader + 1
}
### END/etc/grub. d/30_os-prober ###

### BEGIN/etc/grub. d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type
# 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 ###

→→ Segmentation here

Modify the number next to default on the above page .! ··

If you think this is inconvenient, I suggest you cut the win7 item to the front of ubuntu.

In this way, it is both beautiful and convenient (you do not need to modify the number next to the default ).

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by/usr/sbin/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
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

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
}
Insmod ext2
Set root = '(hd0, 3 )'
Search -- no-floppy -- fs-uuid -- set 0ee185d8-a603-4409-97b7-6440643becb7
If loadfont/usr/share/grub/unicode. pf2; then
Set gfxmode = 640x480
Insmod gfxterm
Insmod vbe
If terminal_output gfxterm; then true; else
# For backward compatibility with versions of terminal. mod that don't
# Understand terminal_output
Terminal gfxterm
Fi
Fi
Insmod ext2
Set root = '(hd0, 3 )'
Search -- no-floppy -- fs-uuid -- set 0ee185d8-a603-4409-97b7-6440643becb7
Set locale_dir = ($ root)/boot/grub/locale
Set lang = zh
Insmod gettext
If [$ {recordfail} = 1]; then
Set timeout =-1
Else
Set timeout = 10
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/30_os-prober ###
Menuentry "Windows 7 (loader) (on/dev/sda1 )"{
Insmod ntfs
Set root = '(hd0, 1 )'
Search -- no-floppy -- fs-uuid -- set 6e40b6ff40b6ccd9
Chainloader + 1
}
### END/etc/grub. d/30_os-prober ###

### BEGIN/etc/grub. d/10_linux ###
Menuentry'Ubuntu, Linux 2.6.32-21-generic'-- Class ubuntu -- class gnu-linux -- class gnu -- class OS {
Recordfail
Insmod ext2
Set root = '(hd0, 3 )'
Search -- no-floppy -- fs-uuid -- set 0ee185d8-a603-4409-97b7-6440643becb7
Linux/boot/vmlinuz-2.6.32-21-generic root = UUID = 0ee185d8-a603-4409-97b7-6440643becb7 ro quiet splash
Initrd/boot/initrd. img-2.6.32-21-generic
}
Menuentry 'ubuntu, Linux 2.6.32-21-generic (recovery mode) '-- class Ubuntu -- class gnu-linux -- class gnu -- class OS {
Recordfail
Insmod ext2
Set root = '(hd0, 3 )'
Search -- no-floppy -- fs-uuid -- set 0ee185d8-a603-4409-97b7-6440643becb7
Echo 'Load Linux ...'
Linux/boot/vmlinuz-2.6.32-21-generic root = UUID = 0ee185d8-a603-4409-97b7-6440643becb7 ro single
Echo 'Load the boot virtual disk ...'
Initrd/boot/initrd. img-2.6.32-21-generic
}
### END/etc/grub. d/10_linux ###

### BEGIN/etc/grub. d/20_memtest86 + ###
Menuentry "Memory test (memtest86 + )"{
Insmod ext2
Set root = '(hd0, 3 )'
Search -- no-floppy -- fs-uuid -- set 0ee185d8-a603-4409-97b7-6440643becb7
Linux16/boot/memtest86 +. bin
}
Menuentry "Memory test (memtest86 +, serial console 115200 )"{
Insmod ext2
Set root = '(hd0, 3 )'
Search -- no-floppy -- fs-uuid -- set 0ee185d8-a603-4409-97b7-6440643becb7
Linux16/boot/memtest86 +. bin console = ttyS0, 115200n8
}
### END/etc/grub. d/20_memtest86 + ###

### BEGIN/etc/grub. d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type
# 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 ###

Every time you update the kernel, You have to modify this startup item again.

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.