ubuntu 9.10 系统,刚装的。
由于我用的一款软件(Ksplice Uptrack)自身的bug问题,导致桌面错误,回收站、我的电脑 一律无法访问。
我参照了官网(地址:https://bugs.launchpad.net/ubuntu/+sour ... bug/446745)给出的建议,
运行了:update-initramfs -u all ,但是重启错误依然。
于是,我索性 运行:update-initramfs -d -k all (记不太清了),成功的remove 掉了 initd.img,
不过没有及时的 update-initramfs -c (恨呐)。 然后就重启了.
一开机,好了 报 "file not found",杯具呀 安全模式也进不去了
只好插入 live cd 盘,启动进去了,把 live cd 盘里面的boot下所有文件(除了grub文件夹)全都拷到了我ubuntu分区相对位置下面.
重启,不报 文件找不到了,报 "you need to load the kernel first",我疯了....
我查了相关资料,有人说有可能是因为grub2 把(hd0,1)当作第一分区造成的,我特地用live cd 进去看了看我的grub.cfg.
ubuntu 9.10
root (hd0,2)
windows 7 loader
root (hd0,1)
没错呀,我win 7是可以进去的.
到底是什么原因呢?? 希望大家帮帮忙
启动ubuntu报"you need to load the kernel first"
- sciolist
- 帖子: 43
- 注册时间: 2009-04-25 14:41
- 系统: Ubuntu 12.04
- 来自: Shanghai,China
- 联系:
-
- 帖子: 97
- 注册时间: 2009-09-19 17:31
Re: 启动ubuntu报"you need to load the kernel first"
更新一下grub2吧。
用livecd修复grub2
用ubuntu9.10的livecd启动后,打开终端
假如你的ubuntu 的 / 分区是sda7,又假如 /boot分区是 sda6,用livecd启动,
在终端下输入
sudo -i
mount /dev/sda7 /mnt
mount /dev/sda6 /mnt/boot (如果没 /boot 单独分区这步跳过)
grub-install --root-directory=/mnt/ /dev/sda
和前面一样,要装入第二硬盘的把sda改为sdb。
如果grub.cfg己丢失,需要重建的还要执行
mount --bind /proc /mnt/proc
mount --bind /dev /mnt/dev
mount --bind /sys /mnt/sys
chroot /mnt update-grub
umount /mnt/sys
umount /mnt/dev
umount /mnt/proc
exit
用livecd修复grub2
用ubuntu9.10的livecd启动后,打开终端
假如你的ubuntu 的 / 分区是sda7,又假如 /boot分区是 sda6,用livecd启动,
在终端下输入
sudo -i
mount /dev/sda7 /mnt
mount /dev/sda6 /mnt/boot (如果没 /boot 单独分区这步跳过)
grub-install --root-directory=/mnt/ /dev/sda
和前面一样,要装入第二硬盘的把sda改为sdb。
如果grub.cfg己丢失,需要重建的还要执行
mount --bind /proc /mnt/proc
mount --bind /dev /mnt/dev
mount --bind /sys /mnt/sys
chroot /mnt update-grub
umount /mnt/sys
umount /mnt/dev
umount /mnt/proc
exit
问问题之前要先站内google搜索,时间多了就看置顶帖子,再不行就发问。
有关Windows启动,GNU GRUB和GRUB4DOS的一些启动流程与细节汇总
有关Windows启动,GNU GRUB和GRUB4DOS的一些启动流程与细节汇总
- sciolist
- 帖子: 43
- 注册时间: 2009-04-25 14:41
- 系统: Ubuntu 12.04
- 来自: Shanghai,China
- 联系:
Re: 启动ubuntu报"you need to load the kernel first"
没有效果呀,找着ls的办法重装了一下grub2,开机依然是提示 原先的错误.
我的命令:
重起 还是那个 错
附我的硬盘分区表:

我的命令:
代码: 全选
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
ubuntu@ubuntu:~$ sudo -i
root@ubuntu:~# mount /dev/sda2 /mnt
root@ubuntu:~# grub-install --help
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
--root-directory=DIR install GRUB images under the directory DIR
instead of the root directory
--grub-setup=FILE use FILE as grub-setup
--grub-mkimage=FILE use FILE as grub-mkimage
--grub-mkdevicemap=FILE use FILE as grub-mkdevicemap
--grub-probe=FILE use FILE as grub-probe
--no-floppy do not probe any floppy drive
--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 the DIR/boot directory specified by
--root-directory, and uses grub-setup to install grub into the boot
sector.
Report bugs to <[email protected]>.
root@ubuntu:~# grub-install --root-directory=/mnt/ /dev/sda
Installation finished. No error reported.
This is the contents of the device map /mnt//boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.
(hd0) /dev/sda
附我的硬盘分区表:

oh yeah
- sciolist
- 帖子: 43
- 注册时间: 2009-04-25 14:41
- 系统: Ubuntu 12.04
- 来自: Shanghai,China
- 联系:
Re: 启动ubuntu报"you need to load the kernel first"
而且 发现 一个题,当我 用 update-grub 去 重新生成 grub.cfg 时,好象没有发现 ubuntu kernel.
代码: 全选
root@ubuntu:~# chroot /mnt update-grub
Generating grub.cfg ...
Found memtest86+ image: /boot/memtest86+.bin
Found Windows 7 (loader) on /dev/sda1
done
oh yeah
- smallapple
- 论坛版主
- 帖子: 7868
- 注册时间: 2009-03-28 15:12
Re: 启动ubuntu报"you need to load the kernel first"
牛人,把内核清了。于是,我索性 运行:update-initramfs -d -k all (记不太清了),成功的remove 掉了 initd.img



把livecd下casper目录中的vmlinuz和initrd.lz拷出来,放在windows随便一个分区的根目录下,然后启动时在菜单上按 c ,再grub>下输入
grub>set root=(hd0,x) ---->这个是vmlinuz和initrd.lz所在分区,如第一分区是 (hd0,1),要搞不清楚就用 grub>search -s -f -n /vmlinuz
grub>linux /vmlinuz root=/dev/sday ---->sday的是你的 / 分区号
grub>initrd /initrd.lz
grub>boot
启动后再到新立得把内核装上再
sudo update-grub
- sciolist
- 帖子: 43
- 注册时间: 2009-04-25 14:41
- 系统: Ubuntu 12.04
- 来自: Shanghai,China
- 联系:
-
- 帖子: 62
- 注册时间: 2009-11-15 16:51
Re: 启动ubuntu报"you need to load the kernel first"
用wubi安装的,怎么弄哦?上面的方法不行呀。
-
- 帖子: 1
- 注册时间: 2010-03-25 0:37
Re: 启动ubuntu报"you need to load the kernel first"
wubi也是一样的方法,稍微有些不同,我就用6楼的内容回复了verasky 写了:用wubi安装的,怎么弄哦?上面的方法不行呀。
找到你wubi自动下载的那个镜像文件,用winrar打开,把casper目录中的vmlinuz和initrd.lz拷出来,放在windows随便一个分区的根目录下,然后启动时在菜单上按 c ,再grub>下输入
grub>set root=(hd0,x) ---->这个是vmlinuz和initrd.lz所在分区,如第一分区是 (hd0,1),要搞不清楚就用 grub>search -s -f -n /vmlinuz
grub>linux /vmlinuz root=/dev/sday ro loop=/ubuntu/disks/root.disk ---->sday中的y是你的 / 分区号,我的Ubuntu是安装在F盘,是硬盘的第7分区,这里就用了sda7,另外loop的值是是root.disk文件相对于root分区的路径,如有不同,需要根据实际情况修改
grub>initrd /initrd.lz
grub>boot
这样就可以启动你的linux了,下面是进入以后的操作
先删除原有的kernel部分:
打开终端, 执行: sudo apt-get remove linux-image-2.6.31-20-generic --》这里2.6.21-20是我现有的版本号,需要根据实际情况修改
待执行完成后,执行:sudo apt-get install linux-image-2.6.31-20-generic --》这里2.6.21-20是我要安装的版本号,因为我是要修复,所以跟上面是一样的
待执行完成后,执行:sudo update-grub
重启,再次尝试进入,可以了,嘿嘿
这是我的操作过程,於大家分享以下
-
- 帖子: 12
- 注册时间: 2012-09-16 20:37
- 系统: ubuntu12.04
Re: 启动ubuntu报"you need to load the kernel first"
果真呐!用liveCD修复了我的Ubuntu12.04启动项
昨晚心血来潮,在WIN7+Ubuntu的基础上,用U盘安装了Debian6.05。当时我选择了从Debian启动(因为它列出了WIN7与Ubuntu,一时图省事就从了它)。
重启时,要进入Ubuntu,出错了……you need to load the kernel first……
WIN7与新装的Debian倒是可以正常启动(Debian中文乱码,Google解决了)。想在WIN7的easyBCD重新建立引导,没效果(俩Linux内核的系统所在位置,在add…那个选项没有体现出来)……
问题解决了,但是却不知道出在哪里(也没打算去查查资料什么的,惭愧一下)

昨晚心血来潮,在WIN7+Ubuntu的基础上,用U盘安装了Debian6.05。当时我选择了从Debian启动(因为它列出了WIN7与Ubuntu,一时图省事就从了它)。

重启时,要进入Ubuntu,出错了……you need to load the kernel first……

WIN7与新装的Debian倒是可以正常启动(Debian中文乱码,Google解决了)。想在WIN7的easyBCD重新建立引导,没效果(俩Linux内核的系统所在位置,在add…那个选项没有体现出来)……
问题解决了,但是却不知道出在哪里(也没打算去查查资料什么的,惭愧一下)