GRUB手动引导--未完,待续

原始的grub.conf文件
[root@yangcan Desktop]# cat /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/sda2
#          initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux (2.6.32-220.el6.i686)
	root (hd0,0)
	kernel /vmlinuz-2.6.32-220.el6.i686 ro root=UUID=f09bad00-c211-4698-8ccf-f25df9d4181c rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD quiet SYSFONT=latarcyrheb-sun16 rhgb crashkernel=auto  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM
	initrd /initramfs-2.6.32-220.el6.i686.img


1. 当我们引导文件坏了的时候,我们就需要手动引导,我们在出现开机引导的时候,按c收到引导.首先我们要知道,我们的linux引导的分区在哪个位置?只能通过不段的尝试.
kernel [--no-mem-option] [--type=TYPE]
initrd FILE [ARG ...]  

grub>kernel (hd0,0)/vmlinuz-2.6.32-220.el6.i686 ro root=/dev/sda2 quiet
grub>initrd (hd0,0)/initramfs-2.6.32-220.el6.i686.img

然后boot,重新引导
grub>boot

进入系统以后,我们要修复/boot/grub/grub.conf文件,如果之前有备份的话,直接还原就可以了;如果无备份.我们就需要手动创建一个简单的!

default=0
timeout=5
title Red Hat Enterprise Linux (2.6.32-220.el6.i686)
	root (hd0,0)
	kernel /vmlinuz-2.6.32-220.el6.i686 ro root=UUID=f09bad00-c211-4698-8ccf-f25df9d4181c quiet
	initrd /initramfs-2.6.32-220.el6.i686.img

然后写入引导分区表
[root@yangcan Desktop]#grub-install /dev/sda

你可能感兴趣的:(grub,手动引导)