内核文件不小心删除了,电脑启动不起来了

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
wly343910751
帖子: 43
注册时间: 2009-05-08 20:55

内核文件不小心删除了,电脑启动不起来了

#1

帖子 wly343910751 » 2014-02-23 14:41

一开始装的是ubuntu 12.04,后来升级到13.10,前段时间boot文件夹空间不够了不能升级,不小心把boot里的内核文件删除导致不能启动,现在我这有一个ubuntu 12.04系统盘,有什么办法恢复?
有谁帮忙提供一下boot文件夹下vmlinuz-xxxxxx-generic和initrd.img-xxxxxx-generic这两个文件,最好是3.2.0-23版本的
:em06
头像
maplebeats
帖子: 378
注册时间: 2011-02-16 1:17

Re: 内核文件不小心删除了,电脑启动不起来了

#2

帖子 maplebeats » 2014-02-23 14:49

哈哈。。。用livecd恢复吧
My blog : OOXX
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 内核文件不小心删除了,电脑启动不起来了

#3

帖子 poloshiao » 2014-02-23 16:21

不小心把boot里的内核文件删除
你的 /boot 是否掛載在 單獨一個獨立分割區
還是沒有 (如果沒有 就是掛載在 / 同一個 分割區)
头像
YeLee
论坛版主
帖子: 26406
注册时间: 2008-08-13 8:48
系统: Fundu i64
来自: 东海硇州,一双管钥。
联系:

Re: 内核文件不小心删除了,电脑启动不起来了

#4

帖子 YeLee » 2014-02-23 20:37

http://202.38.95.110/ubuntu/pool/main/l/linux/
进去搜linux-image-3.2.0-23-generic,不用谢,我是活雷锋。 :em01
◎当我站在道德的高度上俯视别人的时候,发现自己是多么渺小。
♥执着但不偏激,反对而不排斥,坚决捍卫矛盾体的存在方式。
★★★天气预报★★★
fcitx-yatable一个可以使用的码表输入法
[教程]几个实例攻克软件编译难关
Gentoo Development Guide
字体相关
头像
photor
论坛版主
帖子: 11004
注册时间: 2008-04-26 12:41

Re: 内核文件不小心删除了,电脑启动不起来了

#5

帖子 photor » 2014-02-24 10:15

wly343910751 写了:一开始装的是ubuntu 12.04,后来升级到13.10,前段时间boot文件夹空间不够了不能升级,不小心把boot里的内核文件删除导致不能启动,现在我这有一个ubuntu 12.04系统盘,有什么办法恢复?
有谁帮忙提供一下boot文件夹下vmlinuz-xxxxxx-generic和initrd.img-xxxxxx-generic这两个文件,最好是3.2.0-23版本的
:em06
用系统盘启动,chroot进原来的系统,reinstall内核就是
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

Re: 内核文件不小心删除了,电脑启动不起来了

#6

帖子 eexpress » 2014-02-24 14:02

支持ls
● 鸣学
wly343910751
帖子: 43
注册时间: 2009-05-08 20:55

Re: 内核文件不小心删除了,电脑启动不起来了

#7

帖子 wly343910751 » 2014-03-01 16:36

poloshiao 写了:
不小心把boot里的内核文件删除
你的 /boot 是否掛載在 單獨一個獨立分割區
還是沒有 (如果沒有 就是掛載在 / 同一個 分割區)
单独200多M的空间
wly343910751
帖子: 43
注册时间: 2009-05-08 20:55

Re: 内核文件不小心删除了,电脑启动不起来了

#8

帖子 wly343910751 » 2014-03-01 16:39

photor 写了:
wly343910751 写了:一开始装的是ubuntu 12.04,后来升级到13.10,前段时间boot文件夹空间不够了不能升级,不小心把boot里的内核文件删除导致不能启动,现在我这有一个ubuntu 12.04系统盘,有什么办法恢复?
有谁帮忙提供一下boot文件夹下vmlinuz-xxxxxx-generic和initrd.img-xxxxxx-generic这两个文件,最好是3.2.0-23版本的
:em06
用系统盘启动,chroot进原来的系统,reinstall内核就是
怎么搞,可以说具体点吗?
wly343910751
帖子: 43
注册时间: 2009-05-08 20:55

Re: 内核文件不小心删除了,电脑启动不起来了

#9

帖子 wly343910751 » 2014-03-01 16:44

photor 写了:
wly343910751 写了:一开始装的是ubuntu 12.04,后来升级到13.10,前段时间boot文件夹空间不够了不能升级,不小心把boot里的内核文件删除导致不能启动,现在我这有一个ubuntu 12.04系统盘,有什么办法恢复?
有谁帮忙提供一下boot文件夹下vmlinuz-xxxxxx-generic和initrd.img-xxxxxx-generic这两个文件,最好是3.2.0-23版本的
:em06
用系统盘启动,chroot进原来的系统,reinstall内核就是
具体怎么做啊,我初学者,不太懂。
头像
photor
论坛版主
帖子: 11004
注册时间: 2008-04-26 12:41

Re: 内核文件不小心删除了,电脑启动不起来了

#10

