「GRUBの設定」CentOS環境でgrubブートローダの設定方法

1.grubに入る
[root@mfsmaster home]# /sbin/grub
grubuの場所を見つける
grub> find /grub/stage1
(hd1,0)
注意事項:
「Error 15: File not found」が出る場合、「 find /boot/grub/stage1」または「 find stage1 」
で問題を解決

2.(hd0,0)の操作

grub> root (hd0,0)
Filesystem type is ext2fs, partition type 0x83

grub> setup (hd0)
Checking if “/boot/grub/stage1" exists… no
Checking if “/grub/stage1" exists… yes
Checking if “/grub/stage2" exists… yes
Checking if “/grub/e2fs_stage1_5" exists… yes
Running “embed /grub/e2fs_stage1_5 (hd0)"… 15 sectors are embedded.
succeeded
Running “install /grub/stage1 (hd0) (hd0)1+15 p (hd0,0)/grub/stage2 /grub/grub.conf"… succeeded
Done.

grub> reboot

3.「/boot/grub/menu.lst 」または「/boot/grub/grub.conf 」を変更

[root@mfsmaster home]# vi /boot/grub/menu.lst

# 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 (hd1,0)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/sdb
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-274.3.1.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-274.3.1.el5 ro root=/dev/VolGroup00/LogVol00
initrd /initrd-2.6.18-274.3.1.el5.img
title CentOS (2.6.18-238.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-238.el5 ro root=/dev/VolGroup00/LogVol00
initrd /initrd-2.6.18-238.el5.img
title Other
rootnoverify (hd0,3)
chainloader +1

4.全ての(hd1,0)を(hd0,0)に変更
splashimage=(hd0,0)/grub/splash.xpm.gz は起動背景画像の位置

5.CentOSが再起動

Linux

Posted by arkgame