U盘引导安装

来源:互联网 发布:unity3d场景 编辑:程序博客网 时间:2024/04/29 06:27

问题描述:

我通过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盘启动,即可。
原创粉丝点击