0

Is it at all possible for me to add a menu entry in this version of GRUB2? All solutions that I have been able to find online involve editing 40_custom, but gedit, vim, etc are all legacy GRUB commands and aren't found.

I looked through the documentation to no avail: http://www.gnu.org/software/grub/manual/grub.html#Command_002dline-and-menu-entry-commands

Problem:

  • my Ubuntu partition isn't showing in the menu options even though I can see the partition it using ls in the grub shell and ls -lh tells me it's a filesystem
  • I would really like to be able to access my Ubuntu again.
6
  • 1
    You can add entries, but if not booting then you probably have other issues. Post link that this gives: help.ubuntu.com/community/Boot-Info
    – oldfred
    Jul 16, 2015 at 18:46
  • Hi oldfred, I can't add entries right now because I can't edit 40_custom because the commands to edit aren't supported in gnu grub2. Is there another way to do this? Jul 16, 2015 at 18:50
  • YES! Visit help.ubuntu.com/community/Boot-Info. You will need an Ubuntu DVD or USB ready to boot from. Follow its instructions, and give us the URL you will be told to give when you have finished. Jul 16, 2015 at 19:02
  • Thanks for your patience guys...I misread the article initially. Here is the pastebin URL: paste.ubuntu.com/11889706 Jul 16, 2015 at 20:37
  • The answer below should work, but if you run the full uninstall & reinstall of grub with Boot-Repair, it should also add the newest kernel.
    – oldfred
    Jul 16, 2015 at 23:02

1 Answer 1

0

There are no menu items for Ubuntu because all copies of the Linux kernel have been deleted from /boot. You can reinstall the kernel as follows:

Boot your computer from an Ubuntu DVD or live-USB, then choose "Try Ubuntu". Once in the Ubuntu session, connect to the internet, open a terminal (Ctrl+Alt+T) and start from step 1 of the instructions at https://askubuntu.com/a/28100/425479.

Note that for step 2 the exact command in your case is:

sudo mount /dev/sda5 /mnt

For step 5, if you have problems with internet only during this step, open a different terminal and type in it:

sudo cp /mnt/etc/hosts /mnt/etc/hosts.old
sudo cp /etc/hosts /mnt/etc/hosts
sudo cp /etc/resolv.conf /mnt/etc/resolv.conf
exit

then try again.

By the start of step 7, Ubuntu will have been added to the Grub menu again, ready for the reboot.

5
  • Martin, thank you for your answer with annotations. I am stuck on stage 5 because there are missing dependencies: linux-image-3.13.0.57-generic. Do you have any ideas? I've read the other solutions in the post you linked, but no mention of missing dependencies. Jul 16, 2015 at 23:07
  • Also, I am unable to access the internet through chroot. Internet is working through browser...I am running Internet through a proxy if that makes a difference. Jul 16, 2015 at 23:16
  • Give boot-repair a shot. The proxy is complicating things. The missing dependencies error was because of your internet problems, so the dependencies couldn't be installed before linux-image-generic. Jul 16, 2015 at 23:38
  • Thanks Martin...I tried boot-repair soon after realizing this was most likely the case. Boot repair was having issues that kept causing it to crash so I am now attempting to install another Ubuntu over my original partition without formatting. Hopefully this will fix the kernel...if not I will try boot-repair again. Jul 16, 2015 at 23:51
  • Installing Ubuntu via setting the old Ubuntu partition to the root directory and not formatting gave me everything on my desktop sans programs. Proxies are still set up. Just for future reference if anyone else does the same... Jul 17, 2015 at 0:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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