LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   GRUB error 21 when trying to boot XP after installing Ubuntu 7.04 on seperate hdd (https://www.linuxquestions.org/questions/linux-newbie-8/grub-error-21-when-trying-to-boot-xp-after-installing-ubuntu-7-04-on-seperate-hdd-552043/)

neilksos 05-07-2007 03:57 PM

GRUB error 21 when trying to boot XP after installing Ubuntu 7.04 on seperate hdd
 
Hi,
I'm a complete linux newbie and i think i messed up my laptop trying to install Ubuntu 7.04 from the live cd.

I reciently found my iRiver H320 so i decided to format it(as an external 20gb hdd) and install linux on it so i could play around with linux and see what it was like. i figured that installing it on this would not affect my windows xp install as it was on a seperate hdd and therefor would not touch my internal hdd.

I was wrong!!!!

After installing ubuntu on the external hdd i restarted my laptop. i changed the boot sequence so it would load from the external hdd......it said cannot load operating system(i'm presuming this is because my iRiver is set up as an mp3 player or something).

thats not the main problem tho.... i unplugged the external hdd and restarted my laptop, changing the boot sequence back to my internal hdd.

when it went to try boot it said
GRUB loading Stage 1.5
Grub loading, please wait....
Error 21_

it wont allow me press any buttons except the power button(which obviously turns the laptop off.)

so now i cant get Windows XP to boot or Ubuntu. i put back in the live cd and all the files on the internal hdd appear to be unchanged so i have no idea what has happened and why Windows will not boot.

I have no idea what GRUB is or what Error 21 means.

Any help in gettting Windows to boot would be much appreciated and if anyone can tell me if it's posible to boot ubuntu from an IRiver H320.

Thanks,
neilksos.

BrianK 05-07-2007 06:52 PM

Quote:

Originally Posted by neilksos
Hi,
I'm a complete linux newbie and i think i messed up my laptop trying to install Ubuntu 7.04 from the live cd.

I reciently found my iRiver H320 so i decided to format it(as an external 20gb hdd) and install linux on it so i could play around with linux and see what it was like. i figured that installing it on this would not affect my windows xp install as it was on a seperate hdd and therefor would not touch my internal hdd.

I was wrong!!!!

After installing ubuntu on the external hdd i restarted my laptop. i changed the boot sequence so it would load from the external hdd......it said cannot load operating system(i'm presuming this is because my iRiver is set up as an mp3 player or something).

thats not the main problem tho.... i unplugged the external hdd and restarted my laptop, changing the boot sequence back to my internal hdd.

when it went to try boot it said
GRUB loading Stage 1.5
Grub loading, please wait....
Error 21_

it wont allow me press any buttons except the power button(which obviously turns the laptop off.)

so now i cant get Windows XP to boot or Ubuntu. i put back in the live cd and all the files on the internal hdd appear to be unchanged so i have no idea what has happened and why Windows will not boot.

I have no idea what GRUB is or what Error 21 means.

Any help in gettting Windows to boot would be much appreciated and if anyone can tell me if it's posible to boot ubuntu from an IRiver H320.

Thanks,
neilksos.

Because I've not worked much with external hard drives, I'll just have to venture a guess:

grub (the boot loader) was probably installed on your main, windows hard drive (this is typically done by default). When you installed ubuntu, the boot order in the BIOS was probably set like it was when you were running windows alone. Changing the boot order probably changed the mapping of the drives, so grub can no longer find the drive(s)/partition(s) it's expecting to find.

I would try to plug the external drive back in & change your boot order back to the windows drive. You will still be able to boot into Linux or Windows (that's what grub is for), assuming it works at all. If you set everything back up the way it was just before you installed Ubuntu, you should be good (including plugging in that external drive). If not, that's going to be a bit more difficult.

tromboneman 05-07-2007 06:57 PM

The reason you are unable to boot is because the bootloader was installed on your IRiver. What you need to do to restore your computer is boot into your XP cd (you have one, right?) and enter the recovery console. Then type
Code:

fdisk /mbr
After this, all you have to do is install another version of Linux that will not damage your MBR, like Topologilinux, so that you will not have to live without Linux :)

P.S. - You will not be able to boot from your IRiver after this. If you want a distro for your MP3 player, try Slax.

BrianK 05-07-2007 07:01 PM

Quote:

Originally Posted by tromboneman
The reason you are unable to boot is because the bootloader was installed on your IRiver. What you need to do to restore your computer is boot into your XP cd (you have one, right?) and enter the recovery console. Then type
Code:

fdisk /mbr
After this, all you have to do is install another version of Linux that will not damage your MBR, like Topologilinux, so that you will not have to live without Linux :)

P.S. - You will not be able to boot from your IRiver after this. If you want a distro for your MP3 player, try Slax.

C'mon now, distros have nothing to do with boot loaders, MBRs or MP3s. ;)

neilksos 05-08-2007 07:04 AM

i did change everything back to how it was b4 i installed linux and when i go to boot XP it gives me the Error 21. when i try boot from the external hdd it says operating system not found.

I also do not currently have the xp cd with me as i am in college and (if i have it at all) it's probably at home. is there any way i can fix this with the Ubuntu live cd or any other live linux cd's ye can think of???

thanks.

saikee 05-08-2007 07:54 AM

Search Google "Grub Manual" will show

Code:

21 : Selected disk does not exist
In the Bios there is a facility to enable "USB lagacy support". I think your problem will disappears if you "enable" this function.

Your problem stems from having installed Grub, the Linux boot loader, into the MBR thereby overwriting XP's MBR.

Grub can't find the external hard disk because it needs "USB lagacy support enabled". You managed to install the Linux because it was the kernel who detected the USB device and found it. At boot time Grub has no access to a kernel and so it need "USB leagacy support enabled".

There are few booting tips at the last link of my signature. If you do need to restore XP's MBR you can download FreeDos to burn into a CD or a floppy and use the terminal command
Code:

fdisk /mbr

neilksos 05-08-2007 10:41 AM

ok i feel ridiculously stupid now cos i jus installed ubuntu again from the live cd and didn't touch the boot order when i rebooted and it worked! i now have linux on my external hdd and windows xp on my internal.

Thanks for ye're help!

tjvigil66 05-19-2007 10:42 PM

Same "Error 21" problem, but I'm not sure the solution will work for me
 
I might just be thick headed, but I'm just not sure that the answers quite fit my problem.

I have a Dell XPS notebook that has Windows XP installed on the internal HDD. I just purchased a Fantom Drives 500gb external HDD and installed Ubuntu Studio onto it. Everything works great... until I try to boot into Windows without the external drive attached. That is when I get the dreaded "Error 21".

So, here's the main question...

Will running "fdisk /mbr" fix my problem?

My computer isn't always attached to the external drive. When I am on the road, the external drive doesn't travel with me and I run Windows exclusively (business). When I am at home, I run Linux most of the time but still require Windows on occasion.

I do hope somebody here can help me get through this growing pain. I really do like Linux quite a bit. If it weren't for a handful of Windows-only apps that I need for work, I'd eliminate Windows from my internal HDD and never look back!

Thanks in advance for taking the time to help me sort this out.

- Tony

saikee 05-20-2007 05:01 AM

tjvigil66,

Your problem is complicated involving more than one fix.

I suggest you start a new thread and provide the following information at the same time

(1) The Ubuntu output of
Code:

sudo fdisk -l
(2) List the file /boot/grub/menu.lst

(3) List the file /boot/grub/device.map

(4) List the file /etc/fstab

Basically your problem is that you have set up the 1st disk as the internal XP and 2nd disk as the external 500Gb to install Ubuntu into the 2nd disk.

In a normal Linux installation when the boot loader, Grub in your case, is always installed in the MBR of the first disk of the booting queue. That is your internal XP disk. In so doing you have oevrwritten the MS MBR with Grub's MBR.

When you unplug the external disk and you boot up the MBR's part of Grub. Grub's intelligence is in the files stored in the /boot/grub directory of Ubuntu but they are no longer available. Grub is therfore left in a hopeless situation.

You could, if you choose to do so as another alternative, re-arrange the booting queue to boot the external 500Gb disk as the first disk and "re-install" Ubuntu again. This will make Grub installed into the MBR of the new 500Gb external hard disk and the original MS MBR in the internal disk untouched. When you unplug the external disk the bios has no alternative but to boot back to the internal disk as the 1st disk and so XP will boot normally.

The complication I mentioned above is whenever a Linux or a MS Windows is installed the boot disk order will be recorded and you must take account of this feature in order to boot them successfully.

tjvigil66 05-20-2007 04:36 PM

Quote:

Originally Posted by saikee
You could, if you choose to do so as another alternative, re-arrange the booting queue to boot the external 500Gb disk as the first disk and "re-install" Ubuntu again. This will make Grub installed into the MBR of the new 500Gb external hard disk and the original MS MBR in the internal disk untouched. When you unplug the external disk the bios has no alternative by boot back to the internal disk as the 1st disk and so XP will boot normally.

I'm definitely going to give this a try and report back on how it all worked out. Maybe my experience can help a future newbee with the same problem.

Thanks!

- Tony

saikee 05-20-2007 04:50 PM

You will find it will work out. This thread said so because Ubuntu 7.0 was installed in sda11 there.

tjvigil66 05-20-2007 09:25 PM

update...
 
YEAH!!!!

I got all of my problems sorted out! Here's what I did...

1)I ran fixmbr from a windows install disk in recover mode to fix the mbr on my internal hdd. This was kinda scary because the little app tells you that the partitions might not be accessible. I don't know what would have happened if I had more than one partition, but it did work with a single partion drive.

At this point, Windows booted as normal. However, trying to boot Linux from the external drive returned error 17.

So, to fix that little bit...

2)I modified the boot drive from hd1,0 to hd0,0 and pressed b to boot linux.

