Ok, I've managed to help myself. It took 3 long evenings, but at the end I fix it. Unfortunetly I can't describe verbose fix description as trying to fix the problem I go through too many cases. However I will describe process that helped me - reinstalling kernel + grub.
!!! Below instructions are rather for average linux users. I thought that to fix my system I need to completly remove /boot directory! IF YOU ARE BEGINNER YOU DON'T WANT TO DO THAT!!! I make this decision as apt was reinstalling kernels without failure but my system couldn't boot.
Preparations
- Grab live cd with same architecture as Your system you will rescue (32- or 64- bit).
- Run live cd. Chroot from live cd into your system you will rescue (read http://ubuntuforums.org/showthread.php?t=1581099 for info how to chroot). All next steps are described in the context of root@chroot-system-to-rescue.
Uninstalling kernels and grub
- cd /boot; ls -l
- for all listed kernels try to uninstall them:
Code:
apt-get -V purge linux-headers-w.x.y-z-generic linux-image-w.x.y-z-generic
- If you won't be able to uninstall kernel due to some post script error, try cleaning apt (see right below)
- Now uninstall grub
Code:
apt-get -V purge grub-pc grub-common
- and see what's else there. Uninstall any other kernel you see in /boot. Oh! I see memtest.bin. Let's uninstall it too.
Code:
apt-get -V purge memtest86+
- check /boot, no files should be there, only /grub and some /extlinux. If there are some other kernels go ahead and uninstall them. Now as everything was uninstalled and /boot is nearly empty, remove directories within boot
Clean apt if you can't uinstall kernel
Installing new kernel I got Out of space error - my boot partiton was too small. This caused that I got partially installed kernel which I could not uninstall or install as there was some failure in post-installation scripts. Working solution for such situation is to clean apt and manually remove kernel related files from /boot
Code:
apt-get clean
rm /var/lib/apt/lists/*
rm /var/lib/apt/lists/partial/*
apt-get clean
apt-get update
Now try uninstall kernel You couldn't uninstall previously - apt should tell you it's not installed so go to /boot and remove kernel's related files
Install kernels and grub
Code:
apt-get update
apt-get dist-upgrade
apt-get install -V memtest86+ # I think that one 2.8.0-* kernel's post installation procedures were failing if memtest86+ wasn't exist (at least in lubuntu)
apt-get install -V linux-image
apt-get install -V grub-pc grub-common
# NOTE installing grub. Some text-wizard window will appear. Now in most cases You want to install grub on disk's MBR and not in partions so in most cases you would like to choose in that dialog disk like /dev/sdX and not partition like: /dev/sdX[DIGIT]
Check /boot now. It was empty, now it's home of various files. In my /boot I have:
Code:
abi-3.8.0-22-generic
config-3.8.0-22-generic
extlinux
grub
initrd.img-3.8.0-22-generic
memtest86+.bin
memtest86+_multiboot.bin
System.map-3.8.0-22-generic
vmlinuz-3.8.0-22-generic
If you have similar files then this store have to end with success. Reboot and keep your fingers crossed.
Bookmarks