Grub - Error 21 returned

Bug #8978 reported by Sébastien Pellé
60
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

Hello,

After installing Ubuntu on a clean disk, GRUB returns the following error on
startup :
"
Grub Loading stage 1.5.
Error 21
"
Error 21 means :
"
21 : Selected disk does not exist
    This error is returned if the device part of a device- or full file name
refers to a disk or BIOS device that is not present or not recognized by the
BIOS in the system.
"

My motherboard is a ABIT KR7A-RAID with a Highpoint hpt372 controller for RAID
(This motherboard has two normal IDE and two IDE for RAID).
This error is returned when my HDD in plugged on a "RAID" IDE. (By the way, I
don't use RAID, it's a single disk).
Ubuntu installation works if I plug my HDD on a normal IDE.

I encounter no problem when I install Fedora Core 2 with my HDD plugged on a
"RAID" IDE (and with GRUB) (so I don't think it's a BIOS problem).

Thanks

Revision history for this message
Joshua Bergland (josh-mrj412) wrote :

I would like to add that I recieved the exact same error when I tried to use
Ubuntu on my system. It is a Soyo KT400 Dragon Ultra motherboard also with a
Highpoint 372 IDE raid controller. I also have only a single drive plugged into
the controller and this is the first time I have seen an Error 21 from Grub. I
have run various other distros including Fedora and Gentoo without issue. This
is also the only hard drive in the system.

Revision history for this message
Christoph Bier (christoph-bier) wrote :

