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 looked like it would work, even though it had Grub’s hide and unhide commands in the configuration–mistake number 2. 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. So when you try to boot Linux, or when Grub is on your Linux partition and thus you’re 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:

  1. Using a live CD (I recommend Damn Small Linux because it’s great for quick fixes), you can edit your Linux partition. Hopefully you have access to another computer with a disc burner that you can use to download the live CD image and burn it.

  2. Boot your messed-up computer with the live CD. Open a terminal.

  3. 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 a lying partition that claims to be Amoeba. You want the information that looks like /dev/hda1.

  4. Once you know where the 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.

  5. All we need to do is change the partition’s type from 93 to 83 so that Grub knows it’s Linux. 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.

  6. 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.

  7. 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.

  8. 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 Grub that your Linux partition is indeed Linux and not Amoeba, so the next time you reboot things should work.