Grub.conf文件丢失

现象:系统启动将进入grub交互界面
修复:启动时进入红色界面按向下箭头,
按e:
按c   grub> root (hd0,0)
                > kernel /vm---(tab键补全) ro (只读) root=LABEL=/ (根文件挂载点) 1(表示以单用户模式进入系统)
                > initrd /initrd---(tab键补全)
                > boot
进入系统后:vi /boot/grub/grub.conf 查看并保存 

排错步骤:

image
通过help查看grub下的可用命令;
通过cat或bloclist命令查找boot目录是否在根目录下如:
image
image(这个是之前一个备份)
因此输入:

image
最后输入boot命令即可引导系统启动

 

-----------------------------------------------------------------------------------------------
激活windows的系统

>rootnoverify (hd0,1)       #(hd0,1)为第二个分区,即是windows的安装分区。

>chainloader +1

------------------------------------------------------------------------------------------------

一个windows&Linux双系统安装启动(grub.conf配置实例):
(如果windows没有安装在第一个分区上,可以通过隐藏分区,将widows所在的分区作为第一个分区)

在grub.conf中修改如下:
title  windows
hide (hd0,0)
unhide (hd0,1)
rootnoverify (hd0,1)
chainloder +1
grub密码的设置:
1 default=0
2 timeout=5
3 splashimage=(hd0,1)/grub/splash.xpm.gz
4 hiddenmenu
5 title Red Hat Enterprise Linux Server (2.6.18-128.el5)
6         root (hd0,1)
7         kernel /vmlinuz-2.6.18-128.el5 ro root=LABEL=/12 rhgb quiet
8         initrd /initrd-2.6.18-128.el5.img
9 title Other
10         rootnoverify (hd0,0)
11         chainloader +1

------------------------------------------------------------------------------------------------

在1~4加入密码为修改系统启动参数需要的密码;在5~11行加入的密码为进入操作系统的密码。
添加密码的方式:
1、明文密码:
password  PASSWORD
2、md5密码:
首先在系统下的命令行中生成md5算法加密的密码;
#grub-md5-crypt
然后添加到上面即可
password --md5 MD5-PASSWD  #上面的两种密码,这两种方式都支持

posted on 2011-04-08 22:22  漂泊书生  阅读(1334)  评论(0编辑  收藏  举报

导航