分类: LINUX
2013-02-11 22:35:41
vim /boot/grub/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/sda5
# initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
password redhat ---- 此为进入grub编辑菜单所要输入的密码
title CentOS (2.6.18-238.el5PAE)
root (hd0,0)
kernel /vmlinuz-2.6.18-238.el5PAE ro root=LABEL=/
initrd /initrd-2.6.18-238.el5PAE.img
password --md5 $1$QmPy11$tqMQJBpVBvh/F8KZ1Y32./ ---- 进入某个内核或者某个操作系统所要输入的密码
生成md5加密密码:
[root@localhost ~]# grub-md5-crypt
Password:
Retype password:
$1$QmPy11$tqMQJBpVBvh/F8KZ1Y32./
/boot/grub/grub.conf文件丢失处理办法:
启动进入grub后
grub> root (hd0,0) ---- 指定内核所在分区
grub> kernerl /vmlinuz-2.6.18-164.img 指定内核文件,可用tab键补全
grub> initrd /initrd-2.6.18-164.img 指定initrd文件
grub> boot 启动grub