帖子 photor » 2014-03-01 17:47

wly343910751 写了:
photor 写了:
wly343910751 写了:一开始装的是ubuntu 12.04,后来升级到13.10,前段时间boot文件夹空间不够了不能升级,不小心把boot里的内核文件删除导致不能启动,现在我这有一个ubuntu 12.04系统盘,有什么办法恢复?
有谁帮忙提供一下boot文件夹下vmlinuz-xxxxxx-generic和initrd.img-xxxxxx-generic这两个文件,最好是3.2.0-23版本的
:em06
用系统盘启动,chroot进原来的系统,reinstall内核就是
具体怎么做啊,我初学者,不太懂。
chroot的事一两句话解释不清楚,我先提供一个坛子里的链接:
viewtopic.php?t=376479
你可以自己搜一搜百度、wiki或者这个坛子里关于chroot的内容,了解下基本概念,研究研究,搞不定再上来问。
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 内核文件不小心删除了,电脑启动不起来了

#11

帖子 poloshiao » 2014-03-01 18:31

现在我这有一个ubuntu 12.04系统盘
猜測你這個系統盤是 Live CD/DVD ?
使用 Ubuntu Live CD/DVD 開機 登入試用桌面
從終端機
sudo fdisk -l
把結果直接複製 貼上來
wly343910751
帖子: 43
注册时间: 2009-05-08 20:55

Re: 内核文件不小心删除了,电脑启动不起来了

#12

帖子 wly343910751 » 2014-03-01 19:27

poloshiao 写了:
现在我这有一个ubuntu 12.04系统盘
猜測你這個系統盤是 Live CD/DVD ?
使用 Ubuntu Live CD/DVD 開機 登入試用桌面
從終端機
sudo fdisk -l
把結果直接複製 貼上來
ubuntu@ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x779e3936

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 718847 358400 7 HPFS/NTFS/exFAT
/dev/sda2 718848 189462527 94371840 7 HPFS/NTFS/exFAT
/dev/sda3 189462528 315291647 62914560 7 HPFS/NTFS/exFAT
/dev/sda4 315293694 976771071 330738689 f W95 Ext'd (LBA)
Partition 4 does not start on physical sector boundary.
/dev/sda5 315293696 504037375 94371840 7 HPFS/NTFS/exFAT
/dev/sda6 504039424 504682495 321536 83 Linux
/dev/sda7 504684544 508682239 1998848 82 Linux swap / Solaris
/dev/sda8 508684288 976771071 234043392 83 Linux

Disk /dev/sdb: 32.3 GB, 32250003456 bytes
215 heads, 6 sectors/track, 48828 cylinders, total 62988288 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc3072e18

Device Boot Start End Blocks Id System
/dev/sdb1 32 62988287 31494128 c W95 FAT32 (LBA)
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 内核文件不小心删除了,电脑启动不起来了

#13

帖子 poloshiao » 2014-03-01 19:48

/dev/sda6 504039424 504682495 321536 83 Linux
/dev/sda8 508684288 976771071 234043392 83 Linux
猜測
/dev/sda6 掛載 /boot
/dev/sda8 掛載 /
http://apexu.com/apexu/tw/modules/publi ... p?itemid=1
使用ubuntuliveCD重新安裝grub2

I. 在下面這個指令後面 增加 3-1
3. sudo mount /dev/sda8 /mnt
3-1. sudo mount /dev/sda6 /mnt/boot

II. 在下面這個指令後面 增加 8-1
8. sudo chroot /mnt
8-1. apt-get install --reinstall linux-generic
上面這個指令 安裝 Linux 核心
安裝時 詳細看看 終端機 回應訊息 有沒有安裝
linux-headers-x.x.x-xx
linux-image-x.x.x-xx
如果沒有 另外增加下面兩個指令
apt-get install --reinstall linux-headers-3.2.0-23
apt-get install --reinstall linux-image-3.2.0-23

II. 在下面這個指令後面 增加 16-1
16. sudo umount /sys
16-1. sudo umount /dev/sda6

IV. 其它 依照上面這一篇文章的順序

V. 如果你有重要資料在 /dev/sda8 建議你先備存
備存再動手 永遠是好習慣
wly343910751
帖子: 43
注册时间: 2009-05-08 20:55

Re: 内核文件不小心删除了,电脑启动不起来了

#14

帖子 wly343910751 » 2014-03-02 15:41

poloshiao 写了:
/dev/sda6 504039424 504682495 321536 83 Linux
/dev/sda8 508684288 976771071 234043392 83 Linux
猜測
/dev/sda6 掛載 /boot
/dev/sda8 掛載 /
http://apexu.com/apexu/tw/modules/publi ... p?itemid=1
使用ubuntuliveCD重新安裝grub2

I. 在下面這個指令後面 增加 3-1
3. sudo mount /dev/sda8 /mnt
3-1. sudo mount /dev/sda6 /mnt/boot

II. 在下面這個指令後面 增加 8-1
8. sudo chroot /mnt
8-1. apt-get install --reinstall linux-generic
上面這個指令 安裝 Linux 核心
安裝時 詳細看看 終端機 回應訊息 有沒有安裝
linux-headers-x.x.x-xx
linux-image-x.x.x-xx
如果沒有 另外增加下面兩個指令
apt-get install --reinstall linux-headers-3.2.0-23
apt-get install --reinstall linux-image-3.2.0-23

II. 在下面這個指令後面 增加 16-1
16. sudo umount /sys
16-1. sudo umount /dev/sda6

IV. 其它 依照上面這一篇文章的順序

V. 如果你有重要資料在 /dev/sda8 建議你先備存
備存再動手 永遠是好習慣
下面是运行情况,你底下有叫卸载/sys,之前也没挂载这个啊?
root@ubuntu:/# apt-get install --reinstall linux-image-3.11.0-17-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
account-plugin-windows-live gnome-contacts gstreamer1.0-nice guile-2.0-libs
libfarstream-0.2-2 libgc1c2 libtelepathy-farstream3 linux-headers-3.11.0-12
linux-headers-3.11.0-12-generic linux-image-3.11.0-12-generic
linux-image-3.8.0-31-generic linux-image-extra-3.11.0-12-generic
linux-image-extra-3.8.0-31-generic signon-plugin-password
Use 'apt-get autoremove' to remove them.
Suggested packages:
fdutils linux-doc-3.11.0 linux-source-3.11.0 linux-tools
The following NEW packages will be installed:
linux-image-3.11.0-17-generic
0 upgraded, 1 newly installed, 0 to remove and 262 not upgraded.
6 not fully installed or removed.
Need to get 0 B/14.4 MB of archives.
After this operation, 39.8 MB of additional disk space will be used.
Can not write log, openpty() failed (/dev/pts not mounted?)
(Reading database ... 458744 files and directories currently installed.)
Unpacking linux-image-3.11.0-17-generic (from .../linux-image-3.11.0-17-generic_3.11.0-17.31_amd64.deb) ...
grep: /proc/cpuinfo: No such file or directory
This kernel does not support a non-PAE CPU.
dpkg: error processing /var/cache/apt/archives/linux-image-3.11.0-17-generic_3.11.0-17.31_amd64.deb (--unpack):
subprocess new pre-installation script returned error exit status 1
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.11.0-17-generic /boot/vmlinuz-3.11.0-17-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.11.0-17-generic /boot/vmlinuz-3.11.0-17-generic
/bin/df: ‘/sys/fs/cgroup’: No such file or directory
/bin/df: ‘/sys/fs/fuse/connections’: No such file or directory
/bin/df: ‘/sys/kernel/debug’: No such file or directory
/bin/df: ‘/sys/kernel/security’: No such file or directory
/bin/df: ‘/run/shm’: No such file or directory
/bin/df: ‘/run/user’: No such file or directory
/bin/df: ‘/sys/fs/pstore’: No such file or directory
/bin/df: ‘/sys/fs/cgroup/systemd’: No such file or directory
Errors were encountered while processing:
/var/cache/apt/archives/linux-image-3.11.0-17-generic_3.11.0-17.31_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@ubuntu:/# apt-get install --reinstall linux-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
linux-image-extra-3.11.0-17-generic : Depends: linux-image-3.11.0-17-generic but it is not going to be installed
linux-image-generic : Depends: linux-image-3.11.0-17-generic but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 内核文件不小心删除了,电脑启动不起来了

#15

帖子 poloshiao » 2014-03-02 18:22

你底下有叫卸载/sys,之前也没挂载这个啊?
掛載
7. sudo mount --bind /sys /mnt/sys
卸載
16. sudo umount /sys
grep: /proc/cpuinfo: No such file or directory
在下面這個指令後面
6. sudo mount --bind /proc /mnt/proc
6-1. 先執行
sudo ls -al /proc/cpuinfo
看看有沒有這個檔案
6-2. 如果有 執行下面這個指令
sudo cp -af /proc/cpuinfo /mnt/proc
最好是3.2.0-23版本的
apt-get install --reinstall linux-image-3.11.0-17-generic
你爲何一下要從 3.2.0-23 跳到 3.11.0-17
目前 12.04 的核心 最大也是 3.2.0.59.70
要超過這個版本 必須另外安裝 LTSEnablementStack
https://wiki.ubuntu.com/Kernel/LTSEnablementStack
所以建議你 安裝 3.2.0-23 或 原來已經安裝的版本 讓問題 單純化
試試
/bin/df: ‘/sys/fs/cgroup’: No such file or directory
... 以下省略
這個問題 等上面的問題解決了 再看看會不會再出現
apt-get install --reinstall linux-generic
你既然已經直接安裝 linux-image 及 linux-headers 就不必再安裝這個

下面貼文 可以提供更多的建議 你可以參考看看 我上面提供的程序 還缺少什麼
http://askubuntu.com/questions/28099/ho ... ll-kernels
http://askubuntu.com/questions/337379/a ... old-kernel

如果問題還沒解決 建議你全新安裝 Ubuntu 12.04 或 Ubuntu 14.04 比較快
如果 /dev/sda8 有重要檔案 可以先從上面掛載的 /mnt 資料夾 複製出來 備存
回复