Ubuntu - Grub2.0修改默认启动项
1.我的环境:
Ubuntu10.04
2.关键位置和文件:
/boot/grub/grub.cfg文件;
/etc/grub.d/目录;
/etc/default/grub文件;
3.查看/boot/grub/grub.cfg文件:
###BEGIN/etc/grub.d/10_linux###
menuentry'Ubuntu,withLinux2.6.32-21-generic'--classubuntu--classgnu-linux--classgnu--classos{
}
menuentry'Ubuntu,withLinux2.6.32-21-generic(recoverymode)'--classubuntu--classgnu-linux--classgnu--classos{
}
###END/etc/grub.d/10_linux###
###BEGIN/etc/grub.d/20_memtest86+###
menuentry"Memorytest(memtest86+)"{
}
menuentry"Memorytest(memtest86+,serialconsole115200)"{
}
###END/etc/grub.d/20_memtest86+###
###BEGIN/etc/grub.d/30_os-prober###
menuentry"MicrosoftWindowsXPProfessional(on/dev/sda1)"{
}
###END/etc/grub.d/30_os-prober###
注意:从0开始计数,Ubuntu10.04启动项为0;WindowsXP启动项为4;
4.修改/etc/default/grub文件:
#Ifyouchangethisfile,run'update-grub'afterwardstoupdate
#/boot/grub/grub.cfg.
GRUB_DEFAULT=4
注意:GRUB_DEFAULT的默认值为0;
5.执行命令:
$sudoupdate-grub
6.重新启动。