I deleted files from my Linux box's /boot directory and now it won't boot

I deleted files from /boot to save space, but now when I boot I see:

GRUB loading, please wait … ERROR 15

/boot still has files corresponding to the 2.6.32-27 version of Linux. But I deleted all others that did not have that string in /boot

How can I fix this?

Here is Solutions:

We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.

Solution 1

Here are some instructions on reinstalling grub2 in recent versions of Ubuntu.

I’d recommend following the chroot method as I think that will be the easiest and safest way to restore your system.

Additionally, the next time that you want to clean up drive space on /boot, you can use synaptic or apt-get to remove old kernels. For example:

$ sudo apt-get remove linux-image-2.6.31-21-generic

Solution 2

Well Error 15 reads “File not found”.
Restore your /boot from your last backup.

Solution 3

You can try to reinstall grub, I think that recreates the boot folder. Not too sure though, but it can’t hurt…

Solution 4

The MBR is trying to read from a grub install somewhere on disk which has now been deleted.

You’ll need to create a grub install and then write it to the MBR. Check the man page for “grub-install”.

Basically you need to run:

sudo grub-install /dev/sda

to write create a new grub 2 and write it to the MBR.

You’ll need to drop a grub.cfg file to boot up your OS though in /boot/grub. If you don’t have one you can regenerate a grub2 config file using grub-setup.

Solution 5

On a modern Ubuntu installation, you should enter

sudo apt-get install --reinstall linux-image-3.xx.xx-generic

for whichever kernel version you have. This should run a ‘depmod’ and then create the

  • vmlinuz
  • initrd.img
  • System.map
  • abi
  • config

files. Finally, it creates a new grub.cfg. Hopefully this is helpful.

Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply