Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am currently dual-booting Ubuntu 10.04 and Windows 7 with grub 1.98 as the bootloader.

I recently decided to edit the grub menu to remove the old Ubuntu kernels, so I followed the instructions of this guide and added the line list='version_find_latest $list' to the 10_linux file, then ran sudo update-grub. Apparently I made a mistake, because upon restart I had these bootloader entries:

Ubuntu, with Linux $list
Ubuntu, with Linux $list (recovery mode) 
Ubuntu, with Linux version_find_latest
Ubuntu, with Linux version_find_latest (recovery mode)

When I try to load any of these, I now get a grub error:

error: not a regular file

Now I can't start any version of Ubuntu to remove the line I added. What's the best course of action to be able to use Ubuntu again? Thanks.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

As with any Grub error, there are really two choices:

  1. Boot into some version of Linux from some other device that has a working bootloader/boot menu. The easiest is probably a LiveCD or LiveUSB if you have one.

    Once booted into the other Linux system, you can repair your Grub installation. This can entail chrooting into your broken installation, fixing your Grub scripts, and running Grub commands (update-grub or similar), or simply editing your broken installation's grub.cfg file directly. (Remember any edits to grub.cfg will be overwritten the next time update-grub is run.)

  2. If you can get to the Grub menu, even if it's broken, you can try editing the boot entries or using the commandline to boot. This is a bit more complicated, but if you know what the boot entries should look like, you can attempt to edit them to remove whatever's preventing them from booting.

    Press E on a boot menu entry to see and edit the list of commands in that entry. It's possible the mistake will be obvious; just fix it, Esc back to the menu, and press Enter to try it. Your edits will not be permanent, so if you do manage to fix it and boot your system, be sure to make the fix permanent by repairing your Grub scripts and generating a new grub.cfg.

I generally attempt option 2, and keep option 1 as a last resort. But I've done this enough that I'm fairly comfortable with both. If you're fairly new to Grub, the LiveCD option is probably the easier way to go.

share|improve this answer
    
Thanks for the help, using chroot worked. My mistake was confusing the symbol ` for '. –  Justin Ardini Jun 17 '10 at 23:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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