您的位置:首页 > 其它

更新Ubuntu Server 10.4 内核及编辑内核启动项

2010-06-29 19:25 369 查看
环境:Ubuntu Server 10.04

UB 10.04 使用 GRUB2

配置文件在

root@ServerU3:/etc/default# vim /etc/default/grub

参考:

http://ubuntuforums.org/showthread.php?t=1302743&highlight=grub2+common

http://ubuntuforums.org/showthread.php?t=1195275

如果仅有一个操作系统时,一定要按住 SHFIT 键,

详细内容参考上面的两篇文章。

Unhide/Hide the Menu 隐藏/显示菜单
File: /etc/default/grub
Line to edit (5):

Quote:
GRUB_HIDDEN_TIMEOUT=0
Example to unhide the menu: # GRUB_HIDDEN_TIMEOUT=0 and DEFAULT_TIMEOUT=X

注释掉 #GRUB_HIDDEN_TIMEOUT=0

设置等待时间 DEFAULT_TIMEOUT=X

By default, if no other operating system is found on the system, GRUB 2 will not display the menu. The system will boot directly into the default entry.

当没有别的操作系统时,GRUB 2默认不显示菜单。系统直接进入默认入口。

To display the menu:

Place a comment symbol (#) at the start of the "GRUB_HIDDEN_TIMEOUT=X" line.

X=要停留的秒数

Make sure the "DEFAULT_TIMEOUT=X" entry is a positive integer. X is the number of seconds the menu will be displayed.

Quote:
# GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT="10"
ode:

gksu gedit /etc/default/grub


Save the file, then update the menu:

Code:
sudo update-grub


这时系统查找

Searching for GRUB installation director y ... found: /boot/grub
Searching for default file ... Generatin g /boot/grub/default file and setting th e default boot entry to 0
Searching for GRUB installation director y ... found: /boot/grub
Testing for an existing GRUB menu.lst fi le ...

Could not find /boot/grub/menu.lst file. Would you like /boot/grub/menu.lst gene rated for you? (y/N) y

发现没有 /boot/grub/menu.lst ,新建一个,
Searching for splash image ... none found, skipping ...
Found GRUB 2: /boot/grub/core.img
Found kernel: /memtest86+.bin
Found kernel: /vmlinuz-2.6.32-22-server
Found kernel: /vmlinuz-2.6.32-21-server
Found GRUB 2: /boot/grub/core.img
Found kernel: /memtest86+.bin
Updating /boot/grub/menu.lst ... done

更新 完成。

root@ServerU3:/etc/default#

/boot/grub# vim menu.lst


这样一来,就有了启动选择内核的项目了。

To hide the menu on boot:
There should be no # symbol at the start of the line: GRUB_HIDDEN_TIMEOUT=0 line. "0" will boot the system without a timeout. A positive integer will leave a blank screen for that number of seconds, allowing the user time to press "ESC" or "SHIFT" to display the menu. The splash screen will still display during the timeout.

cat /etc/lsb-release



输入:

sudo uname -r 查看内核版本

root@ServerU2:~# uname -r
2.6.32-22-server

/lib/modules

/lib/modules# ls
2.6.32-21-server 2.6.32-22-server

输入 : apt-cache search linux image server






apt-get install linux-image-2.6.32-22-server

安装完成后查看

root@ServerU2:/lib/modules# ls -la
总计 24
drwxr-xr-x 4 root root 4096 2010-06-29 19:44 .
drwxr-xr-x 13 root root 12288 2010-06-26 08:57 ..
drwxr-xr-x 4 root root 4096 2010-06-25 20:47 2.6.32-21-server
drwxr-xr-x 4 root root 4096 2010-06-29 19:45 2.6.32-22-server

查看当前内核,没有变,

uname -r
2.6.32-21-server

reboot 后查看,

root@ServerU2:~# uname -r
2.6.32-22-server
root@ServerU2:~#
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: