問題描述:
我通過grub-install命令,把grub安裝到了u盤,重啓後進入u盤的gurb,爲什麼只是命令行?
grub>
而不是圖形界面?
如何解決?使得grub是圖形界面?
解決辦法
幫助:grub啓動的時候,會自動尋找/boot/grub/grub.conf
我的u盤的確是缺少了/boot/grub/grub.conf這個文件,把它補上就可以了。
grub-install經驗分享:
整個過程分享,以下是我的做法(可能別的高手還有別的做法,但是我覺得我的做法,已經很簡單了),僅供參考:
①準備一個u盤,容量不限,能有1MB都足夠了。②把u盤格式化(我把u盤格式化成FAT格式了,最後證明也是成功的)。
③開啓linux系統,打開命令行終端,進入root模式,然後輸入命令行:
mount /dev/sdb3 /tmp/boot
grub-install --root-directory=/tmp/boot --no-floppy /dev/sdb
注意:上面/dev/sdb是我的u盤,在linux系統裏的盤符吧,那個/dev/sdb3爲什麼是“3”,這個因不同的實際情況而不同吧。
總的來說,/dev/sdb就是我的u盤的名字,/dev/sdb3就是我的u盤的一個分區。
④這個時候,你會發現,你的u盤,已經多了一個boot目錄,裏面有一些內容,這個時候,boot目錄的路徑是/dev/sdb3/boot/。
⑤把“/boot/grub/grub.conf”和“/boot/grub/splash.xpm.gz”,複製到“/dev/sdb3/boot/grub/”下面(也就是“u盤/boot/grub/”)。
⑥然後把/dev/sdb3/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 do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,0)
# kernel /boot/vmlinuz-version ro root=/dev/sda1
# initrd /boot/initrd-version.img
#boot=/dev/sda
default=-1
timeout=50
splashimage=(hd0,3)/boot/grub/splash.xpm.gz
title Fedora
root (hd0,3)
⑦重啓計算機,在BIOS裏,設置爲從u盤啓動,即可。