LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 05-07-2007, 04:57 PM   #1
neilksos
LQ Newbie
 
Registered: May 2007
Location: Kilkenny/Cork, Ireland
Distribution: Ubuntu
Posts: 4

Rep: Reputation: 0
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.
 
Old 05-07-2007, 07:52 PM   #2
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
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.
 
Old 05-07-2007, 07:57 PM   #3
tromboneman
Member
 
Registered: Jan 2007
Distribution: Debian
Posts: 67

Rep: Reputation: 15
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.
 
Old 05-07-2007, 08:01 PM   #4
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
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.
 
Old 05-08-2007, 08:04 AM   #5
neilksos
LQ Newbie
 
Registered: May 2007
Location: Kilkenny/Cork, Ireland
Distribution: Ubuntu
Posts: 4

Original Poster
Rep: Reputation: 0
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.
 
Old 05-08-2007, 08:54 AM   #6
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
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

Last edited by saikee; 05-08-2007 at 09:00 AM.
 
Old 05-08-2007, 11:41 AM   #7
neilksos
LQ Newbie
 
Registered: May 2007
Location: Kilkenny/Cork, Ireland
Distribution: Ubuntu
Posts: 4

Original Poster
Rep: Reputation: 0
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!
 
Old 05-19-2007, 11:42 PM   #8
tjvigil66
LQ Newbie
 
Registered: May 2007
Posts: 3

Rep: Reputation: 0
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

Last edited by tjvigil66; 05-19-2007 at 11:43 PM.
 
Old 05-20-2007, 06:01 AM   #9
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
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.

Last edited by saikee; 05-20-2007 at 05:46 PM.
 
Old 05-20-2007, 05:36 PM   #10
tjvigil66
LQ Newbie
 
Registered: May 2007
Posts: 3

Rep: Reputation: 0
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
 
Old 05-20-2007, 05:50 PM   #11
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
You will find it will work out. This thread said so because Ubuntu 7.0 was installed in sda11 there.
 
Old 05-20-2007, 10:25 PM   #12
tjvigil66
LQ Newbie
 
Registered: May 2007
Posts: 3

Rep: Reputation: 0
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
 
Old 10-31-2007, 09:42 AM   #13
Georges42
LQ Newbie
 
Registered: Oct 2007
Posts: 3

Rep: Reputation: 0
Angry

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.
 
Old 10-31-2007, 09:59 AM   #14
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
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.
 
Old 05-04-2008, 02:04 PM   #15
docamo
LQ Newbie
 
Registered: May 2008
Posts: 1

Rep: Reputation: 0
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?
 
  


Reply

Tags
boot, error, ubuntu, windows, xp


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
Error Grub stage2 loading error (using FC6) on seperate hdd Anifield Linux - Newbie 7 03-20-2007 02:14 PM
Urgent: Installing debian etch on a new hdd but grub won't install (fatal error) MrInept Debian 4 09-14-2006 09:54 AM
grub loading error 16 after installing ubuntu 6 timbuktu Linux - Newbie 1 07-08-2006 02:02 PM
GRUB Error 17 when installing Ubuntu on an External Drive nrbelex Linux - Software 1 11-16-2005 09:06 AM
Dual boot windows xp on seperate HDD Gaz25 Linux - Newbie 24 07-22-2005 04:46 PM


All times are GMT -5. The time now is 09:35 AM.

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