Grub Error 17

Note: if this tutorial doesn’t help you, possibly because fdisk reports your known Linux partition correctly as Linux, you might also try my Grub Error 13 with Grub Error 17 tutorial.

I just had an interesting time with trying to boot into Linux on my PC. Last night, I noticed my /boot/grub/menu.lst file had gotten overwritten when I performed some Ubuntu updates. This meant I had to add in configuration to allow Windows to boot, and since I didn’t have a backup of my old, working configuration (mistake number 1) I looked online. I found something that worked and ignored the use of Grub’s ‘hide’ and ‘unhide’ commands (mistake number 2) that were in the configuration. I rebooted and successfully got into Windows.

When I tried to boot Windows tonight, it wouldn’t work. In fact, the Grub boot menu wouldn’t even come up, so I couldn’t get into Linux either. It just said ‘Error 17′ and sat there. After digging around online, I found a message in some forum archives that explained the problem, and I’m repeating it here because it’s kind of obscure and this might help someone else in the future: do not use Grub’s ‘hide’ command on Linux partitions, because it sets their filesystem type to ‘93′ instead of ‘83′. ‘93′ = the Amoeba operating system, ‘83′ = Linux. Thus when you try to boot Linux, or when Grub is on your Linux partition and thus is trying to read from a Linux partition, Grub thinks it’s working with Amoeba and thus fails out because it’s actually Linux.

How to fix this:

  • Using a live CD (I recommend Damn Small Linux because it’s great for quick fixes), you can edit your Linux partition. Download the live CD image (hopefully you have access to another computer with a disc burner) and burn it.
  • Boot your messed-up computer with the live CD and open a terminal when it’s booted.
  • You need to know which partition is your Linux partition. In the terminal, do the command fdisk -l. If that doesn’t work, you might try sudo fdisk -l to act as the root superuser in order to use the Fdisk tool. You’re looking for, haha, a partition that claims to be ‘Amoeba’. You want the information that looks like ‘/dev/hda1′.
  • Once you know where the lying partition is, do fdisk /dev/hda (or sudo fdisk /dev/hda) if your Linux was on /dev/hda1. You need to leave off the number at the end, so if your Linux was on /dev/hdb2, you would issue the command fdisk /dev/hdb. This will allow you to work with that drive.
  • All we need to do is change the partition’s type from 93 to 83 so that it knows it’s Linux again. Fdisk’s commands are all one character long. You can use m to get a command list if you need it. I would recommend issuing the command p to list the partition table, so you can better see what you’re doing.
  • Now you can use the t command to tell Fdisk you want to adjust the type of one of the partitions. It will ask you which partition you want to edit, and you should give it a number. My Linux partition is /dev/hda1, so I entered 1.
  • Now Fdisk will ask for a hex code. Here is where you need to enter 83 to represent a Linux device. If you’re unsure about this, you can type L to list all the operating system types it recognizes and their codes.
  • Once you’ve entered the hex type number, you’ll be returned to Fdisk’s command prompt. You should issue the command w to write the partition table and exit.

That’s it! That should tell the Linux partition that it is indeed Linux and not Amoeba, so next time you reboot, things should work.

This entry was posted in Linux and tagged , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

