GRUB error 21 when trying to boot XP after installing Ubuntu 7.04 on seperate hdd
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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.
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???
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
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.
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.
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.
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.
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!
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.
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.
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.