目录[-]
默认启动项是由修改/etc/default/grub文件实现的,只需更改GRUB_DEFAULT后的数字值。以下为具体步骤
1.查看grub.cfg文件,Debian中位置为 /boot/grub/grub.cfg.
找到所有的"menuentry",这表示每个操作系统的入口.此处共有5个,序号从0开始,分别0,1,2,3,4, 系统默认启动第0项,此处即为Debian.假如要设置默认启动 "Arch (on /dev/sda13)",那么其序号为3.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
### BEGIN /etc/grub.d/10_linux ###
menuentry
'Debian GNU/Linux,Linux 3.2.0-4-686-pae'
--class debian --class gnu-linux --class gnu --class os {
load_video
insmod gzio
insmod part_msdos
insmod ext2
set
root=
'(hd0,msdos11)'
search --no-floppy --fs-uuid --
set
=root ee17a8a7-1585-4ebb-887e-f29d9477f679
echo
'载入 Linux 3.2.0-4-686-pae ...'
linux
/boot/vmlinuz-3
.2.0-4-686-pae root=UUID=ee17a8a7-1585-4ebb-887e-f29d9477f679 ro quiet
echo
'载入初始化内存盘...'
initrd
/boot/initrd
.img-3.2.0-4-686-pae
}
menuentry
'Debian GNU/Linux,Linux 3.2.0-4-686-pae (恢复模式)'
--class debian --class gnu-linux --class gnu --class os {
load_video
insmod gzio
insmod part_msdos
insmod ext2
set
root=
'(hd0,msdos11)'
search --no-floppy --fs-uuid --
set
=root ee17a8a7-1585-4ebb-887e-f29d9477f679
echo
'载入 Linux 3.2.0-4-686-pae ...'
linux
/boot/vmlinuz-3
.2.0-4-686-pae root=UUID=ee17a8a7-1585-4ebb-887e-f29d9477f679 ro single
echo
'载入初始化内存盘...'
initrd
/boot/initrd
.img-3.2.0-4-686-pae
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/30_os-prober ###
menuentry
"Windows Vista (loader) (on /dev/sda1)"
--class windows --class os {
insmod part_msdos
insmod ntfs
set
root=
'(hd0,msdos1)'
search --no-floppy --fs-uuid --
set
=root 000A41F2000009A5
chainloader +1
}
menuentry
"Arch (on /dev/sda13)"
--class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set
root=
'(hd0,msdos13)'
search --no-floppy --fs-uuid --
set
=root eb352014-f4ce-4479-b2ad-ea222d197dc3
linux
/boot/vmlinuz-linux
root=
/dev/sda13
initrd
/boot/initramfs-linux
.img
}
menuentry
"Linux From Scratch (SVN-20130711) (on /dev/sda9)"
--class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set
root=
'(hd0,msdos9)'
search --no-floppy --fs-uuid --
set
=root 0b97772d-0998-4749-b8c2-69a25bade4c5
linux
/boot/vmlinuz-3
.10-lfs-SVN-20130711 root=
/dev/sda9
}
### END /etc/grub.d/30_os-prober ###
|
2.打开/etc/default/grub,找到GRUB_DEFAULT一行,将值改为3.
3.更新grub.
1
|
sudo
update-grub
|