用LiveCD修复Ubuntu的启动项

作者: qwq 分类: HISTORY,未分类 发布时间: 2011-09-19 21:41

装了Win8 DP后,把原来的启动项全部弄乱了,将Win7和Win8设置成从Win7启动后,修复了BootThink重启的问题,Mac能启动了,最后就是解决Ubuntu的启动问题。
用LiveCD试用Ubuntu,打开终端:

  • sudo -i
  • fdisk -l  查看Ubuntu系统所在的分区,为/dev/sdaX,X的具体值因人而异,可能根据system为Linux确定X的值。
  • mount /dev/sdaX /mnt  X根据上一步换成对应的值(单独Boot分区的还要mount /dev/sdaY /home/ubuntu/mnt/boot)
  • grub-install –root-directory=/mnt/ /dev/sda(注意,如果这步出错,请往下看)
  • 没了,重启吧

重启之后就可以看到Ubuntu那熟悉的紫色界面了。

如果在启动界面重没有其他系统的启动项,需要在进入Ubuntu后在终端中加一句:

sudo update-grub2

over。

 


注意:上面黑色部分的root前面是两个“-”(短横线)不是一个“–”(长横线),这是半角全角问题,请手动编辑下。

否则会出现以下提示:

a-nerd:~$ grub-install –root-directory=/mnt/ /dev/sda

Unrecognized option `-root-directory=/mnt/’

Usage: grub-install [OPTION] install_device

Install GRUB on your drive.-h, –help print this message and exit

-v, –version print the version information and exit

–modules=MODULES pre-load specified modules MODULES

–boot-directory=DIR install GRUB images under the directory DIR/grub

instead of the /boot/grub directory

–grub-setup=FILE use FILE as grub-setup

–grub-mkimage=FILE use FILE as grub-mkimage

–grub-mkrelpath=FILE use FILE as grub-mkrelpath

–grub-mkdevicemap=FILE use FILE as grub-mkdevicemap

–grub-probe=FILE use FILE as grub-probe

–no-floppy do not probe any floppy drive

–allow-floppy Make the drive also bootable as floppy

(default for fdX devices). May break on some BIOSes.

–recheck probe a device map even if it already exists

–force install even if problems are detected

–disk-module=MODULE disk module to use

INSTALL_DEVICE can be a GRUB device name or a system device filename.

grub-install copies GRUB images into /boot/grub, and uses grub-setup

to install grub into the boot sector.

Report bugs to <bug-grub@gnu.org>.

 

发表评论

电子邮件地址不会被公开。 必填项已用*标注