3)Once I was in Linux, I edited the menu.lst file to change all linux entries to hd0,0 instead of hd1,0.

Now, everything works great. If I don't elect to boot from the external drive (automatic internal drive boot), Windows runs automatically. If I do elect to boot from the external drive, grub allows me to select which Linux distro to run.

Thanks again for all the help. I couldn't have got this fixed without you guys!

- Tony

Georges42 10-31-2007 08:42 AM

I have the same problem with error 21. I also installed Ubuntu in my auxiliary Hard disk. I used the Fdisk /MBR working very well to go back to windows. Again, I installed Ubuntu to the same Hard Disk. When I quit Ubuntu on that Hard disk, Ubuntu changes again my MBR.
How to avoid that? Something to change in the files?
Thanks.

saikee 10-31-2007 08:59 AM

You have to make a decison with which boot loader you select to multiboot.

The last link in mysignature should have everything you need regardless the choice of the boot loader. However Lilo is about 3 times and NTLDR 10 times harder than using Grub.

docamo 05-04-2008 01:04 PM

Ubuntu IEEE HD Install
 
I am having trouble getting Ubuntu to boot all together. I installed from the live cd to an IEEE Lacie drive. Everything installed fine until I went to reboot and get the grub error 21. I have one internal HD in 2 partitions. XP will not run and the only thing I can do at this point is run the live cd.
I am trying to create a dual boot with XP on the internal and Ubuntu on the Lacie drive. Is this possible? What would I need to do to make it work and how can I first rid myself of the error 21?

saikee 05-05-2008 06:27 AM

docamo,

You should open up your own thread instead of putting your problem on the back of a 10 months old thread by another.

I believe if you want to boot from an external hard disk you need to tell Bios the first bootable disk is the IEEE Lacie drive. You also need to put Grub on the MBR of the IEEE Lacie drive. It appears to me you have put Grub into the MBR of the internal hard disk.

Here is a temporary cure to get Windows back

(1) Restore Windows MBR to the internal disk. Task B1 or B2 of my last signature refers.

or

(2) Use another Live CD that you can boot Windows with. Details in this thread.

neilksos 05-05-2008 08:07 AM

Run the live cd again and install Ubuntu to your external hdd.

Do not touch the boot sequence of your computer.

The GRUB mbr is cobntained in your internal hdd as far as i know but it links to the external one to run. So that means you always need your external hdd connected, even if you want to run xp!

Just re-install Ubuntu and then keep the hdd connected and reboot your computer. You should be able to select xp or ubuntu to boot into! Once you have booted into xp you can then disconnect your external hdd if you wish!

Just make sure that the boot order of your computer is set to boot from your internal hdd BEFORE it tries to boot from your external!


All times are GMT -5. The time now is 10:02 AM.