linux安装错误 grub2,[转载]ubuntu在安装过程中出现 grub 错误时解决方法

Simple

tool to repair frequent boot problems.

Easy-to-use (repair in 1 click ! )

Free (GPL open-source license)

Helpful (Boot-Info summary to get help by email or on your favorite

forum)

Safe (automatic backups)

Can recover access to Windows (XP, Vista, Seven).

Can recover access to Debian, Ubuntu, Linux Mint…

Can recover access to any OS (Windows, MacOS, Linux..) if your PC

contains Debian, Ubuntu or derivative.

Can repair MBR-locked OEM computer boot if the original bootsector

has been saved by Clean-Ubiquity

Can repair the boot when you have the “GRUB Recovery” error

message

Options to reinstall GRUB2 bootloader easily (OS by default, purge,

unhide, kernel options..)

and much more ! (EFI, SATA, filesystem repair…)

GET BOOT-REPAIR:

Three possibilities to get Boot-Repair:

1) Boot-Repair-Disk is the official CD containing the very last

version of Boot-Repair

2) Boot-Repair is also included in all Ubuntu Secured CDs and many

other distributions (Hybryde, AriOS, PinguyOS…)

3) Boot-Repair can be installed & used in Debian

and derivatives (Ubuntu, Linux Mint…), either normal session, or

live-CD, or live-USB.

Boot-Repair can be installed & used from any Ubuntu

session (normal session, or live-CD, or live-USB).

Install Boot-Repair on ubuntu

Open the terminal and run the following commands

sudo add-apt-repository ppa:yannubuntu/boot-repair

sudo apt-get update

sudo apt-get install boot-repair

After completing the installation you can launch it from

System->Administration->Boot-Repair

menu if you use Gnome, or search “boot-repair” in the dash if you

use Unity. Then follow the menus

Screenshots

a4c26d1e5885305701be709a3d33442f.png

a4c26d1e5885305701be709a3d33442f.png

a4c26d1e5885305701be709a3d33442f.png

以上从国外论坛找到的 ,亲测能用 。 我的错误是

error: incompatible

license.

grub rescue>

grup 其他常见错误:

引用: 1 : Filename must be either an absolute filename or

blocklist 解释 :1号错误表示文件名格式错误。在 GRUB 中要么是以绝对路径给出文件 例子 : grub> kernel vmlinuz

root=label=/ Error 1: Filename must be either an absolute pathname or

blocklist grub> 引用: 2 : Bad file or directory type 解释

:2号错误表示命令期望的是一个普通文件,但相应文件名的对象是一个符号链接、目录、FIFO 例子 : grub> kernel /testdir

root=LABEL=/ Error 2: Bad file or directory type grub> 引用: 3 : Bad or corrupt data while decompressing

file 解释 :3号错误表示解压文件时发生错误。可能是因为这个文件被损坏了 引用: 4 : Bad or incompatible header in compressed

file 解释 :4号错误表示压缩文件的头部格式不被兼容或者错误 引用: 5 : Partition table invalid or corrupt 解释 :5 号错误表示分区表无效或者被破坏。这是一个不好的预兆 引用: 6 : Mismatched or corrupt version of

stage1/stage2 解释 :6号错误表示 install 命令发现 stage1 和 stage2

的颁布号不被兼容 引用: 7 : Loading below 1MB is not supported 解释 :This error is returned if the lowest address in a kernel is

below the 1MB boundary. The Linux

zImage format is a special case and can be handled since it has a

fixed loading address and maximum size 引用: 8 : Kernel must be loaded before

booting 解释 :8号错误表示执行 boot 命令之前没有先执行 kernel 命令 引用: 9 : Unknown boot failure 解释 :9 号错误表示未知的引导错误 引用: 10 : Unsupported Multiboot features

requested 解释 :10 号错误表示请求 Multiboot header 所要求功能不被 GRUB

所支持。 引用: 11 : Unrecognized device string 解释 :11 号错误表示无法识别的设备字符串。 例子 : grub> root hd0 Error 11: Unrecognized device string grub> 引用: 12 : Invalid device requested 解释 :12 号错误表示请求的设备无效 例子 : grub> root (hd2) Error 21: Selected disk does not exist grub> kernel /grub/grub.conf

root=LABEL=/ Error 12: Invalid device requested grub> 引用: 13 : Invalid or unsupported executable

format 解释 :13 号错误表示无效或者无法识别的可执行格式 例子 : grub> kernel /grub/grub.conf

root=LABEL=/ Error 13: Invalid or unsupported executable

format grub> 引用: 14 : Filesystem compatibility error, cannot read whole

file 解释 :14 号错误表示文件系统兼容性错误,无法读取整个文件 引用: 15 : File not found 解释 :请求的文件无法找到 例子 : grub> find

/grub-noexist/grub.conf Error 15: File not found grub> 引用: 16 : Inconsistent filesystem structure 解释 :16 号错误表示不一致的文件系统结构。可能是文件系统结构被破坏了。 引用: 17 : Cannot mount selected partition 解释 :17号错误表示无法挂载指定分区。例如 swap 分区 例子 : grub> root (hd0,2) 这是一个 swap

分区 Filesystem type unknown, partition type

0x82 grub> kernel /vmlinuz Error 17: Cannot mount selected

partition grub> 引用: 18 : Selected cylinder exceeds maximum supported by

BIOS 解释 :18 号错误表示选择的柱面超过了 BIOS 支持的最大能力。这通常发生在不支持 LBA

模式 的硬盘上。 引用: 19 : Linux kernel must be loaded before

initrd 解释 :19 号错误表示执行 initrd 命令前必须先执行 kernel

命令 引用: 20 : Multiboot kernel must be loaded before

modules 解释 :20 号错误表示执行 module 或者 moduleunzip 命令前必须先执行 kernel

命令 引用: 21 : Selected disk does not exist 解释 :21 号错误表示选择的磁盘不存在 例子 : grub> root (hd2) Error 21: Selected disk does not exist grub> 引用: 22 : No such partition 解释 :22 号错误表示分区不存在 例子 : grub> root (hd0,10) Error 22: No such partition grub> 引用: 23 : Error while parsing number 解释 :23 号错误表示参数解释错误,希望是一个数值,但参数却是其他类型 例子 : grub> root (hda,0) Error 23: Error while parsing number grub> 引用: 24 : Attempt to access block outside

partition 解释 :24 号错误表示尝试访问的 block 超出了分区 引用: 25 : Disk read error 解释 :25 号错误表示磁盘读错误 引用: 26 : Too many symbolic links 解释 :26 号错误表示太多的符号连接(默认最多允许5个) 引用: 27 : Unrecognized command 解释 :无法识别的命令 引用: 28 : Selected item cannot fit into

memory 解释 :选择的对象无法被加载到内存中。 例子 : [root@monitor boot]# dd if=/dev/zero of=vmlinuz-2.4.20-31.9 bs=1024

count=1 seek=1 读入了 1+0 个块 输出了 1+0 个块 [root@monitor boot]#grub grub> kernel /vmlinuz-2.4.20-31.9

root=label=/ [Linux-bzImage, setup=0x1400,

size=0xfffff200] Error 28: Selected item cannot fit into

memory grub> 引用: 29 : Disk write error 解释 :磁盘写错误 引用: 30 : Invalid argument 解释 :无效参数 例子 : grub> serial --noarg=0 Error 30: Invalid argument grub> 引用: 31 : File is not sector aligned 解释 :This error may occur only when you access a ReiserFS partition

by block-lists (e.g. the command

`install'). In this case, you

should mount the partition with the

`-o notail' option. 引用: 32 : Must be authenticated 解释 :要求输入口令才能继续进行下面的操作。例如配置文件中有 password 或者 lock

命令 例子 : password root1234 title DOS lock rootnoverify

(hd0,0) chainloader

+1 引用: 33 : Serial device not configured 解释 :33 号错误表示串口还没有配置。这一般发生在你执行 terminal serial

的时候 引用: 34 : No spare sectors on the disk

解释 :磁盘自由空间不足。可能发生在把 stage 1.5 嵌入到 MBR

之后的空间的时候。但这部分空间可能已经被分区表使用了

国内 ubuntu论坛

常见解决方法

症状:

开机显示:GRUB loading

error:unknow filesystem

grub rescue>

原因:

已经发现下面几种操作会导致这种问题:

1,想删除ubuntu,于是直接在windows下删除/格式化了ubuntu所在的分区。

2,调整磁盘,利用工具合并/分割/调整/删除分区,使磁盘分区数目发生了变化。

3,重新安装系统,把linux安装到了新分区,原有分区已经格式化,但是没有重新安装grub2。

4,用ubuntu备份工具/衍生版制造工具等,把主分区回复成了8.X的老版本,结果老版本的grub是grub1,于是把grub2破坏掉了。

总归,是由于操作者不知道grub2分为两部分,一部分(一般情况下)写在了mbr上,另一部分写在了某个分区的/boot/grub目录(如果/boot单独分区,则直接写在对应分区的/grub目录)里面。由于上述操作,致使grub2的mbr里面的那一部分找不到/grub目录里面的那一部分了(或者那一部分已经删除了)。

思路:

方法1,彻底删除grub2,让这个提示不再出现:

适用于已经不想再使用ubuntu,要转回windows的人。

这个很简单,只要你有Windows启动盘(非Ghost),用它启动,至选择安装位置,不用真正安装,退出重启就可以。

或者用它启动到故障修复台,运行fixboot或者fixmbr都可以。

win7命令行下,则是执行:BootRec.exe /fixmbr

(/fixmbr修复mbr,

/FixBoot修复启动扇区,/ScanOs检测已安装的win7,/RebuildBcd重建bcd。)

方法2,重新安装、修复grub2

1. 先使用ls命令,找到Ubuntu的安装在哪个分区:

在 grub rescue>下输入以下命令:

代码:

ls

会罗列所有的磁盘分区信息,比方说:

引用:

(hd0,1),(hd0,5),(hd0,3),(hd0,2)

2. 然后依次调用如下命令: X表示各个分区号码

如果/boot没有单独分区,用以下命令:

代码:

ls (hd0,X)/boot/grub

如果/boot单独分区,则用下列命令:

代码:

ls (hd0,X)/grub

正常情况下,会列出来几百个文件,很多文件的扩展名是.mod和.lst和.img,还有一个文件是grub.cfg。假设找到(hd0,5)时,显示了文件夹中的文件,则表示Linux安装在这个分区。

4,如果找到了正确的grub目录,则设法临时性将grub的两部分关联起来,方法如下:

以下是/boot没有单独分区的命令:

引用:

grub rescue>set root=(hd0,5)

grub rescue>set prefix=(hd0,5)/boot/grub

grub rescue>insmod /boot/grub/normal.mod

以下是/boot 单独分区的命令:(这几句有待验证)

引用:

grub rescue>set root=(hd0,5)

grub rescue>set prefix=(hd0,5)/grub

grub rescue>insmod /grub/normal.mod

然后调用如下命令,就可以显示出丢失的grub菜单了。

grub rescue>normal

不过不要高兴,如果这时重启,问题依旧存在,我们需要进入Linux中,对grub进行修复。

启动起来,进入ubuntu之后,在终端执行:

代码:

sudo update-grub

sudo grub-install

/dev/sda

(sda是你的硬盘号码,千万不要指定分区号码,例如sda1,sda5等都不对)

重启测试是否已经恢复了grub的启动菜单? 恭喜你恢复成功!

5,如果找不到正确的/grub目录,比如第3、4种误操作,则尝试寻找是否有linux核心文件,则依次调用如下命令:

X表示各个分区号码:

grub rescue>下,输入:

如果/boot没有单独分区:

代码:

ls (hd0,X)/boot

如果/boot单独分区,则:

代码:

ls (hd0,X)

找名字类似与vmlinuz-3.0.0-12-generic这样的文件,这是linux核心文件,如果找到,记下(hd0,X)中的X值。假设找到(hd0,5)时,显示了文件夹中的文件。

然后用live cd 或者 live usb启动,在live cd的ubuntu的终端中依次输入以下命令(sda5中的“5”必须改成上面记录下来数值)(这两句需要验证):

如果/boot没有单独分区:

代码:

sudo mount /dev/sda5 /mnt

sudo grub-install --boot-directory=/mnt/boot /dev/sda

如果/boot单独分区,则:

代码:

sudo mount /dev/sda5 /mnt

sudo grub-install --boot-directory=/mnt /dev/sda

然后重新启动即可。

(以上这两句命令也可以解决安装ubuntu时grub安装位置不对,没有将grub安装到/dev/sda,造成启动时不出现ubuntu启动项直接进入windows的问题,不过需要自行确定sda5中的“5”改成什么数字。)

6,如果连linux核心文件都没有,那么,彻底重新安装吧。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值