SOLVED: GRUB loading error 22

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read this

SOLVED: GRUB loading error 22

Postby lanrun on Tue Aug 19, 2008 10:58 am

Hi

I have Mint Elyssa R1 main installed on my home PC, and everything have been working all fine for a couple of months.
Yesterday I tried to make a bootable USB memory stick for PUPPY Linux. I then tried to install a GRUB menu to the USB stick.
Then I shut down the PC.

Today the PC won't boot from my internal harddrive. During the boot process it stops with this:

GRUB loading, please wait...
Error 22

I must have messed up the GRUB during the process with PUPPY Linux....

Now I can boot from the USB stick with PUPPY Linux or from Live CD with Linux Mint. But how can I repair the GRUB?
Can anyone help?

Regards
Rune
Last edited by lanrun on Tue Aug 19, 2008 4:07 pm, edited 1 time in total.
lanrun
Level 3
Level 3
 
Posts: 158
Joined: Tue Oct 23, 2007 7:31 am
Location: Lillehammer - Norway

Linux Mint is funded by ads and donations.
 

Re: GRUB loading error 22

Postby cliff76 on Tue Aug 19, 2008 2:44 pm

I think you just need to reinstall GRUB. I haven't done this in a while so I'm a little rusty. From my Mepis days you could do this from the live disk and all would be well. I'm not sure if Mint has this option. The alternatives would be to use synaptic or apt-get from the cmd line. But then that assumes you are able to log into your Mint install... chicken and egg thing. The trick is to boot either USB puppy or Live disk Mint and use the chroot cmd to log into your Mint install. (Another hack would involve editing the /boot/grub/menu.list on the USB stick and add an entry that points to your Mint install. You might be able to pull this entry from the /boot/grub/menu.lst on your harddrive but I'm not going to go off on a tangent.) From the USB or Live disk mount the partition that holds your Mint install then:
chroot /path/to/mounted/drive
from there you should be able to run
apt-get install grub


Like I said, I haven't done this in a while so you might hit a snag or two. Instead I'll explain the nature of your problem. When you made the puppy USB stick you must have inadvertently installed the puppy boot loader (Grub) to your hard drive instead of/along with the USB stick. The boot loader points to your kernel and in your case its probably trying to point to the kernel installed on your USB. Anytime you install boot loaders for USB drives and the like its a good idea to backup your /boot/grub/menu.lst in case things go wrong. This is the file that tells GRUB where to find the kernel for any/each operating system installed. You can probably modify this file from a live disk assuming GRUB itself isn't messed up. Just open it as root and fix/restore the entries for your Mint install. You'll need to understand a bit about how your drive is partitioned to fix it up. generally you'll see entries like mine:
title Linux Mint 5 KDE CE, kernel 2.6.24.3-custom
root (hd0,4)
kernel /boot/vmlinuz-2.6.24.3-custom root=/dev/sda5 ro quiet splash
initrd /boot/initrd.img-2.6.24.3-custom

The title can be whatever you like indentifying an installed operating system. The root, (hd0,4) points to the zeroth (first) hard drive on my system and, I believe, the 5th (zero based) partition on this drive. The kernel points to the actual kernel and includes a root attribute that points to the physical device, /dev/sda5, using a different syntax. Here sda5 is the 5th partition on my first physical hard drive- sda. (If I had two hard drives I could specify a path off of sdb.) There's a cmd that'll spit out the locations of your partitions but I can't remember what it is. Once again I'm very rusty and I hope I'm not confusing more than helping.
cliff76
Level 1
Level 1
 
Posts: 19
Joined: Wed Feb 20, 2008 12:07 am

Re: GRUB loading error 22

Postby Guest on Tue Aug 19, 2008 3:35 pm

Just boot to your mint live CD and follow this course of action:-

Boot into the Mint live CD
open a terminal and run :
Code: Select all
sudo grub

This gets you to a simple grub command line.
Then:
Code: Select all
find /boot/grub/stage1

This will tell you where your /boot/grub/stage1 is which is needed to boot Mint. Replace the question marks in the following command with the output of the this last command :
Code: Select all
root (hd?,?)

[like : root (hdo,1) ,probably]
then:
Code: Select all
setup (hd0)

This is where your windows partition and MBR normally is, but if you want grub on another disk, use hd1, etc as appropriate. It's much easier to use the windows MBR and then just change the default boot system later if others in the family demand windows boots by default.
Then:
Code: Select all
quit

Finally reboot, and hopefully you will now have a working grub bootloader.

I hope this works for you as well as it has for me several times.
Guest
 

Re: GRUB loading error 22

Postby ajgreeny on Tue Aug 19, 2008 3:39 pm

For some reason my browser didn't log me in to the forum automatically, so this last post came up as a guest.
I hope it was of use to you and works properly. It is dead easy and has never let me down. Good luck!
ajgreeny
ajgreeny
Level 3
Level 3
 
Posts: 110
Joined: Mon Nov 19, 2007 3:27 pm

Re: GRUB loading error 22

Postby lanrun on Tue Aug 19, 2008 4:06 pm

Thanks to cliff76 and ajgreeny.

While you were writing answers to my post, I was searching the Internet and found this site:

http://microdotsagamedev.wordpress.com/ ... ub-loader/

I followed the instructions there, and it worked.

It is similar to what ajgreeny wrote. :D
lanrun
Level 3
Level 3
 
Posts: 158
Joined: Tue Oct 23, 2007 7:31 am
Location: Lillehammer - Norway


Return to Installation & Boot

Who is online

Users browsing this forum: No registered users and 16 guests