/ boot缺少vmlinuz


10

我正在使用Windows 7和Ubuntu 12.04运行笔记本电脑。分区调整大小后,我遇到了grub问题,最终由于缺少内核文件而发现了问题。(这些问题直到调整大小后的一周才开始,在此期间计算机继续正常工作)。

通过从12.04 LTS LiveCD切入我的硬盘驱动器,我最终得以还原/boot/initrd-3.2.0.24-generic.img。通过vmlinuz从LiveCD的/casper/文件夹复制到,/boot/vmlinuz-3.2.0.24-generic我发现update-grub最终可以识别并将我的Ubuntu安装添加到grub菜单,这是我最初的问题。

但是,我的新问题是,启动此安装程序时,我会遇到各种失败的模块和错误消息,这些速度通常太快,以至于我什至无法阅读或记住。最后,我可以选择以低图形模式启动Ubuntu,故障排除,命令提示符,网络连接等。选择低图形模式只会使我在终端上退出,提示我登录,但是我的用户名和密码不起作用。

也许仅仅从LiveCD复制vmlinuz会导致这些错误?我的问题是,vmlinuz通过还原我的内核安装过程未安装适当的内核'initrd-....'.img

我真的不希望不必重新安装整个Ubuntu分区,因为我在研究工作中使用了许多针对各种编程环境的自定义设置,而我目前在国外,这限制了我的带宽,这对于恢复很多此类工作非常必要软件。

但是,我确实具有完整的映像和非启动分区的完整克隆(均通过CloneZilla);我只是不知道这些文件是否真的获得了我的私人“ Home”文件夹,当我挂载克隆文件时,该文件夹声称不可读。


您介意插入一些换行符吗?我不喜欢这种“文字墙”
Martin Ueding 2012年

很抱歉,关于格式的问题,正如我之前提到的,我最近在国外,但我还没有弄清楚所有符号在这些国际键盘上的位置。
msolters 2012年

Answers:


10

您是否尝试过使用apt-get(重新)安装内核?


尝试引导与您的Ubuntu安装相匹配的Live CD或USB,然后引导,然后引导chroot以下命令。

apt-get -V install linux-generic linux-image-generic linux-headers-generic
  • 注意:如果上述方法不起作用,您也可以尝试上述一种方法--reinstall或进行remove上述方法中的一种,然后install再次尝试。

如果没有上述作品,请更新它是如何失败的详细信息,你的问题。

上面的建议基于在apt-get虚拟机中升级全新安装的Ubuntu 12.04 LTS 64位内核的操作。该软件包apt-get决定安装更新内核是linux-genericlinux-image-genericlinux-headers-generic

我将通过apt-get上面的命令运行得到的输出包含在下面,以防它有任何可能的用途。

在我看来,两者vmlinuz-3.2.0-25-genericinitrd.img-3.2.0-25-generic都是通过在安装后处理过程中运行update-initramfs脚本生成的。因此,我怀疑将文件从一个安装复制到另一个安装是否可以工作,除非安装完全相同(足够)。

irrational@VB64Too:~$ sudo apt-get -V install linux-generic linux-image-generic linux-headers-generic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
   linux-headers-3.2.0-25 (3.2.0-25.40)
   linux-headers-3.2.0-25-generic (3.2.0-25.40)
   linux-image-3.2.0-25-generic (3.2.0-25.40)
Suggested packages:
   fdutils (5.5-20060227-5)
   linux-doc-3.2.0 ()
   linux-source-3.2.0 (3.2.0-25.40)
   linux-tools (3.2.0.25.27)
The following NEW packages will be installed:
   linux-headers-3.2.0-25 (3.2.0-25.40)
   linux-headers-3.2.0-25-generic (3.2.0-25.40)
   linux-image-3.2.0-25-generic (3.2.0-25.40)
The following packages will be upgraded:
   linux-generic (3.2.0.23.25 => 3.2.0.25.27)
   linux-headers-generic (3.2.0.23.25 => 3.2.0.25.27)
   linux-image-generic (3.2.0.23.25 => 3.2.0.25.27)
