CentOS5.6U盤啓動安裝筆記

一、製作啓動安裝U盤


用UltraISO打開CentOS5.6鏡像

點擊啓動->寫入硬盤映像->格式化 ,格式化成fat32格式

點擊啓動->寫入硬盤映像->寫入

打開U盤,刪掉除isolinux和images外的所有文件和目錄

將CentOS5.6鏡像拷貝到U盤根目錄


二、CentOS5.6安裝啓動


BIOS設置爲從U盤啓動

U盤一般爲/dev/sdb

安裝好後第一次啓動(如果已經拔掉U盤)可能需要將grub引導由root (hd1,0)改爲root (hd0,0)纔可以正常進入系統

以下爲永久更改grub使正常引導:

[root@mfsmaster home]# /sbin/grub 

grub> find /grub/stage1     

(hd1,0)   


如果提示Error 15: File not found,則嘗試 find /boot/grub/stage1 或者 find stage1 

(hd1,0)代表的第二個硬盤的第一個分區,相應的(hd0,0)代表的就是第一個硬盤第一個分區,這一步其實就是告訴我們引導被寫入了U盤中= =


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   


然後修改啓動的 /boot/grub/menu.lst 或者 /boot/grub/grub.conf  CentOS下這兩個文件是綁定的,改一個即可


[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   

把當中的(hd1,0)都改成(hd0,0),splashimage=(hd0,0)/grub/splash.xpm.gz 這個是開機引導背景圖片的位置,改不改都關係不大,重啓CentOS就可以正常啓動了


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章