20 Comments

  1. Posted 25 October 2007 at 11:21 PM | Permalink

    I was recently thinking of upgrading Ubuntu and since I always run into every strange problem that I could run into when messing with my computer, I’m going to keep this article in mind :D

  2. Posted 26 October 2007 at 12:11 AM | Permalink

    I had bit similar kind of problems with Mandriva and Ubuntu. I have to keep this in my mind for the future :).

  3. grouch
    Posted 28 October 2007 at 10:24 AM | Permalink

    I would be interested in details about how your “/boot/grub/menu.lst file had gotten overwritten”. A Debian-based system should upgrade gracefully and make no configuration changes without your informed participation.

    (I don’t use GRUB, but wouldn’t tolerate a system upgrade that trashed my lilo.conf).

  4. Erika the Vegan Geek
    Posted 19 January 2008 at 6:12 PM | Permalink

    Thank you so much for posting this.
    It saved my computer.
    I thought for sure I was forever cursed to boot Windows only, and only from the Super Grub CD. (Trust me, a Windows-only machine booting from a CD is not a fun thing to have.)

    I was stuck with error 17 for three or four days, and I tried absolutely everything to get it fixed.
    Your fix worked for me.
    Thank you so much for posting it. I never would’ve found a way to fix Grub without it.

  5. Drew
    Posted 30 March 2008 at 6:14 PM | Permalink

    The Grub menu settings get upgraded whenever you upgrade your kernel (on debian). I’m not sure about any non-debian derivatives but i would expect it to act the same. What this means is that any settings in the “Auto-Magic Kernel List” get rewritten with what grub thinks should be there. If you don’t want any settings that you added manually to be rewritten, you should put them outside of the blocks denoting this section.

  6. drini
    Posted 31 March 2008 at 10:07 AM | Permalink

    i followed your advice but at the time when i try to rewrite the table i get error 16 and i says that the writting will be done on the next restart wich never happens
    any advice ???
    thanks in advance

  7. Posted 31 March 2008 at 7:40 PM | Permalink

    Drini: Hm… I would try doing a search online for ‘grub error 16′ because I’m unfamiliar with it. I would think it’s no longer a case of a Linux partition being recognized incorrectly as some other format (if it were, I think Grub would still give error 17), but I don’t know what error 16 represents.

  8. Aldo
    Posted 19 May 2008 at 1:57 AM | Permalink

    Amazing! Finally I can boot again =) .
    I’ve been wondering where this amoeba thing came from.

    Great Stuff. Thanksx1000

  9. LilyAyanami
    Posted 8 June 2008 at 12:23 AM | Permalink

    I had installed Winders recently onto my Linux system and was trying to set up Grub for dual-boot before ending up with this problem. This totally fixed my problem. Thank you!

  10. stephen
    Posted 27 June 2008 at 1:54 AM | Permalink

    When I boot to Linux (single boot drive, so that’s my only option), I get GRUB error 17. However, I followed these instructions and opened the device table, but the boot device was marked as 83 before I modified anything. So it recognized itself as Linux, but it kept giving me Error 17.

    Any ideas?

  11. ingis
    Posted 20 September 2008 at 3:51 PM | Permalink

    I found some bad news about it in: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/203537
    I got this error after trying to suspend computer.

  12. destino
    Posted 15 October 2008 at 12:28 PM | Permalink

    Thanks! Worked perfectly!

  13. Posted 5 November 2008 at 9:58 AM | Permalink

    Thanks Worked great. I used hide on a linux partition trying to dual boot. Now am ok.

  14. Paul
    Posted 17 December 2008 at 8:06 PM | Permalink

    Thank you so much! This tip saved my computer… I’ll never mess with the
    ‘hide’ option in Grub again.

    Now if only I could get Windows to stop trying to format my Ubuntu partition…

  15. blokeley
    Posted 2 February 2009 at 5:52 PM | Permalink

    My eee 1000 had ubuntu-eee installed did an auto-update then went into sleep mode because I left it. I couldn’t wake it so had to kill the power. After that I got grub error 17.

    Your instructions helped me fix it. My /dev/sda was corrupted and showing 2 partitions. I deleted /dev/sda2 and changed the type of /dev/sda1 to Linux (83). It then booted fine. Thank you so much. You saved my bricked machine!

  16. Posted 14 February 2009 at 4:17 PM | Permalink

    Thank you – thank you – thank you! :)
    This did it for me!

  17. Dana
    Posted 8 April 2009 at 11:31 PM | Permalink

    Thank you for taking the time to post this info. It was extremely helpful! It worked!

  18. Anuj
    Posted 13 June 2009 at 7:27 AM | Permalink

    when i type t command …it shows
    No partition is defined yet!
    what shall i do now??

  19. KAREN WEATHERS
    Posted 7 July 2009 at 9:59 AM | Permalink

    Here’s a good one. Loaded Linux Kubuntu last night on a seperate hard drive. But had 2 others hooked up. 1 had vista swagate 1.5 TB, 2 had WINXP WestDigi 80 gig, 3 Kubuntu IBM 16 gig. Now I did a full install to the IBM of Kubuntu. Not even near the Seafate HDD and i have the GRUB error 17 thing on the seagate HDD with Vista loaded. Now I can not get into
    Vista. So tell me, how do I fix !THAT! why don’t ya…. I am going to try and make a boot disk for Vista from WINXP drive via the back door and see if that works. But if anyone has any ideas PALeeeease HEEELP!!

  20. Mitch
    Posted 8 August 2009 at 1:50 AM | Permalink

    Thanks. This is exactly what I needed.

One Trackback

  1. By Muthii’s blog » Blog Archive » Grub Error 17 on 5 November 2008 at 10:25 AM

    [...] grub started loading then stopped giving me the Error 17. I was able to resolve it after checking this site [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>