3 upgraded, 3 newly installed, 0 to remove and 247 not upgraded.
Need to get 50.6 MB of archives.
After this operation, 216 MB of additional disk space will be used.
Do you want to continue [Y/n]? 
Get:1 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main linux-image-3.2.0-25-generic amd64 3.2.0-25.40 [38.2 MB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main linux-generic amd64 3.2.0.25.27 [1,710 B]                          
Get:3 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main linux-image-generic amd64 3.2.0.25.27 [2,648 B]                    
Get:4 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main linux-headers-3.2.0-25 all 3.2.0-25.40 [11.4 MB]                   
Get:5 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main linux-headers-3.2.0-25-generic amd64 3.2.0-25.40 [958 kB]          
Get:6 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main linux-headers-generic amd64 3.2.0.25.27 [2,644 B]                  
Fetched 50.6 MB in 36s (1,398 kB/s)                                                                                                
Selecting previously unselected package linux-image-3.2.0-25-generic.
(Reading database ... 141202 files and directories currently installed.)
Unpacking linux-image-3.2.0-25-generic (from .../linux-image-3.2.0-25-generic_3.2.0-25.40_amd64.deb) ...
Done.
Preparing to replace linux-generic 3.2.0.23.25 (using .../linux-generic_3.2.0.25.27_amd64.deb) ...
Unpacking replacement linux-generic ...
Preparing to replace linux-image-generic 3.2.0.23.25 (using .../linux-image-generic_3.2.0.25.27_amd64.deb) ...
Unpacking replacement linux-image-generic ...
Selecting previously unselected package linux-headers-3.2.0-25.
Unpacking linux-headers-3.2.0-25 (from .../linux-headers-3.2.0-25_3.2.0-25.40_all.deb) ...
Selecting previously unselected package linux-headers-3.2.0-25-generic.
Unpacking linux-headers-3.2.0-25-generic (from .../linux-headers-3.2.0-25-generic_3.2.0-25.40_amd64.deb) ...
Preparing to replace linux-headers-generic 3.2.0.23.25 (using .../linux-headers-generic_3.2.0.25.27_amd64.deb) ...
Unpacking replacement linux-headers-generic ...
Setting up linux-image-3.2.0-25-generic (3.2.0-25.40) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.2.0-25-generic /boot/vmlinuz-3.2.0-25-generic
update-initramfs: Generating /boot/initrd.img-3.2.0-25-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 3.2.0-25-generic /boot/vmlinuz-3.2.0-25-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.2.0-25-generic /boot/vmlinuz-3.2.0-25-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.2.0-25-generic /boot/vmlinuz-3.2.0-25-generic
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.2.0-25-generic
Found initrd image: /boot/initrd.img-3.2.0-25-generic
Found linux image: /boot/vmlinuz-3.2.0-23-generic
Found initrd image: /boot/initrd.img-3.2.0-23-generic
Found memtest86+ image: /boot/memtest86+.bin
Found Windows 7 (loader) on /dev/sda1
done
Setting up linux-image-generic (3.2.0.25.27) ...
Setting up linux-generic (3.2.0.25.27) ...
Setting up linux-headers-3.2.0-25 (3.2.0-25.40) ...
Setting up linux-headers-3.2.0-25-generic (3.2.0-25.40) ...
Setting up linux-headers-generic (3.2.0.25.27) ...
irrational@VB64Too:~$

0

通过从12.04 LTS LiveCD切入我的硬盘驱动器,我最终得以还原/boot/initrd-3.2.0.24-generic.img。通过vmlinuz从LiveCD的/casper/文件夹复制到,/boot/vmlinuz-3.2.0.24-generic我发现update-grub最终可以识别并将我的Ubuntu安装添加到grub菜单,这是我最初的问题。

但是,我的新问题是,在启动此安装程序时,遇到各种失败的模块和错误消息……

我最初会建议做同样的事情,但必须找到比从实时媒体复制文件或仅在chroot中安装linux-image-generic更好的答案。

我的建议是调查/lib/modules/安装情况,选择可以找到的最新内核版本号,然后在chroot中安装相应的内核映像。要生成initrd不是自动创建的内容,您必须运行mkinitramfs,否则将被调用update-initramfs,但可能会拒绝通过实时媒体运行。

我在这里发布了完整的说明:如何在/ boot中恢复已删除的文件?(vmlinuz丢失,系统无法启动)

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.