码迷,mamicode.com
首页 > 其他好文 > 详细

grub损坏修复方法

时间:2016-09-17 16:09:33      阅读:201      评论:0      收藏:0      [点我收藏+]

标签:

grub菜单加密                                                                                                 
vim /etc/grub.conf                                                                                       
                                                                                                         
default 0                                                                                                
timeout 5                                                                                                
#password=sheng 明文                                                                                       
password --md5 $1$wZnox$FYPXFLNkmYKQVdCR2mYhW0  //md5加密过                                                 
说明:                                                                                                      
[root@Server ~]# grub-md5-crypt                                                                          
Password:                                                                                                
Retype password:                                                                                         
$1$wZnox$FYPXFLNkmYKQVdCR2mYhW0                                                                          
                                                                                                         
grub.conf配置文件损坏                                                                                          
手动去引导操作系统:                                                                                               
grub> root (hd0,0)                                                                                       
grub> kernel /vmlinuz-2.6.32-573.el6.x86_64 ro root=/dev/mapper/vg_clone-Logvol01                        
grub> initrd /initramfs-2.6.32-573.el6.x86_64.img                                                        
grub> boot  重新引导                                                                                         
                                                                                                         
boot目录下所有文件丢失                                                                                            
恢复步骤;                                                                                                    
1,通过光盘进入修复模式,rescue installed system                                                                     
2、挂载光盘到当前操作系统,shell start shell                                                                          
    df -h                                                                                                
    ls                                                                                                   
    cd /                                                                                                 
    chroot /mnt/sysimage/                                                                                
    cd boot/                                                                                             
    df -h                                                                                                
    lsblk                                                                                                
    mkdir /u01                                                                                           
    mount /dev/sr0 -o loop /u01                                                                          
    cd /u01/Package/                                                                                     
3、安装kernel                                                                                               
    rpm -ivh kernel-2.6.32-431.el6.x86_64.rpm kernel-firmware-2.6*.noarch.rpm --force                    
4、安装grub                                                                                                 
    cd /boot                                                                                             
    grub install /dev/sda                                                                                
5、编辑grub.conf                                                                                            
    cd grub/                                                                                             
6、重启操作系统                                                                                                 
    reboot                                                                                               
                                                                                                         
内核升级                                                                                                     
方法一:yum安装                                                                                                
方法二:源码编译安装,官网www.kernel.org                                                                              
======================================================================                                   

grub损坏修复方法

标签:

原文地址:http://www.cnblogs.com/erick2/p/5878791.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!