I ruined my Window's MBR by trying to install Ubuntu on a USB stick
I wanted to install Ubuntu on a USB stick, and apparently something went wrong with the mbr.
I was using a Windows machine at the time, inserted the Ubuntu live CD into the computer, installed Ubuntu on the USB stick but now the machine won't start unless the memory stick is connected to the computer! (I get a GRUB error, I can't remember the number of the error atm) Could anyone please help me? I know this is really a Windows problem but any help would be really appreciated. |
I believe if you boot Windows from the installation CD but choose "Recovery Console" instead of "Install" you can then use the 'fixmbr' command to fix the Windows boot sector.
NOTE: I haven't done this in years, but the procedure here is correct; it's just that the 'fixmbr' command might have a slightly different name. Cheers, Sasha |
If you have a Windows install CD, there is a program on it for repairing the MBR.
What version of Windows is it? This recent post gives more info if it is Vista. http://www.linuxquestions.org/questi...21#post3580221 There are solutions even if you don't have a Windows install CD. But most of us here don't remember enough details to talk you through that. The Microsoft documented solutions generally assume you have the install CD. |
I expect you accepted the default bootloader installation which is putting Grub stage1 file in the mbr of the disk listed first in boot priority in BIOS. During your installation of the bootloader with Ubuntu, you have an advanced tab you can click to get other options than the mbr. You should select root partition of the USB drive. When you want to boot Ubuntu, you will have to make the selection of the USB disk in the BIOS.
The suggestions above for fixing windows mbr should work for xp, w2k. vista uses a different bootloader and you can download EasyBCD to use to edit its bootloader. |
Quote:
I didn't really understand yancek's response- is it possible to fix the Windows bootloader from the Window's operating system or do I have to result to the Linux command line? (this is a pretty important problem so I want to get it right) |
Quote:
And use the rescue mode in the WINDOWS XP CD If you googled for it you will find a detailed information how to do it |
Quote:
|
If I understand correctly:
The OP does not have a Windows CD. The OP can currently boot Windows or Linux through grub when the USB device is present (but can't boot without the USB). I'm sure there is some downloadable program that can be downloaded and run in Windows that will fix the MBR for Windows XP. But I don't know what it is nor where to download it from. Fixing the Windows XP with command line tools you could download and run in Linux is also possible, but those are probably even harder to find. There may be a Windows recovery partition on the hard drive that would be an easier method to fix the MBR. In the Windows partitioning tools, the recover partition may be hidden of disguised. To find out if it is there (and to set up to use it) you should boot into Linux. First use gparted to examine the hard drive partition table. If you find the recovery partition, it should be easy to edit the /boot/grub/menu.lst file on the USB so that on the next reboot it gives you the option to boot from the recovery partition. If you have and boot from a recovery partition, that should act just like the install CD that you would have used if you had one. |
Ideas....
Thanks Mitchell7man :)
Unfortunately, in this case which now does not have the original XP CD, I am at a loss. I'm quite sure there's likely a way to repair the Windows bootloader without the CD, but unless someone can provide some info on how to do it (from their own experience would be good) then the OP might be at the mercy of whatever tool he/she can download from who-knows-where. What I am wondering though, is this: The machine will boot (Windows boots too I presume) when the USB drive is connected. Therefore, the Windows bootloader IS still intact *somewhere*, ie maybe it is on the USB drive's MBR? So, I wonder if reinstalling GRUB to the correct MBR (on the HDD) would allow the machine to boot without the USB stick. NOTE: This might cause a boot menu to appear from GRUB, however at least Windows ought to be bootable from the menu too. It would bridge the gap until you could maybe *find* your XP CD and repair the MBR the right way. NOTE: I don't know if this will work!!! It's just a theory. Don't try this until someone else with a more solid background with GRUB can provide some more help. Sasha |
http://www.linuxquestions.org/questi...10#post2299410
NOTE: The post I linked to here also claims that along with 'fixmbr' you will need to run the 'fixboot' command. I can't recall doing this when I borked Windows years ago, but it sounds logical. S |
You can download a program which will build the Windows Recovery Console on a bootable CD, which you can then boot and run fixmbr.
CAVEAT: I haven't tried this, or even d/l'd the file to validate it, but the site is reputable. |
Quote:
The bootloader will load the operation system (in layman's terms). The problem here is Grub (this would not have happened with Lilo). Grub only fits partially in the MBR and therefore is also partially somewhere else on the HD (in /boot). Wiping the partition or removing the USB stick makes that Grub can not continue after a certain point. Lilo fits fully in the MBR and therefore does not suffer from this problem. Some links if you're interested in further reading: google linux boot process explained http://itreviews.blogspot.com/2006/0...explained.html http://www.debianadmin.com/the-lniux...explained.html |
You can (try to) fix the MBR from within Windows. See http://schivmeister.wordpress.com/20...in-windows-xp/
|
Quote:
|
All times are GMT -5. The time now is 02:40 PM. |