LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices

Reply
 
Search this Thread
Old 08-07-2007, 12:40 PM   #1
mojorising73
LQ Newbie
 
Registered: Aug 2007
Location: United States, Austin, TX
Distribution: Ubuntu 7.04
Posts: 3

Rep: Reputation: 0
Unhappy Help me please! GRUB Error 21


Hi Everyone. I know you've heard this problem before and somewhere in these forums lies the answer but I have yet to run across it. Please keep in mind that I'm a Linux newbie and have no idea of what I'm doing. So forgive my ignorance. Ok, this is how it all started. I have two hard drives on my computer. At the time, my primary was Win Xp and my secondary the same. I installed Ubuntu sucsessfully on my second and I could switch easily from one to the other when I start up my computer by going into the bios and switching drives. Then my Ubuntu drive was having sound issues and istead of spending more time finding a solution, I reinstalled it. That's where it went all downhill. Long story short, I had to format both drives. I finally got Win XP back on one drive. Unplugged that one and reinstalled Ubuntu on the other. Now, I get something about GRUB loading...Error 21. I don't know what happened but I've been having a tough time with it for a few weeks now. I've tried looking at forums, manuals, I even downloaded Super GRUB onto a disk and nothing has helped. You know I'm sure Linux/Ubuntu is great but I can't experience it because of this problem. Please, if anyone can help me please do. Give me step by step instructions on where to start, what info you may need from me and how do I get that info because I'm clueless at this point. Thank you.

Last edited by mojorising73; 08-07-2007 at 12:48 PM.
 
Old 08-07-2007, 01:15 PM   #2
masinick
Member
 
Registered: Apr 2002
Location: Concord, NH
Distribution: Debian, sidux, antiX, SimplyMEPIS, Kubuntu, Mandriva, Fedora, Xandros, Arch, and many others
Posts: 560
Blog Entries: 14

Rep: Reputation: 35
Please provide more information

Error 21 means "Can not find disk". Chances are you are pointing to the incorrect location with your GRUB menu entries. Please post the contents of /boot/grub/menu.lst and tell us where each OS is located, and we can help you more.
 
Old 08-07-2007, 01:23 PM   #3
b0uncer
Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Step by step instructions are surely in some (probably several) threads here, just search well. Error 21 is already becoming famous among newbies. It could be at the GRUB website too.

While I haven't had this, I'm fairly sure it's got its roots in the harddisk layout. GRUB installs part of itself in the MBR (or beginning of partition, it depends how you make it) that BIOS searches for, but it's configuration files and the rest in your /boot partition. If you happen to remove /boot but MBR stays as it is, GRUB can't find it's configuration from the disk and so on. Another problem is how GRUB knows what physical drive is called what, as switching harddisks may cause BIOS to "map" the drives in a different way than GRUB thinks, causing GRUB to look for the configurations in the wrong disk. This sounds very unclear, but if you just take the time to search for the older "error 21" threads, it should enlighten. You could either re-install or re-configure your GRUB. I don't encourage having two drives and taking either one out at times, better to either have both in at the same time and not plug them in and out, or then have only one disk at a time connected, to make sure the disk order is same for BIOS and GRUB. And avoid overwriting either /boot or MBR/partition beginning when doing reinstalls.
 
Old 08-07-2007, 02:46 PM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
When installing Ubuntu, can you recall what options you selected for installing the bootloader (GRUB)?
GRUB has to be installed in such a way that it can find the /boot directory with its files. This gets "hard-coded" into the GRUB code that goes into the MBR.

Take a look also at the link below on booting.
 
Old 08-07-2007, 02:52 PM   #5
stumpedguy_frustrate
Member
 
Registered: Mar 2007
Posts: 41

Rep: Reputation: 15
what happened was, when you unplugged the WinXP drive, you made the Ubuntu drive the first drive. So now, GRUB is looking for files on the XP drive (now that I assume it is plugged back in) and it can't find any files. You need to boot the Ubuntu disk again and you need to change the location of where GRUB should be looking for the files.
 
Old 08-07-2007, 03:02 PM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Quote:
Originally Posted by stumpedguy_frustrate
.....and you need to change the location of where GRUB should be looking for the files.
Which you must do by re-installing GRUB......
 
Old 08-09-2007, 02:13 PM   #7
mojorising73
LQ Newbie
 
Registered: Aug 2007
Location: United States, Austin, TX
Distribution: Ubuntu 7.04
Posts: 3

Original Poster
Rep: Reputation: 0
suggestions

Thank you for writing some suggestions. The only problem is that I don't know how to do some of them. I don't know how to get the contents of /boot/grub/menu.lst. I would like to reinstall grub but how do I get into it? Do I load up the Live CD and then try to install it through the terminal? Becaue everytime I restart my computer I get that Grub error? Should I run it with my Ubuntu disk in? Please let me know if you'd like to just email me directly for some ideas to get this cleared up. Thank you.

--johnny
 
Old 08-09-2007, 02:22 PM   #8
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Running from the Live CD, you can run all the same commands that you would from the installed version.

When someone asks for the content of a file, you can get that with any text editor--or in a terminal.

to re-install grub, you need to know the partition where the /boot directory is. This can be verified by mounting a partition and looking at the contents---but if you simply do "fdisk -l", the answer may be obvious.

Suppose you have one IDE drive (/dev/hda) and /boot is on the first partition (/dev/hda1). The commands to install GRUB are:
grub (opens the grub shell)
root (hd0,0) points grub at the partition containing /boot---grub counts from zero)
setup (hd0) puts grub in the MBR of hda
 
Old 08-12-2007, 01:45 PM   #9
mojorising73
LQ Newbie
 
Registered: Aug 2007
Location: United States, Austin, TX
Distribution: Ubuntu 7.04
Posts: 3

Original Poster
Rep: Reputation: 0
Smile I got Ubuntu running

I got it working! I don't know how I did it. I'm just glad it's working. Here's what I did. I was going to have a friend take a look at it because he's experienced in Linux stuff so I thought I'd start from scratch by reinstalling Win Xp on my drive. So, I put in my Win XP disk in and it bypasses my GRUB error but my Unbuntu screen loading bar wasn't moving at all . I ctrl-alt-del to start again and I noticed right after GRUB loading it said press ESC for menu. I did and saw a menu for Ubuntu and Ubuntu recovery mode. I choose that and let it run until I got the prompt again. I rebooted and then choose the regular Ubuntu and low and behold, it started. No live CD, no GRUB error 21. I was shocked. I don't know if I can load without my Win XP disk now, or if anything will go wrong if I plug in my Windows drive but I am happy for now. Thanks everyone for their ideas on fixing my problem that started all because of me. If I ever run into anything like it again (I'm sure it will be soon, lol), I'll post again. Thanks.

Last edited by mojorising73; 08-12-2007 at 01:48 PM. Reason: spelling errors
 
  


Reply

Tags
error, grub, ubuntu704


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Grub error 17, and wont reinstall using grub-install! chiefreborn Linux - General 6 06-06-2007 10:29 AM
Error Grub stage2 loading error (using FC6) on seperate hdd Anifield Linux - Newbie 7 03-20-2007 01:14 PM
GRUB Error 26: Disk Read Error (using grub4dos and ubuntu) Dark_Master Linux - Newbie 2 11-07-2006 11:58 AM
Grub Error 17: Cannot mount selected partition and other Grub problems Sebastian Naitsabes Linux - General 1 07-05-2005 08:33 AM


All times are GMT -5. The time now is 11:10 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration