Grub Error 17
Note: If you enjoy this article, you might also check out the Geeky Stuff section.
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 trysudo fdisk -lto 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(orsudo 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 commandfdisk /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
mto get a command list if you need it. I would recommend issuing the commandpto list the partition table, so you can better see what you’re doing. - Now you can use the
tcommand 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
Lto 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
wto 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.
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