It may happen that if you have windows installed on your system and you install Linux natively on it, your Windows boot loader gets lost. Your whole data will be there, just that you need to restore the boot loader… This is how you can do it:
- Insert your Windows installation CD (I tried with Windows 7).
- When you get to the second screen (after you choose your language) go to ‘Repair your computer’.
- Go to command prompt and type this in without the quotes (") :
- Press enter.
- Type this in without the quotes (") :
- Press enter
In case you install Windows after Linux (in my case, Ubuntu version), Linux boot loader (here, Grub) wont exist anymore. Here’s the quick and easy way to re-enable Grub:
- Boot off the Live CD
- Open a Terminal and type in the following commands, noting that the first command will put you into the grub “prompt”, and the next 3 commands will be executed there.
(where hd?,# is returned from find command)
- Reboot (removing the CD)
There are high chances that when you restore windows boot loader, the MBR would be rewritten (since windows doesn't want to recognize any other OS!). So its preferrable that windows should be installed first and then linux.
Queries & comments are always welcome!! :)
short and clear....nice wrk :)ReplyDelete
really informative , keep postingReplyDelete
@nishant, akshay: thnx!! :) :)ReplyDelete
Just a question, Why on earth would you even want to restore the Windows Bootloader (NTLDR) instead of Grub?ReplyDelete
Not only does it not detect any other OS, Grub is configurable, and much more stable! Plus, Grub can be rewritten and upgraded, Windows NTLDR is basically useless unless you are only running a single OS natively installed.
nice work nikita, really usefull blogReplyDelete
Nice work on the post.....though I'd just appreciate only the first 1/4th part of it.ReplyDelete
I agree with the information on recovering the windows boot loader. But in some cases, even BootRec.exe /fixmbr works and does not require BootRec.exe /fixboot.
BTW, I hope you noticed the .exe on BootRec.
Coming to recovering Grub...
You have not mentioned which Grub this recovery method is for. Grub Legacy or Grub2.
Anyways, it won't matter since this method won't work for the Ubuntu 10.04 Live CD since it does not have grub in the CD (apparently!), so "sudo grub" WILL give you the error "sudo: grub: command not found" for the Ubuntu 10.04 Live CD. Though I do agree that this method should work like a charm on other Linux flavours i.e. Fedora(particularly).
Plus, if you have Ubuntu 10.04(I have to be specific since there is no fail-proof method for all linux versions), then most probably NOTHING would work!!! and you might get your Grub back suddenly!!! The reason for this is still unknown.
Source: Personal Experience
@purujit: sorry for so late reply.. I couldn't check my blog for few days. As far as your ques is concerned that why would anyone like to recover windows bootloader instead of grub, many would like to do that. At least me... because for someone used to windows, switching over to linux completely is not feasible.ReplyDelete
@mayank: thanks a lot! :)ReplyDelete
@exotic-pulse: thanks for appreciating the first 1/4th part!!ReplyDelete
I agree that in some cases alone BootRec /fixmbr works and does not require BootRec /fixboot. But you require that in some cases. So no harm in using that I guess...
Coming on to the '.exe' part, i reloaded my windows 7 boot loader without using '.exe'. It works.
Thanks for your information on grub recovery. Frankly, I haven't tried this part... Just googled it. So I assume that since you have practical experience, you are right about this method not working for Ubuntu 10.04 Live CD.
Thanks for sharing your experience! :)
Sorry. I was a bit too harsh in my previous comment. LOL! Uhm... About BootRec.exe, I heard some of my friends say they got an "Element Not Found" error when they gave the command without the extension. Though that may be a one-of-a-kind case. I know that it should work without the extension. Just thought of bringing the anomalies to light... :DReplyDelete
@exotic-pulse: thats ok!! never mind! Thanks :)ReplyDelete
I agree, it certainly does seem as if you've just copied and pasted it from certain sources on the internet without trying it out yourself.ReplyDelete
Can you describe what each command does in the method for recovery that you've described?
Also, can you highlight the differences between the method you've described versus the method we used in the lab? Specifically, I'm interested in knowing which one is better in your opinion and why.