今天用U盘安装HREL6.4,用U盘引导,网络安装,结果不料,一不小心吧引导却安装到了U盘上。
第一步,用U盘引导,重新安装grub
[root@C6 ~]# grub-install --root-directory=/ --no-floppy /dev/sda
/dev/sda does not have any corresponding BIOS drive.
此处说没有任何设备
第二步,重新检测
[root@C6 ~]# grub-install --recheck /dev/sda
Probing devices to guess BIOS drives. This may take a long time.
Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.
(fd0) /dev/fd0
(hd0) /dev/sda
(hd1) /dev/sdb
第三步,再次安装grub
[root@C6 ~]# grub-install --root-directory=/ --no-floppy /dev/sda
Installation finished. No error reported.
This is the contents of the device map //boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.
(fd0) /dev/fd0
(hd0) /dev/sda
(hd1) /dev/sdb
第四步,修改grub.conf
# vi /etc/grub.conf
default=0
timeout=1
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.32-358.el6.x86_64)
root (hd0,0)
kernel /vmlinuz-2.6.32-358.el6.x86_64 ro root=UUID=d9de1295-9ef9-446d-b4ab-722137370564 rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=auto LANG=zh_CN.UTF-8 rd_NO_LVM rd_NO_DM rhgb quiet
initrd /initramfs-2.6.32-358.el6.x86_64.img
正常重启
########################
迷途小运维随笔
作者:john
转载请著名出处