Problem description: Ubuntu 10.04 was released, and Windows XP was installed on bare metal, and Ubuntu10.04 was installed on the USB flash drive. The installation speed was fast (less than 10 minutes ), however, after being installed, there is no XP in the grub startup item. It took a few minutes to solve the problem ~ The following figure shows the modified grub. cfg, which can be modified according to the individual partition situation ~~ Go to Ubuntu10.04 and type the following command in the terminal: sudogedit/boot
Problem description:
Ubuntu 10.04 is released, and Windows XP is installed on a bare metal, and Ubuntu 10.04 is installed on a USB flash drive. The installation speed is fast (less than 10 minutes ), however, after being installed, there is no XP in the grub startup item. It took a few minutes to solve the problem ~
The following figure shows the modified grub. cfg, which can be modified according to the individual partition situation ~~
Go to Ubuntu10.04 and type the following command on the terminal,
Sudo gedit/boot/grub. cfg
Compare the following to modify the corresponding XP startup Item, save and exit, and then OK!
------------------------------- The content of grub. cfg is as follows :-------------------------------
#
# 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
# If the default start item is XP, set default is set to XP start number. For example, set default is set 4, that is, set default = "4"
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, 8 )'
Search -- no-floppy -- fs-uuid -- set 27cc65d6-0513-4f68-8c42-901f871052ae
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, 8 )'
Search -- no-floppy -- fs-uuid -- set 27cc65d6-0513-4f68-8c42-901f871052ae
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, with Linux 2.6.32-21-generic '-- class Ubuntu -- class gnu-linux -- class gnu -- class OS {
Recordfail
Insmod ext2
Set root = '(hd0, 8 )'
Search -- no-floppy -- fs-uuid -- set 27cc65d6-0513-4f68-8c42-901f871052ae
Linux/boot/vmlinuz-2.6.32-21-generic root = UUID = 27cc65d6-0513-4f68-8c42-901f871052ae ro quiet splash
Initrd/boot/initrd. img-2.6.32-21-generic
}
Menuentry 'ubuntu, with Linux 2.6.32-21-generic (recovery mode) '-- class Ubuntu -- class gnu-linux -- class gnu -- class OS {
Recordfail
Insmod ext2
Set root = '(hd0, 8 )'
Search -- no-floppy -- fs-uuid -- set 27cc65d6-0513-4f68-8c42-901f871052ae
Echo 'loading Linux 2.6.32-21-generic ...'
Linux/boot/vmlinuz-2.6.32-21-generic root = UUID = 27cc65d6-0513-4f68-8c42-901f871052ae ro single
Echo 'loading initial ramdisk ...'
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, 8 )'
Search -- no-floppy -- fs-uuid -- set 27cc65d6-0513-4f68-8c42-901f871052ae
Linux16/boot/memtest86 +. bin
}
Menuentry "Memory test (memtest86 +, serial console 115200 )"{
Insmod ext2
Set root = '(hd0, 8 )'
Search -- no-floppy -- fs-uuid -- set 27cc65d6-0513-4f68-8c42-901f871052ae
Linux16/boot/memtest86 +. bin console = ttyS0, 115200n8
}
### END/etc/grub. d/20_memtest86 + ###
# Here, the XP startup Item parameter "restart" is added.
### BEGIN/etc/grub. d/30_os-prober ###
Menuentry "Windows XP (on/dev/sda1 )"{
Insmod ntfs
Set root = (hd0, 1)
Search -- no-floppy -- fs-uuid -- set B2CC3F5FCC3F1CD3 # Put the copied UUID here!
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 ###