View Full Version : [ubuntu] GRUB error 22 need major help!

June 8th, 2008, 05:55 AM
When I try and boot up my laptop I get the following error message "Error 22". This happened probably because I went into my parition magic and erased a parition that held GRUB on it. The way I had it before was I was dual-booting XP and Ubuntu 8.04. Well I wanted to resize my ubuntu parition. It was broken down into three. There was my home parition 20gb, swap which was another 1GB and and the third which was 2GB and I believed had the GRUB loader on it. Well I was told in a previous thread that I didn't need this 2GB parition anymore. So i deleted it and expanded my home filesystem.

How do I fix this? Or am I totally screwed? I can't even use my laptop at this point. I am on a friends computer.

June 8th, 2008, 06:24 AM

June 8th, 2008, 06:33 AM
If you deleted all the partitions except home and swap, I think that means you deleted linux. IMHO, your looking at a re-install.

June 8th, 2008, 06:50 AM
Try this:

Boot from the Ubuntu LiveCD, open a terminal and type

sudo grub

and the grub prompt type:

find /boot/grub/menu.lst
("l" is a lower case "L")
the output should be


In the following I assume that it was (hd0,5). If it wasn't, replace all the (hd0,5)'s by the actual output.

At the grub prompt type:

root (hd0,5)
setup (hd0)

Reboot. The grub menu should appear.

Select Ubuntu. Press ``e'' instead of ``enter''. At the new screen press
``e'' again. Change

root (hd0,6)


root (hd0,5)

Press ``enter'' and then ``b'' to boot.

This should boot you into Ubuntu. Once you successfully booted into Ubuntu
you need to make these changes permanent. Open a terminal and type

cd /boot/grub
sudo cp menu.lst menu.lst.bu
gksudo gedit menu.lst

Look for the line

#groot (hd0,6)

and change it to

#groot (hd0,5)

Save the file. In the terminal type

sudo update-grub

Reboot and hope for the best.

June 8th, 2008, 04:07 PM
Well I am going to run system recovery CD recreate the deleted parition and see if that helps. If that doesn't I will boot from the Live CD. Anyone else have any ideas?

June 8th, 2008, 04:15 PM
Boot live cd and post output of
sudo fdisk -l That will give a read out of which partitions are still in tact. Things may not be as bad as you imagine - time will tell.

June 8th, 2008, 04:30 PM
I will try that after I run this system rescure CD. Do you believe if I re create the deleted parition that will fix it? What I did was delete the parition that contained GRUB. It was a 2gb ex3 parition. So what I am doing is creating it again through Gparted using the system rescue.

June 8th, 2008, 04:39 PM
Ok, now it gives me Error 15....Ideas?

June 8th, 2008, 04:42 PM
This may help;
sudo fdsik -l (that's a lower case L) via the live cd. Please post result.

June 8th, 2008, 04:48 PM
ok i don't have a Live CD, so I am creating one now. Will post results.

June 8th, 2008, 04:53 PM
This may help; (that's a lower case L) via the live cd. Please post result.

Question. What does that do exactly? I am curious for future reference.

June 8th, 2008, 05:52 PM
Thank you all! I got it working again!