(In reply to comment #0)

[...]

I get the same error and a similar message

GRUB loading, please wait ...
Error 21

when I use the live-CD on my laptop (IPC Power Note M 8375 aka Mitac 8375); the
same CD boots on a desktop pc successfully. Other live-CDs boot from the same
laptop successfully, as well as Debian Woody/Sarge from HDD.

Regards!

Revision history for this message
Chris Cheney (ccheney) wrote :

I know what the problem is with the HPT370/372 case. The controller writes to the boot drive in the area of
the disk (first cylinder?) and grub also wants to write to the first 16 sectors. From what I read in a post on
the grub mailing list it seems like the location might vary, possibly depending on the controller bios version
being used. I don't remember the exact details of the location of the bytes on my system, I can post that in a
follow up email if needed. Basically to work around the problem you need to take the grub modified stage1_5
(before its corrupted) and write it past where the bios writes to the disk. Then run the grub install command
telling it where the stage1_5 is located on disk. You can alternately install stage1 to a floppy which seems
to solve the problem as well.

As far as the problem with the laptop is concerned I have no idea. It would probably be a good idea to try
installing grub and then dumping the sectors, after a reboot, to compare to see if the bios writes in the same
area as well.

Here is the post that I read that explained how to fix the problem:

http://lists.gnu.org/archive/html/bug-grub/2004-07/msg00113.html

This post explains how to use a floppy for stage1:

http://lists.gnu.org/archive/html/bug-grub/2003-04/msg00026.html

Revision history for this message
Chris Cheney (ccheney) wrote :

Interesting after rereading the initial bug report he said it works fine with Fedora Core 2. Perhaps they have
a patch for grub to work around this issue? The manual fix is definitely not user friendly. :(

Revision history for this message
mp (m-p) wrote :

(In reply to comment #4)
> Interesting after rereading the initial bug report he said it works fine with
Fedora Core 2. Perhaps they have
> a patch for grub to work around this issue? The manual fix is definitely not
user friendly. :(
>

Yes, same here: I have used HPT370 since RH8 w/o problems. In RH7.3 you had to
compile driver from source, but it booted just fine with LILO back then.

-------------------------BUT: In order to be able to enjoy Ubuntu I did the
following:

Plugged two HDDs, both as Master (Primary + Secondary), into the HPT Controller
(IDE3+4 or in Grub terms (hd0,x)+(hd1,y)) and then installed Ubuntu on (hd1,y),
but the bootloader on (hd0,0).

When Ubuntu half way through installation rebooted, I stuck in a Fedora CD and
installed Core 1 on (hd0,x), overwriting the Ubuntu instance of Grub. Then
finished the FC1 install and now I am looking at the internet update of Ubuntu
downloading; i.e, Ubuntu booted just fine from the FC1 Grub entry that i had
manually added.

FC1 did not detect the Ubuntu install, probably because it is only half done?,
but I could mount the /boot partition of the partly installed Ubuntu and copy
the exaxt entries for kernel/initrd, which I added to FC1's /etc/grub.conf. This
procedure is somewhat analogous to a dual boot setup with Winblo$e & GNU/Linux:
overwrite the useless bootloader with one that you know works.

This is obviously not much of an accomplishment, but it shows a way to get
Ubuntu running on the HPT370. Well, it is not actually running yet, but
considering that it booted and is downloading security updates as I type, I
reckon that it will run just fine....

I know very little about these things, but something tells me that in the
Fedora/RedHat grub.rpm there is something useful hiding that Ubuntu should get
their hands on.

mp
_
http://wiki.aktivix.org

Revision history for this message
h batista (hrbatista) wrote :

I have successfully installed Ubuntu on my SCSI hard drive, which my bios does
not appear to recognize. But the Ubuntu installer does recognize it and partitions.

When it is time to reboot, the system hangs after the following message:

Loading Stage 1.5
GRUB Loading
error 21

Revision history for this message
Chris Cheney (ccheney) wrote :

I got an email about this issue tonight from someone who found my post, so
apparently people are still being affected by this issue. Apparently fedora and
gentoo works for the user though. Too bad I don't have a HPT controller in my
current system to verify it.

Revision history for this message
Bruce Bales (bbales) wrote :

Created an attachment (id=3689)
grub - error 21 returned

After a slick installation on hdd, I rebooted and got "grub loading, error 21"
A check with knoppix fdisk shows an asterisk and windows XP on hda2. The
asterisk means boot is here. I assume that ubuntu set grub to boot from a boot
sector on hda1. fdisk shows hda1 is a small (40MB) partition labeled "dell
utility."

I still want to keep windows for occasional use.

Is my assumption right that kubuntu installs grub to boot from hda1?

Can this be fixed with setup?
bruce

Revision history for this message
Bruce Bales (bbales) wrote :

Should have tried this earlier. Went into setup and found hdd was marked "OFF."
Changed OFF to AUTO and got a good grub screen and then got Kubutu.

Revision history for this message
Kevin Cantu (kevincantu-deactivatedaccount) wrote :

Abit KT7A motherboard. Ubuntu 5.10. Windows 2000 was hda, Ubuntu was installed to hdb with no errors. On boot up, things hung at the infamous Error 21.
<pre><samp>
GRUB loading, please wait...
Error 21
</samp></pre>

After finding this and <a href="http://ubuntuforums.org/showpost.php?p=9327&postcount=6">other posts</a> I tried first switching the drive positions and re-installing. That allowed me to have GRUB and Ubuntu installed on hda and I could boot up into Ubuntu - but the Windows drive, hdb, still wouldn't boot from GRUB and still gave Error 21. If I understand correctly, the Master Boot Record on the Windows drive of mine was messed up. (I thought about trying something from the XP install/recovery CD with <code>fixmbr</code> or <code>fixboot</code>.)

Finally, on a hunch - somebody's comment someplace - I changed the second drive from <code>auto-detect</code> type to <code>manual</code> and <code>LBA</code> and then both operating systems could boot from GRUB without errors.

Revision history for this message
Carthik Sharma (carthik) wrote :

Changing to Confirmed.

Has this issue been fixed since?

Thank you for reporting this, and for the comments.

Changed in grub:
status: Unconfirmed → Confirmed
Revision history for this message
Foffa (fredrik-and) wrote :

Came accross same problem on a Dell 2950 with Perc RAID controller.

Have done a number of tests and I am unable to get Ubuntu Dapper to boot from discs on the RAID-controller on this machine.

Revision history for this message
Robert Citek (robert-citek) wrote :

Foffa,

I've posted notes on how we were able to get Ubuntu 6.06.1 LTS AMD64 server installed on a Dell PowerEdge 2950:

http://www.ubuntuforums.org/showpost.php?p=1575949&postcount=20

The reason is that grub installs into the first physical device (/dev/sda) instead of the first logical device (/dev/sdc).

Regards,
- Robert

Revision history for this message
HardWired (hardwired-hardwiredonline) wrote :

I have a cheeky little fix for the grub Error 21 problem.

I was trying to install Ubuntu on my Dell Inspiron 3500 as I herd it had better wireless support. When I ran into the same problem. Since Ubuntu's Grub is a bit rubbish use another version instead!

The fix is, boot your laptop with a recuse cd , I this case I used one I had for fedora core 5 (I did try knoppix but that wouldn't work). When you boot up let it mount the drive, once your at prompt, type grub , then setup as normal. This takes account that you have /boot.. setup and you grub.conf/menu.1st setup. (go here to find that out - https://help.ubuntu.com/community/Installation/FromKnoppix) ie ->

grub> root (hd0,0)
-> or what every disk you want to install grub on.
then

grub> setup (hd0)

then "quit" grub and reboot.

I did say it was a cheeky fix, but it works!
Job done!

Colin Watson (cjwatson)
Changed in grub:
assignee: kamion → nobody
Revision history for this message
dadam (dannyjunkster-deactivatedaccount) wrote : Re: Grub - Error 22 returned

I can see all got a error 21.. but i got a error 22??.. i can't see the problem..
When Ubuntu is nearly finish with the install.. then it pops up with something like "Grub -- Fatal error"..
I use Ubuntu 7.04..
what can i do?

Revision history for this message
alexnb185 (alexnbryan) wrote :

Hey My problem is a little more complicated, i get the same error, because i tried to install Ubuntu on an external drive that was hooked up on a separate partition, however that was a bust, but anyway now I get error 21 and the hard disk is set to boot in the bios(this is a laptop btw a compaq presario an old one i might add) but anyway I really really need to figure this out, how can I fix this without losing my windows data? and would reinstalling windows work? PLEASE HELP

email me if you know anything
AlexnBryan[at]gmail[dot][com]

Revision history for this message
alexnb185 (alexnbryan) wrote :

hey guys I found a fix, if you get this Super grub thing ( http://supergrub.forjamari.linex.org/?section=home ) and then you burn a .iso of the software, then go to english > windows > boot to windows then you can log on. However the fix the windows option didn't work for me, so ya, this worked :-)

Revision history for this message
Lloyd (lwcary-deactivatedaccount) wrote :

I have successfully installed Ubuntu on an external hard drive, but when I rebooted, I get the following message:
   Loading Stage 1.5
   GRUB Loading...
   error 21

I'm stuck! Now I cannot even boot into my windows XP! Need help;! (I am new to Linux.)

Lloyd ^o^

Revision history for this message
alexnb185 (alexnbryan) wrote : Re: [Bug 8978] Re: Grub - Error 21 returned

ok, now I just fixed this problem 2 days ago, only with an old windows 200
laptop, however it should have the same outcome. Okay, there is this
software called SuperGrub and you ill give you the link, but you need to
download the .iso which I assume you have a .iso burner because u most
likely burned Ubuntu (If not just Google .iso disc image burner and find
one, i use infarecorder) anyway, boot form the cd ( make sure your bios is
set to boot from cd) and then you will come to a screen choose english >
windows > (you might have to hit enter a few times, read the page) then
select boot to windows. Now if this boots windows you're in good shape. So
if it is shutdown and reboot, then this next time instead of selecting boot
windows, choose fix windows, and you can probably figure it out form there I
forgot the menus but eventually u will see a screen that has your HDD
listed. Go to the actual drive, it has something like hd0 or something hit
enter on that and you should be good to go, if yopu have any other questions
I would be happy to help.

Link to SuperGrub: http://supergrub.forjamari.linex.org/
On 6/20/07, Lloyd <email address hidden> wrote:
>
>
> I have successfully installed Ubuntu on an external hard drive, but when I
> rebooted, I get the following message:
> Loading Stage 1.5
> GRUB Loading...
> error 21
>
> I'm stuck! Now I cannot even boot into my windows XP! Need help;! (I
> am new to Linux.)
>
> Lloyd ^o^
>
> --
> Grub - Error 21 returned
> https://bugs.launchpad.net/bugs/8978
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
Kevin Pijpers (kevin-pijpers) wrote :

I can confirm the bug; clean install on single HDD, ECS P965T-A mboard with dual core, only ubuntu returns error 21.

Got RAID disabled in BIOS, to no avail. I want to note that this MIGHT have something to do with my JMicron controller, which offers plenty of bugs as well.

I would love to see this fixed.

Thanks in advance

Revision history for this message
alexnb185 (alexnbryan) wrote :

while I do not have a dual core because I was using a pretty old laptop,
2002 I think, I did find a fix for it that might work for you. It depends,
while this will let you boot back into windows as normal I have no clue
about linux (I tried to put it on an external and after it screwed up, was
not going to do that again) well anyway there is a live cd called Super
Grub, and what it does is it repairs your boot settings and the code that
lets you boot into windows. The first time I tried it it didn't' repair the
code, but it would however let me into windows, so thats not back right you
can use a live cd and get in. When I went back a second time it worked and
now my windows is back to normal. what you do to repair windows on the cd is
select this (you will have to hit enter a few times before you can get to
all these screens ( just read what is on the screen you'll figure it out))
English>Windows>fix windows>then maybe another screen but just keep going
and eventually you will come to a screen that has 3 options, one at the top
I think says back, the next is something about your drive, then choose the
last, (one have 3 if you have one HDD, if you have 2 then you will have four
options) it should say something like hd0 and hit enter on that one, but if
you have more than one internal HDD choose the HDD windows is installed on.
if you have questions about this email me back, might be hard to understand,
just because I have done it... the link for Super Grub is at the bottom.

On 6/26/07, Kevin Pijpers <email address hidden> wrote:
>
> I can confirm the bug; clean install on single HDD, ECS P965T-A mboard
> with dual core, only ubuntu returns error 21.
>
> Got RAID disabled in BIOS, to no avail. I want to note that this MIGHT
> have something to do with my JMicron controller, which offers plenty of
> bugs as well.
>
> I would love to see this fixed.
>
> Thanks in advance
>
> --
> Grub - Error 21 returned
> https://bugs.launchpad.net/bugs/8978
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
Kevin Pijpers (kevin-pijpers) wrote :

I'm sorry alexnb185, but I'm not looking for supergrub, I'm looking for a fix for this bug.

Does anyone have any information or is this project dead?

Thanks,

Revision history for this message
alexnb185 (alexnbryan) wrote :

that is the fix, you have to either use that or find a recovery disk so you
can go into the recovery console and use the command fix mbr or w/e. But the
reason the bug happens is because that people try to install ubuntu on an
external drive, and then it steals the mbr from windows and never gives it
back, those are the fixes... I am not quite sure what you mean.

On 8/1/07, Kevin Pijpers <email address hidden> wrote:
>
> I'm sorry alexnb185, but I'm not looking for supergrub, I'm looking for
> a fix for this bug.
>
> Does anyone have any information or is this project dead?
>
> Thanks,
>
> --
> Grub - Error 21 returned
> https://bugs.launchpad.net/bugs/8978
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
Robert Citek (robert-citek) wrote :

"But the reason the bug happens is because that people try to install ubuntu on an external drive, and then it steals the mbr from windows and never gives it back,"

That hypothesis is not consistent with several of the posts, especially when Windows is not involved. FWIW, I've installed Ubuntu 7.04 onto an external USB2 drive without a problem. The MBR on the internal drive was not modified.

The issue appears to be conflicting notions of the hardware setup, in particular RAID devices, between BIOS and the Linux kernel, mosly likely because of a poor driver for Linux that comes with Ubuntu. For example, with the hardware RAID I was using, the BIOS presented the RAID device as the first drive to Grub, effectively hiding the two drives that made up the RAID. However, under Linux, the RAID device was the third drive (/dev/sdc) because the driver for the RAID card exposed the two drives in the RAID as /dev/sda and /dev/sdb. When I reinstalled using CentOS, all was fine. In short, the problem was with the Linux driver that came with Ubuntu for my RAID card and CentOS had the right driver.

Some suggestions:
- use a RAID controller that Ubuntu supports or don't use a HW RAID controller
- don't dual boot unless you have a backup of your Windows drive and can restore it
- mention what version of Ubuntu and what drive controller you are using when you post.

Regards,
- Robert

Revision history for this message
Rusty Burchfield (gicodewarrior) wrote :

I get "Error 21" after a fresh install of Gutsy Server. There is only one disk in the system, and I used the "guided, use entire disk" option.

I have an Abit KT7-RAID (BIOS v6.00PG) with an integrated HPT370 RAID (BIOS v1.11.0402) controller. The disk is on the primary master of the HPT370 controller.

~Rusty

Revision history for this message
mat00 (pintar-matevz) wrote :

hi!

After installing ubuntu 7.10 with the live installation cd, i also received the message "error 21". Ubuntu was installed on the second IDE drive (WD 80G), while first disk is SATA2 (WD 250G) with win xp installed.

I tried installation with sata disk unpluged and i didnt work, then i tried with pluged-in sata and it didnt work either.

IDE disk is recognised in win xp and working fine, but strange, BIOS has some problems with this. Even after entering the number of heads, sectors, cylinders, IDE disk in BIOS is shown as none!?

Anyway, i'm not some computer expert, but posting here with hope that developers will no forget to focus on this bug ;), becouse i would really like to use ubuntu.

MSI p965 neo
intel core 2 duo
SATA2 WD
IDE WD
JMicron JMB36x RAID controller

mat00

Revision history for this message
Lloyd (lwcary-deactivatedaccount) wrote :

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Greetings, and THANKS for your reply!

I have some things I MUST do in a couple of my Windose (sic!) programs, then I will probably try to install Ubuntu AGAIN. But this time, I will try to install it on my primary, or "C" drive, not an external hard drive.

Wish me luck!

Yours truly,

Lloyd

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

----- Original Message ----
From: mat00 <email address hidden>
To: <email address hidden>
Sent: Tuesday, November 27, 2007 9:36:37 AM
Subject: [Bug 8978] Re: Grub - Error 21 returned

hi!

After installing ubuntu 7.10 with the live installation cd, i also
received the message "error 21". Ubuntu was installed on the second IDE
drive (WD 80G), while first disk is SATA2 (WD 250G) with win xp
installed.

I tried installation with sata disk unpluged and i didnt work, then i
tried with pluged-in sata and it didnt work either.

IDE disk is recognised in win xp and working fine, but strange, BIOS
 has
some problems with this. Even after entering the number of heads,
sectors, cylinders, IDE disk in BIOS is shown as none!?

Anyway, i'm not some computer expert, but posting here with hope that
developers will no forget to focus on this bug ;), becouse i would
really like to use ubuntu.

MSI p965 neo
intel core 2 duo
SATA2 WD
IDE WD
JMicron JMB36x RAID controller

mat00

--
Grub - Error 21 returned
https://bugs.launchpad.net/bugs/8978
You received this bug notification because you are a direct subscriber
of the bug.

Revision history for this message
Techguy (techguy) wrote :

This error is not isolated to installs on hard drives with Windows installed, nor does it have anything to do with the drive being an external drive. I received Error 21 on an empty disk installed in my computer. It failed on an Asus P5B systemboard running a Core2 Duo E-6600 processor. I also attempted to install Ubuntu on another clone Asus P5LD2-Deluxe and I couldn't even boot to the cd. Ubuntu installed fine on my Dell GX110 that is 8 years old.

Revision history for this message
Lloyd (lwcary-deactivatedaccount) wrote :

THANS for your prompt reply!

THIS time I reinstalled Ubuntu on my "FREE SPACE" on my "C" drive. It hung up at 83% installation. I rebooted and reinstalled a second time and it installed flawlessly. No "Grubby errors" this time. Lesson learned: "Iff'in at first you don't succeed... " Well you know the rest of it.

The bottom line: LOVE IT!!! :^)

Thanks again!

Lloyd

----- Original Message ----
From: Techguy <email address hidden>
To: <email address hidden>
Sent: Sunday, December 2, 2007 8:40:15 AM
Subject: [Bug 8978] Re: Grub - Error 21 returned

This error is not isolated to installs on hard drives with Windows
installed, nor does it have anything to do with the drive being an
external drive. I received Error 21 on an empty disk installed in my
computer. It failed on an Asus P5B systemboard running a Core2 Duo
E-6600 processor. I also attempted to install Ubuntu on another clone
Asus P5LD2-Deluxe and I couldn't even boot to the cd. Ubuntu installed
fine on my Dell GX110 that is 8 years old.

--
Grub - Error 21 returned
https://bugs.launchpad.net/bugs/8978
You received this bug notification because you are a direct subscriber
of the bug.

Revision history for this message
Harry Worley (worley) wrote :

I installed 7.10 on sdc, which is my third internal IDE disk, and committed the entire disk for Ubuntu to use. XP is on sdb, and sda is also an NTFS partition. When the Ubuntu install finished there was no message that would relate to dual booting, and when I removed the CD and rebooted the machine went straight back to XP with no boot loader.

Aren't these issues figured out yet? What do I need to do to make this work without getting a degree in geekness?

Revision history for this message
komputes (komputes) wrote :

I can confirm Grub error 21 on a Dell Precision 450 running a dual boot system with XP on the first IDE disk and Ubuntu freshly installed (never accessed) on the second IDE disk. The CD I was using was Gutsy Ubuntu 7.10 alternate i386.

Revision history for this message
thebalrog (miniature-multiverse) wrote :

I was getting the same error, I installed ubuntu on my first hard drive (sda1, in grub hd0), and windows on my second hard drive (sdb1, in grub hd1). Ubuntu worked fine but when it tried to boot windows I would get error 21. I went into my bios setup and looked under "drives". There was SATA1 which was "on" and said "hard drive 160gb ect...." which was my linux drive. SATA2 was then went to my cd/dvd drive, SATA3 - SATA 10 were all "off" and said "no device found" or something. so i turned SATA3 to "on". When i rebooted it immediately said "SATA3 device not found, F1 to continue, F2 to enter setup. If i continued and went to the grub menu and of course the same error 21.

But! Then i turned SATA3 off and tried turning SATA4 on, and hooray! Everything worked fine. So definitely make sure to fool around in the bios and try turning all the device on one by one.

Hooray Ubuntu!

Revision history for this message
Lloyd (lwcary-deactivatedaccount) wrote :

THANK YOU for the "heads up"!

Linux users are the most HELPFUL and FRIENDLY people on the Net!

--- On Fri, 4/18/08, thebalrog <email address hidden> wrote:

> From: thebalrog <email address hidden>
> Subject: [Bug 8978] Re: Grub - Error 21 returned
> To: <email address hidden>
> Date: Friday, April 18, 2008, 1:50 AM
> I was getting the same error, I installed ubuntu on my first
> hard drive
> (sda1, in grub hd0), and windows on my second hard drive
> (sdb1, in grub
> hd1). Ubuntu worked fine but when it tried to boot windows
> I would get
> error 21. I went into my bios setup and looked under
> "drives". There
> was SATA1 which was "on" and said "hard
> drive 160gb ect...." which was
> my linux drive. SATA2 was then went to my cd/dvd drive,
> SATA3 - SATA 10
> were all "off" and said "no device
> found" or something. so i turned
> SATA3 to "on". When i rebooted it immediately
> said "SATA3 device not
> found, F1 to continue, F2 to enter setup. If i continued
> and went to
> the grub menu and of course the same error 21.
>
> But! Then i turned SATA3 off and tried turning SATA4 on,
> and hooray!
> Everything worked fine. So definitely make sure to fool
> around in the
> bios and try turning all the device on one by one.
>
> Hooray Ubuntu!
>
> --
> Grub - Error 21 returned
> https://bugs.launchpad.net/bugs/8978
> You received this bug notification because you are a direct
> subscriber
> of the bug.

Revision history for this message
labinnsw (labinnsw) wrote :
Revision history for this message
Laura (bbbmc59) wrote :

Hi all...so very, very frustrating. Same error message here.

I have been all over the 'net and no one seems to be able to help. I have found a link that even clearly states what I should type in terminal after booting from the Ubuntu cd and even THAT gives error messages. (see below)

Running 7.10 on a fairly new desktop computer, I've had it about 8 months. Everything was fine until last night I installed EEEkubuntu to a UsB drive. Ever since then, I can not boot my Ubuntu computer. So frustrating. I hope this doesn't mean my hard drive contents are gone? I am not dual booting and not running Windows, only ubuntu.

I've tried everything listed above, changed the bios, cmos, moved the cmos plug inside the computer to reset it. Just sick about this really.

I'm hoping someone has something I could type in terminal to get my boot back. The one thing I did try to do: http://www.pendrivelinux.com/2007/08/11/grub-error-21-after-full-install-to-usb-hard-drive/
gave me the error "could not find device for boot: not found or not a block device" it seems hopeful, that typing "something" in terminal will be the way to go but I know nothing about Linux and have yet to find the person that does know a solution to this.

Much thanks in advance for any and all suggestions!

Revision history for this message
alexnb185 (alexnbryan) wrote :

Hey google super grub... it can get you to boot back into windows if
you want.. and restore the boot loader.
On May 31, 2008, at 12:56 PM, Laura wrote:

> Hi all...so very, very frustrating. Same error message here.
>
> I have been all over the 'net and no one seems to be able to help. I
> have found a link that even clearly states what I should type in
> terminal after booting from the Ubuntu cd and even THAT gives error
> messages. (see below)
>
> Running 7.10 on a fairly new desktop computer, I've had it about 8
> months. Everything was fine until last night I installed EEEkubuntu
> to a
> UsB drive. Ever since then, I can not boot my Ubuntu computer. So
> frustrating. I hope this doesn't mean my hard drive contents are
> gone? I
> am not dual booting and not running Windows, only ubuntu.
>
> I've tried everything listed above, changed the bios, cmos, moved the
> cmos plug inside the computer to reset it. Just sick about this
> really.
>
> I'm hoping someone has something I could type in terminal to get my
> boot back. The one thing I did try to do: http://www.pendrivelinux.com/2007/08/11/grub-error-21-after-full-install-to-usb-hard-drive/
> gave me the error "could not find device for boot: not found or not
> a block device" it seems hopeful, that typing "something" in
> terminal will be the way to go but I know nothing about Linux and
> have yet to find the person that does know a solution to this.
>
> Much thanks in advance for any and all suggestions!
>
> --
> Grub - Error 21 returned
> https://bugs.launchpad.net/bugs/8978
> You received this bug notification because you are a direct subscriber
> of the bug.

Revision history for this message
Laura (bbbmc59) wrote :

Sorry, I stated I am not running windows. I am running Ubuntu 7.10. I've googled like crazy about my problem. That's how I found this board. So far, none of the google results have helped.

Revision history for this message
alexnb185 (alexnbryan) wrote :

Oh sorry I didn't read al the way through. It still might be worth a
try to use that and boot off the cd and try to boot into your old
linux. I don't know if it will work. But if it does, then go back and
do it again, only repair it with the cd. It has been over a year since
I had the grub error, I run windows and mac now due to the pretty
unstable 8.04. So I don't know a whole bunch about grub.
On May 31, 2008, at 1:32 PM, Laura wrote:

> Sorry, I stated I am not running windows. I am running Ubuntu 7.10.
> I've
> googled like crazy about my problem. That's how I found this board.
> So
> far, none of the google results have helped.
>
> --
> Grub - Error 21 returned
> https://bugs.launchpad.net/bugs/8978
> You received this bug notification because you are a direct subscriber
> of the bug.

Revision history for this message
Laura (bbbmc59) wrote :

Thank you thank you to this link: http://ubuntuforums.org/showthread.php?t=224351 I have my problem solved!! Many hours later but I am so happy. Thought I would post it so others might benefit :)

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

I'm curious if anyone can reproduce this problem in Ubuntu Intrepid 8.10 (currently under development)?

:-Dustin

Revision history for this message
dave b. (d+b) wrote :

I just did Dustin. I reproduced this bug -> ubuntu 8.10 server installation removed the working grub install i had on the first hard disk. I had to manually do as in the link Laura posted. This seems to be a bug that has NEVER BEEN FIXED.

Revision history for this message
dave b. (d+b) wrote :

I would like to propose the following solution. Ubuntu should in future releases, when it detects that the disk you are installing it on is not the primary disk (the first disk that gets booted off) the installer should either prompt the user for what to do or add an entry to boot ubuntu using the existing grub (edit menu.lst etc.). If this is not a nice solution for the desktop installation,then it should be added to the server and alternative installation disk.

This seems rather trivial.

Revision history for this message
KreeH (kreeh) wrote :

I have a recent Ubuntu 8.10 install on a older Gigabyte GA7N400Pro with on-board RAID.
IDE ports 1 & 2 are take by two DVD and two hard drives. When I add a third drive using the
RAID IDE3 I get a similar error. Suddenly the GRUB loader cannot find the boot disk and
dumps me into initramfs. If I disconnect the added disk, the system boots normally. This
is not a dual boot system.

Revision history for this message
Kevin Pijpers (kevin-pijpers) wrote :

I reproduced this bug in Intrepid (Linux Mint) as well. This bug has indeed never been fixed, nor do any of the posted options in this thread work for me.

I sincerely hope that someone will find a cure for this. Because I have to go back to Windows, which is far from perfect, but does work.

Revision history for this message
Chris Cheney (ccheney) wrote :

Depending on what the cause is there isn't really anything that can be done to fix it on the Ubuntu side. The controller I noted I saw the problem on was the controller's fault. It was writing data to the drive even when not in RAID mode with no regard to what the OS wanted to do with the drive. That is a bug in the controller firmware not Ubuntu.

Revision history for this message
Hal Lamborn (hlamborn) wrote :

02=23-2009
Hi Chris:
I have encountered this problem in Xubuntu,Kubuntu and Ubuntu whenever I
install the OS to my outside external hardrive(with partitions) and not inside of windows on the same
drive with Windows. Grub seems to get mixed up when the OS is not on the internal hardrive and
outside of Windows.
--
Regards,
Hal Lamborn
2487 Solarwood Drive
Davison, MI 48423
810-412-0799
<email address hidden>

---- Chris Cheney <email address hidden> wrote:
Depending on what the cause is there isn't really anything that can be
done to fix it on the Ubuntu side. The controller I noted I saw the
problem on was the controller's fault. It was writing data to the drive
even when not in RAID mode with no regard to what the OS wanted to do
with the drive. That is a bug in the controller firmware not Ubuntu.

--
Grub - Error 21 returned
https://bugs.launchpad.net/bugs/8978
You received this bug notification because you are a direct subscriber
of a duplicate bug.

Status in “grub” source package in Ubuntu: Confirmed

Bug description:
Hello,

After installing Ubuntu on a clean disk, GRUB returns the following error on
startup :
"
Grub Loading stage 1.5.
Error 21
"
Error 21 means :
"
21 : Selected disk does not exist
    This error is returned if the device part of a device- or full file name
refers to a disk or BIOS device that is not present or not recognized by the
BIOS in the system.
"

My motherboard is a ABIT KR7A-RAID with a Highpoint hpt372 controller for RAID
(This motherboard has two normal IDE and two IDE for RAID).
This error is returned when my HDD in plugged on a "RAID" IDE. (By the way, I
don't use RAID, it's a single disk).
Ubuntu installation works if I plug my HDD on a normal IDE.

I encounter no problem when I install Fedora Core 2 with my HDD plugged on a
"RAID" IDE (and with GRUB) (so I don't think it's a BIOS problem).

Thanks

Revision history for this message
dave b. (d+b) wrote :

 Hal Lamborn Yeah i was about to comment that yesterday when installed debian lenny again i noticed it automatically selects the ide drive, DESPITE the fact that I have told bios to boot my new sata drive. So i think it is a failure in the installation to test the drive order ?... or bioses ....? i 'm not sure i think if someone with a lot more technological knowledge can help this should be sorted fairly quickly.

Revision history for this message
dave b. (d+b) wrote :

Oh and i wanted to provide more information about both installs->
8.10 doesn't work for installation (no idea why) ... So i used ubuntu 8.04 set up an encrypted lvm. I did the same on debian lenny (rc 1 disk ). Both installations resulted in grub installing to the wrong disk. However, this time both could boot.

I think, if any installer takes a copy of the mbr, saves it. Writes a new mbr and then tests if it works, upon failing restores the old mbr and prompts the user could be a good solution.

Revision history for this message
Kevin Pijpers (kevin-pijpers) wrote :

This bug happens to me with only one hard drive without any other OS. So it isn't a problem with partitions or the drive being external. At least, that's not the case for me. The drive just is not found by grub, even when the MBR points exactly to it.

I do think it has something to do with my Jmicron raid controller. Does anyone have experience installing a kernel with lilo or another bootloader?

Kind regards

-----Oorspronkelijk bericht-----
Van: <email address hidden> [mailto:<email address hidden>] Namens Hal Lamborn
Verzonden: dinsdag 24 februari 2009 4:14
Aan: <email address hidden>
Onderwerp: Re: [Bug 8978] Re: Grub - Error 21 returned

02=23-2009
Hi Chris:
I have encountered this problem in Xubuntu,Kubuntu and Ubuntu whenever I
install the OS to my outside external hardrive(with partitions) and not inside of windows on the same
drive with Windows. Grub seems to get mixed up when the OS is not on the internal hardrive and
outside of Windows.
--
Regards,
Hal Lamborn
2487 Solarwood Drive
Davison, MI 48423
810-412-0799
<email address hidden>

---- Chris Cheney <email address hidden> wrote:
Depending on what the cause is there isn't really anything that can be
done to fix it on the Ubuntu side. The controller I noted I saw the
problem on was the controller's fault. It was writing data to the drive
even when not in RAID mode with no regard to what the OS wanted to do
with the drive. That is a bug in the controller firmware not Ubuntu.

--
Grub - Error 21 returned
https://bugs.launchpad.net/bugs/8978
You received this bug notification because you are a direct subscriber
of a duplicate bug.

Status in “grub” source package in Ubuntu: Confirmed

Bug description:
Hello,

After installing Ubuntu on a clean disk, GRUB returns the following error on
startup :
"
Grub Loading stage 1.5.
Error 21
"
Error 21 means :
"
21 : Selected disk does not exist
    This error is returned if the device part of a device- or full file name
refers to a disk or BIOS device that is not present or not recognized by the
BIOS in the system.
"

My motherboard is a ABIT KR7A-RAID with a Highpoint hpt372 controller for RAID
(This motherboard has two normal IDE and two IDE for RAID).
This error is returned when my HDD in plugged on a "RAID" IDE. (By the way, I
don't use RAID, it's a single disk).
Ubuntu installation works if I plug my HDD on a normal IDE.

I encounter no problem when I install Fedora Core 2 with my HDD plugged on a
"RAID" IDE (and with GRUB) (so I don't think it's a BIOS problem).

Thanks

--
Grub - Error 21 returned
https://bugs.launchpad.net/bugs/8978
You received this bug notification because you are a direct subscriber
of the bug.

Revision history for this message
Chris Cheney (ccheney) wrote :

db,

That could work with respect to writing the installer then verifying it except for one thing. In the cases where this problem is caused by the controller bios it typically doesn't overwrite the sectors immediately, but only after reboot (which reinitializes the bios). So the installer couldn't really check for it unless there was some sort of multistage install which involved rebooting the machine back onto the installer media (generally cd).

lilo should avoid this problem since if I remember correctly it only uses the boot sector in cylinder 0 and the rest of it is written into the partition of the installed OS.

Chris

Revision history for this message
Daygan (sheerzeal) wrote :
Download full text (3.2 KiB)

I had this problem last night, and found this thread, and eventually, via some comments on this thread and another link that ?? provided, discovered what the ACTUAL problem was for me, and I believe it may be a problem for a number of others here, as some have mentioned installation from an external hard drive. This solution may also work for those who have encountered this problem for other reasons, but I'm not certain..

Step by step, what I did:

1. I followed this person's grub solution problem: http://ow.ly/1zF5
(If in fact, with your particular problem, when you start, you see an options screen to choose which 'instance' of your O.S. you wish to start, you can probably skip to the next step. I've included this "grub fix" only because I can't personally remember if the options screen was available for me before I tried the fix or not)

the fix didn't work for me entirely, but after doing it, i did notice that there I got an options screen to start various O.S. "styles" (for lack of a better word - sorry i'm not a tech linguist). choosing any of these options only brought me again to error 21, saying that the drive doesn't exist.. Then I had an epiphany...

2. I edited the (hd?,?) and sd?# entries in the O.S. startup line to the correct hard drive (hd) and partition area (sd).

long explanation: I noticed that the hard drive label that grub was pointing to was incorrect, and in fact would have been the label that my other computer assigned to it when I was installing the system via external hard drive. In fact, I believe it should have correctively adjusted this label, as I seem to recall that when installing Kubuntu before on an external hard drive (this time I was installing Linux Mint) i did not have this problem, but alas, it did not, and I therefore was left with the problem and had to manually adjust.

So for those of you needing detailed explanations, here's what I did:
     a. type "e" to edit the command line
     b. select the command line you want to use - [I would do this for any and all lines where you see (hd?,?) (e.g. hd1,0, hd0,0) and sd?# (e.g. sdb1]
     c. press enter, then edit all "hd" entries to your proper hard drive label (most likely (hd0,0) and all "sd" entries to the proper partition label (most likely sda1)
     d. hit enter, then repeat step b and c for all lines with hd and sd entries (i'm not certain if this is absolutely necessary, but it doesn't hurt, at least, and if it is necessary and you don't do it this will save you a couple keystrokes from having to go back and start over again)
     e. once all hd and sd entries are fixed, select the top line and enter the boot option (I can't remember if it's [Enter] or "b" but the explanation is down there at the bottom of the screen anyway)
     f. the system should start properly this time (did for me, at least)

3. now you have to edit your grub file so you don't have to manually change the hd and sd every time you start
     a. in a terminal window, type: gksudo gedit /boot/grub/menu.lst
     b. when the file opens, change all hd and sd entries to the same entries that you just used in the startup screen (most likely hd0,0 and sda1)
     c. save and quite. Y...

Read more...

Revision history for this message
Ubuntu_user (wcamp) wrote :

Insalled ubuntu 8.10 after removing 7 on a secondary hard drive. Found that the operating system took over the entire hard drive, removed my windows partitions and then on restart I received the error 1.5 and error 21 message, could not log into anything and the system became useless.
Found that I could boot to the cd if running live from the cd. Have not reinstalled ubuntu to date, but did have to reinstall windows operating system as the mbr appeared to be destroyed by the intallation of ubuntu.

Revision history for this message
mp (m-p) wrote :

You do not have to (re)install Windows to restore your MBR:
http://support.microsoft.com/kb/69013

Ubuntu_user wrote:
> Insalled ubuntu 8.10 after removing 7 on a secondary hard drive. Found that the operating system took over the entire hard drive, removed my windows partitions and then on restart I received the error 1.5 and error 21 message, could not log into anything and the system became useless.
> Found that I could boot to the cd if running live from the cd. Have not reinstalled ubuntu to date, but did have to reinstall windows operating system as the mbr appeared to be destroyed by the intallation of ubuntu.
>

Revision history for this message
Robert Citek (robert-citek) wrote :

You can even use Ubuntu to restore your MBR:

http://pwet.fr/man/linux/administration_systeme/install_mbr
http://packages.ubuntu.com/search?keywords=mbr

> You do not have to (re)install Windows to restore your MBR:
http://support.microsoft.com/kb/69013

Revision history for this message
adrian15 (adrian15) wrote :

What error 21 might mean is explained here:
http://www.supergrubdisk.org/wiki/GrubOnRemovableExternalHardDiskNotBooting
and this url might be also useful:
http://www.supergrubdisk.org/wiki/GrubHardDiskOrder

The main problem here is that Grub relies on the BIOS for knowing hard disk order.

So there are several things here:

* Ubuntu installer when finding two hard disks it does not prompt the user to assign one hard disk to hd0 (first bios hard disk) and another hard disk to hd1 (second bios hard disk). This is problematic even when using the uuid command. Because root (hd1,2) setup (hd0) commands might be run, when root (hd0,2) setup (hd0,2) with another device mapping is needed.

* grub2 will have a native IDE controller and a lot of features that will make it more BIOS independent but it is not mature enough.

* Whenever people install Ubuntu into an external hard disk, even if everything is ok, if they reboot without the external hard disk connected they will get an error 21. So... How do you fix it? Adding a Windows boot entry to Ubuntu that includes my fix to chainload grub from a second hard disk? (Found here: http://www.supergrubdisk.org/wiki/Howto_Boot_Grub_from_windows). That's not ok for non-Windows users.

* People do not know often how to learn if BIOS detects their hard disks or not.

I mean, this error 21 bug thread will grow and grow with no apparent solution till maybe grub2 appears.

Revision history for this message
LXCC (lxcc-it-gg) wrote :

My configuration:
- Pentium4 with ubuntu 9.10 32bit
- the BIOS of motherboard haven't any option about virus-scan
IDE 1 - Master - first H.D. 40 GB : Three ext3 partition and a swap partition (all "primary").
IDE 1 - Slave - second H.D. 80 GB : One ext3 partition only ("primary").
IDE 2 - Master - DVD.

I tryied to install Ubuntu 9.10 on second hd (IDE 1-Slave): it works for a lot of time, but after it destroyed the partition table of second hd.

I recovered the partion table with fdisk, but after a lot of time it destroyed again.

For the moment my solution is to remove the "grub-pc" package and install the "grub" package (returning to grub 1).

Revision history for this message
Colin Watson (cjwatson) wrote :

On Thu, Feb 18, 2010 at 06:04:56PM -0000, LXCC wrote:
> For the moment my solution is to remove the "grub-pc" package and
> install the "grub" package (returning to grub 1).

This bug is filed against grub. If you're having a problem with
grub-pc, it is not this bug and should be filed separately.

Revision history for this message
rusivi2 (rusivi2-deactivatedaccount) wrote :

Thank you for posting this bug.

Does this occur in Lucid?

Changed in grub (Ubuntu):
status: Confirmed → Incomplete
dino99 (9d9)
Changed in grub (Ubuntu):
status: Incomplete → New
status: New → Incomplete
Revision history for this message
Phillip Susi (psusi) wrote :

Closing bug that should have expired long ago.

Changed in grub (Ubuntu):
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.