I am running a laptop with Windows 7 and Ubuntu 12.04. I had grub issues following a partition resize which were eventually found to be problems due to missing kernel files. (These problems did not begin until a week after the resize, during which the computer continued to work perfectly).
By chrooting into my hard drive install from a 12.04 LTS LiveCD I was eventually able to restore /boot/initrd-3.2.0.24-generic.img
. By copying vmlinuz
from the LiveCD's /casper/
folder to /boot/vmlinuz-3.2.0.24-generic
I found that update-grub
would finally recognize and add my Ubuntu install to the grub menu, which was my initial problem.
However, my new problem is that when booting into this install I am met with all kinds of failed modules and error messages, often far too fast for me to even read or remember; finally I am given the option of starting Ubuntu in Low Graphics Mode, Troubleshooting, Command Prompt, Networking etc... Selecting Low Graphics Mode just dumps me out at the terminal prompting me to login, but my user name and password do not work.
Perhaps simply copying the vmlinuz from LiveCD has caused these errors? My problem is that an appropriate vmlinuz
was not installed by the same kernel install process that restored my 'initrd-....'.img
I would really prefer not to have to reinstall the entire Ubuntu partition again as I had a lot of customized settings for various programming environments I use for my research work and I am currently abroad, limiting my bandwidth which is quite necessary to restore much of this software.
I do however have a complete image and a complete clone of the non-booting partition (both via CloneZilla); I just don't know if these actually acquired my private 'Home' folder, which claims to be unreadable when I mount the clone.
Have you tried using
apt-get
to (re-)install the kernel?Try booting the Live CD or USB which matches your Ubuntu install, then
chroot
, and then the command below.--reinstall
or doing aremove
of the above packages and then trying toinstall
again.If none of the above works, please update your question with details about how it failed.
The suggestion above is based on what
apt-get
did to upgrade the kernel of a clean install of Ubuntu 12.04 LTS 64-bit in a virtual machine. The packages whichapt-get
decided to install to update the kernel werelinux-generic
,linux-image-generic
, andlinux-headers-generic
.I have included below the output I got from running the
apt-get
command above in case it is of any possible use.It appears to me that both
vmlinuz-3.2.0-25-generic
andinitrd.img-3.2.0-25-generic
were generated by running theupdate-initramfs
script during installation post-processing. So I doubt that just copying the files from one installation to another would work unless the installations were identical (enough).I would have initially suggested to same thing but had to find a better answer than copying files from live media or just installing linux-image-generic in chroot.
My suggestion is to look into
/lib/modules/
of your installation and pick the latest kernel version number you can find, then install the corresponding kernel image in chroot. To generateinitrd
if it wasn't created automatically you have to runmkinitramfs
which would otherwise have been called byupdate-initramfs
, but may refuse to work from live media.I posted complete instructions here: How to restore deleted files in /boot? (vmlinuz missing, system does not boot)