U盘安装CentOS无法引导系统问题

1.首先查看分区
#df -k

[root@CENTOS-YEARNFAR ~]# df -k
文件系统         1K-块      已用      可用 已用% 挂载点
/dev/mapper/VolGroup-lv_root
                      51606140    730276  48254424   2% /
tmpfs                  1694576         0   1694576   0% /dev/shm
/dev/sda1               495844     31949    438295   7% /boot
/dev/mapper/VolGroup-lv_home
                     425140584    202952 403341680   1% /home

这里我的/boot是在sda1 就是第0块分区
2.root用户进入grub模式

[root@CENTOS-YEARNFAR ~]# grub
Probing devices to guess BIOS drives. This may take a long time.


    GNU GRUB  version 0.97  (640K lower / 3072K upper memory)

 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the possible
   completions of a device/filename.]
grub>

如果你没找到你可以试试 find /boot/grub/stage1 或者 find stage1
3.将CentOS的grub安装到MBR

grub> root (hd0,0)
grub> setup (hd0)

这里要和上面find里查到的一致hd0表示第一块硬盘 0表示第一个分区
4.重启完成

grub> reboot #只是重启grub,系统并不要重启~

5.修改grub.conf和menu.lst

[root@CENTOS-YEARNFAR ~]# cd /boot/grub
[root@CENTOS-YEARNFAR grub]# ls -al
总用量 278
drwxr-xr-x. 2 root root   1024 4月  10 09:55 .
dr-xr-xr-x. 5 root root   1024 4月  10 08:48 ..
-rw-r--r--. 1 root root     82 4月  10 08:48 device.map
-rw-r--r--. 1 root root  13380 4月  10 09:45 e2fs_stage1_5
-rw-r--r--. 1 root root  12620 4月  10 09:45 fat_stage1_5
-rw-r--r--. 1 root root  11748 4月  10 09:45 ffs_stage1_5
-rw-------. 1 root root    793 4月  10 09:54 grub.conf
-rw-r--r--. 1 root root  11756 4月  10 09:45 iso9660_stage1_5
-rw-r--r--. 1 root root  13268 4月  10 09:45 jfs_stage1_5
lrwxrwxrwx. 1 root root     11 4月  10 08:48 menu.lst -> ./grub.conf
-rw-r--r--. 1 root root  11956 4月  10 09:45 minix_stage1_5
-rw-r--r--. 1 root root  14412 4月  10 09:45 reiserfs_stage1_5
-rw-r--r--. 1 root root   1341 11月 15 2010 splash.xpm.gz
-rw-r--r--. 1 root root    512 4月  10 09:45 stage1
-rw-r--r--. 1 root root 125976 4月  10 09:45 stage2
-rw-r--r--. 1 root root  12024 4月  10 09:45 ufs2_stage1_5
-rw-r--r--. 1 root root  11364 4月  10 09:45 vstafs_stage1_5
-rw-r--r--. 1 root root  13964 4月  10 09:45 xfs_stage1_5

[root@CENTOS-YEARNFAR grub]# vi grub.conf

splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.32-279.el6.i686)
root (hd0,0)

到此就全部完成了, 下次开机就可以摆脱U盘启动了。

转载于:https://my.oschina.net/yearnfar/blog/398410

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值