Installed 8.04 onto external HD; now I can't boot from internal HD

Asked by MEC407

Good morning,

I apologize in advance if this question has already been asked dozens of times. I did try searching for it, using several different search terms, and although I got dozens upon dozens of threads, none seemed to match my situation.

OK, so I've got an internal SATA HD which has Windows XP on it, and an external USB HD, onto which I installed Ubuntu 8.04. Installation went smoothly.

When I turn on the computer, I get a boot screen that asks me to choose between Ubuntu and Windows. That's fine. No problems there.

Here's the snag: when the external HD is turned off or disconnected, I can't boot at all. The boot loader (I think that's what it's called?) starts to load, but then it freezes and displays an "error 21" and doesn't go anywhere. And that's it. I can't do anything unless I plug the external HD back in and turn it on, restart, and then everything's fine again... I can boot into Windows or Ubuntu as I please.

Is there any way to configure it so that I can boot into Windows even if the external HD is turned off or disconnected?

Thanks in advance for any help you can provide! And again, I apologize if this is a frequently asked question; I really did try to search for it before asking. ;) Oh, and I'm a Linux newbie, as I'm sure is obvious, so please be gentle. ;)

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Tony Pursell (ajpursell) said :
#1

Hi

The problem is that the file which gives you the boot menu is on the external drive in the folder /boot/grub. Grub installs enough code and data in the master boot record (mbr) of your internal drive to read files in /boot/grub and continue the boot process into whichever OS you choose.

If you have an XP installation CD, you can use that to run the rescue console to put back the original mbr so you can boot into XP. I have no experience of the exact procedure to follow here.

There may be ways to set up Ubuntu on an external HD and still be able to boot XP when it is disconnected, but you will have to ask that question again after you have taken the action outlined above.

Tony

Revision history for this message
MEC407 (boston-maine-rr) said :
#2

If I use the XP install CD to repair the MBR on the internal drive, I will no longer be able to use the Ubuntu installation on the external drive and will need to reinstall it -- correct? Just want to make sure I understand how this works.

Revision history for this message
MEC407 (boston-maine-rr) said :
#3

I tried to use the repair console on the XP install CD. Upon loading the repair console, it asked me to enter the administrator password, which I did, but it kept saying that the password was invalid. Sigh. Oh well, it was worth a shot.

Is there any other way to repair the MBR?

Revision history for this message
idyllic (idyllic) said :
#4

Hmph, can you leave the admin password blank? I mean when it prompts you for password, just press enter. :)

Revision history for this message
MEC407 (boston-maine-rr) said :
#5

I did try that, but it just asks me again two more times, and on the third instance of leaving it blank, the repair console quits and gives me a nice old-fashioned C: prompt. ; )

I did double-check the User Accounts control panel in XP and was able to confirm that my account is, in fact, the administrator account, and that my account is in fact the only account on the computer... so I'm really not sure why it wouldn't accept my password, which obviously gets me into XP just fine.

Revision history for this message
idyllic (idyllic) said :
#6

Hmph, can u still boot into windows XP safemode? Go to regedit by clicking on Start button, select Run option then type "regedit" (without the quote). Then navigate to the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Setup\RecoveryConsole. Then Change the value of SecurityLevel value to 1. Then reboot.

Now the Recovery Console will no longer ask for a password.

Cheer,

Revision history for this message
Tony Pursell (ajpursell) said :
#7

Hi again,

If you are wondering why I didn't catch your reply, its because I'm in the UK and I was off to bed after I wrote to you.

To answer your question, yes, you probably will have to re-install Ubuntu when you can get the mbr repair done, but have you got any files on the external drive that you will want to recover?

You probably realise that if you want a dual boot system, you will need Ubuntu on your internal drive. That is what I have here at home. That is not to say you cannot use your external drive as storage space for Linux and mount it as and when you want to access it. However, you will have to repartition your internal drive to create enough space for all the Ubuntu system files and some working storage.

As I said before, there may be alternatives which allow you to boot Ubuntu on the external drive when it is attached, but that is a technical issue that is a bit beyond me at present.

Tony

Revision history for this message
Kakarot (ahsanghaffar101) said :
#8

No need to apologize! Your question is valid, and it's great that you've tried searching for solutions before reaching out.

It sounds like you're experiencing a common issue with the GRUB bootloader, which is used to select the operating system at startup. When the external USB HD with Ubuntu is disconnected or turned off, GRUB encounters an error (error 21) because it can't find the Ubuntu installation.

To resolve this issue, you can reconfigure GRUB to boot directly into Windows when the external HD is not available. Here's how you can do it:

Boot into Ubuntu when the external HD is connected and turned on.
Open a terminal window.
Run the command sudo nano /boot/grub/menu.lst to open the GRUB configuration file for editing.
Look for the section that defines the boot options for Ubuntu and Windows.
Find the line that starts with title Windows or something similar.

Below that line, add the following two lines:

map (hd0) (hd1)
map (hd1) (hd0)

These lines tell GRUB to remap the hard drive order, so it thinks the Windows drive is still the first one even when the external HD is disconnected.
Save the changes and exit the text editor.
Reboot your computer and test if you can boot into Windows without the external HD connected.
Please note that editing system files like this can be risky, so make sure to follow the instructions carefully. If you're uncomfortable with these steps, it's a good idea to seek assistance from someone more experienced with Linux.

These solutions are adapted from https://fescoebill.pk/ , where you can find further assistance and resources for troubleshooting. Let me know if you have any questions or need further assistance.

Can you help with this problem?

Provide an answer of your own, or ask MEC407 for more information if necessary.

To post a message you must log in.