My /boot was full and I couldn't update, so I tried to get rid of unnecessary files, but I think I might have deleted some things I shouldn't have. I don't know if grub or grub2 works, or whether or not I can still boot into windows. However, I haven't shut off my computer yet so I was hoping I could fix everything now. What can I do?

I used this command:

for akernel in $(dpkg -l 'linux-' | sed '/^ii/!d;/'"$(uname -r | sed "s/(.)-([^0-9]+)/\1/")"'/d;s/^[^ ]* [^ ]* ([^ ])./\1/;/[0-9]/!d'); do sudo apt-get purge $akernel; done

uname -r

3.13.0-66-generic

ls -lhA /boot

total 29M

-rw-r--r-- 1 root root 1.2M Oct 7 12:34 abi-3.13.0-66-generic

-rw-r--r-- 1 root root 162K Oct 7 12:34 config-3.13.0-66-generic

drwxr-xr-x 5 root root 1.0K Dec 17 21:41 grub

-rw-r--r-- 1 root root 19M Oct 30 18:15 initrd.img-3.13.0-66-generic

drwx------ 2 root root 12K Feb 7 2015 lost+found

-rw-r--r-- 1 root root 173K Mar 12 2014 memtest86+.bin

-rw-r--r-- 1 root root 174K Mar 12 2014 memtest86+.elf

-rw-r--r-- 1 root root 175K Mar 12 2014 memtest86+_multiboot.bin

-rw------- 1 root root 3.3M Oct 7 12:34 System.map-3.13.0-66-generic

-rw------- 1 root root 5.6M Oct 7 12:34 vmlinuz-3.13.0-66-generic

du -h /boot

du: cannot read directory ‘/boot/lost+found’: Permission denied

12K /boot/lost+found

2.1M /boot/grub/i386-pc

9.0K /boot/grub/locale

2.3M /boot/grub/fonts

6.7M /boot/grub 36M /boot

df -h /boot

Filesystem Size Used Avail Use% Mounted on

/dev/sda3 361M 180M 159M 54% /boot

  • You could try to install it again. Kernels are available through apt-get. What's your version ? – Sergiy Kolodyazhnyy Dec 18 '15 at 4:06
  • ubuntu 14.04 LTS. When I type uname -r, I get 3.13.0-66-generic. I don't know what that actually means – nothing works Dec 18 '15 at 4:21
  • 2
    OK, 14.04 is trusty , so just run sudo apt-get install --reinstall linux-image-generic-lts-trusty. – Sergiy Kolodyazhnyy Dec 18 '15 at 4:26

Open the terminal and type:

sudo apt-get install --reinstall linux-image-generic  
sudo grub-install /dev/sdX
sudo update-grub

...where for

/dev/sdX
substitute the drive where your GRUB bootloader is installed. Normally users should not include a partition number, which would produce an error message as the command would attempt to write the information to a partition. You can find the Device name of this drive using the Disks application. Check twice in Disks to make sure that you type the correct Device name of the drive where your GRUB bootloader is installed.

Since it isn't done during execution of the sudo grub-install command, running sudo update-grub after the install will ensure that the GRUB menu is up-to-date.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.