grub 中没有内核

grub 中没有内核

嗨,Linux 专业人士 =O

我有 ubuntu 12.04 3.5.0-23-generic 与 win7 双启动。但在我的系统上使用 ati/radeon fglrx 时出现问题,所以我决定降级内核(因为该驱动程序适用于内核 <= 3.4)。

我在我的系统上安装了 linux-image.3.2.0-23-generic 和 linux-image.3.2.0-24-generic,并且我使用 sudo update-grub 将这些内核添加到 grub 引导加载程序,输出显示所有内核都已添加到引导加载程序。

重启后,引导加载程序上只有 3.5.0-23,所以我想如果我卸载 3.5.0-23,grub 就可以加载其他内核(我感到很惭愧 =[)。我通过 synaptic 卸载了 linux-image-3.5.0.23generic,重启后 grub 引导加载程序上只有这些选项:

记忆测试

win7

我使用实时 USB 来获取以下信息:

/etc/默认/grub

> # If you change this file, run 'update-grub' afterwards to update
> # /boot/grub/grub.cfg.
> # For full documentation of the options in this file, see:
> #   info -f grub -n 'Simple configuration'
> 
> GRUB_DEFAULT="0"
> #GRUB_HIDDEN_TIMEOUT=0 GRUB_HIDDEN_TIMEOUT_QUIET=true GRUB_TIMEOUT=10 GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
> GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" GRUB_CMDLINE_LINUX=""
> 
> # Uncomment to enable BadRAM filtering, modify to suit your needs
> # This works with Linux (no patch required) and with any kernel that obtains
> # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
> #GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
> 
> # Uncomment to disable graphical terminal (grub-pc only)
> #GRUB_TERMINAL=console
> 
> # The resolution used on graphical terminal
> # note that you can use only modes which your graphic card supports via VBE
> # you can see them in real GRUB with the command `vbeinfo'
> #GRUB_GFXMODE=640x480
> 
> # Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
> #GRUB_DISABLE_LINUX_UUID=true
> 
> # Uncomment to disable generation of recovery mode menu entries
> #GRUB_DISABLE_RECOVERY="true"
> 
> # Uncomment to get a beep at grub start
> #GRUB_INIT_TUNE="480 440 1"

/boot 中没有任何内容

1-我的系统中是否存在这些内核(3.2.0.23 和 3.20.24)?

2_如果它们在我的系统中,我该如何将它们添加到 grub 并使用它们?

3-有没有办法恢复 3.5.0.23 内核?

我以前读过类似的帖子,但我不想重新安装 ubuntu。请帮帮我。:'(

编辑1:

ubuntu@ubuntu:/$ dpkg -l linux-image*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version        Description
+++-==============-==============-============================================
un  linux-image    <none>         (no description available)
un  linux-image-3. <none>         (no description available)
iF  linux-image-3. 3.2.0-23.36    Linux kernel image for version 3.2.0 on 64 b
ii  linux-image-3. 3.5.0-23.35~pr Linux kernel image for version 3.5.0 on 32 b
ii  linux-image-ge 3.5.0.23.30    Generic Linux kernel image

编辑2

ubuntu@ubuntu:~$ ls -al /boot
total 53021
drwxr-xr-x 1 root   root       4096 Jul 19 15:41 .
drwxr-xr-x 1 ubuntu ubuntu     4096 Jul 19 15:41 ..
-rw-r--r-- 1 root   root     795572 Apr 11  2012 abi-3.2.0-23-generic
-rw-r--r-- 1 root   root     856743 Jan 25 21:07 abi-3.5.0-23-generic
-rw-r--r-- 1 root   root     147316 Apr 11  2012 config-3.2.0-23-generic
-rw-r--r-- 1 root   root     154436 Jan 25 21:07 config-3.5.0-23-generic
drwxr-xr-x 1 root   root       4096 Jun 24 17:25 grub
-rw-r--r-- 1 root   root   20358320 Jul 19 15:41 initrd.img-3.2.0-23-generic
-rw-r--r-- 1 root   root   21986987 Jul 19 15:39 initrd.img-3.5.0-23-generic
-rw-r--r-- 1 root   root     176764 Nov 27  2011 memtest86+.bin
-rw-r--r-- 1 root   root     178944 Nov 27  2011 memtest86+_multiboot.bin
-rw------- 1 root   root    2252691 Apr 11  2012 System.map-3.2.0-23-generic
-rw------- 1 root   root    2421090 Jan 25 21:07 System.map-3.5.0-23-generic
-rw------- 1 root   root    4864480 Apr 11  2012 vmlinuz-3.2.0-23-generic

编辑3

ubuntu@ubuntu:$ uname -a
Linux ubuntu 3.2.0-23-generic #36-Ubuntu SMP Tue Apr 10 20:41:14 UTC 2012 i686 athlon i386 GNU/Linux
:
ubuntu@ubuntu:$ sudo dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d'
linux-headers-3.5.0-23
linux-headers-3.5.0-23-generic
linux-image-3.5.0-23-generic
:
ubuntu@ubuntu:$ uname -sr
Linux 3.2.0-23-generic

答案1

只需修复你的 grub 和 boot loader

$ grub-install -v ( check GRUB version and GRUB file:- /boot/grub/grub.cfg )

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

$ sudo apt-get update

$ sudo apt-get install -y boot-repair
$ boot-repair

然后重新启动 ubuntu。

相关内容