Tuesday, June 09, 2009

How to fix MBR using Ubuntu live CD

When we have dual boot there are some possibility that we might delete one of the partition, and causing deleting MBR as well. Issues can be easily fix using Windows CD, however you need to remember the password, if not ..

Ubuntu Live CD comes handy this case, just follow the following steps, you will be back in business.

  • Boot from Ubuntu Live CD
  • Then you need to download the ms-sys, you can find that from - http://packages.ubuntu.com/dapper/i386/ms-sys/download
  • Once downloaded it will ask for auto install, click that
  • Next type “sudo fdisk -l” , from that you can find the main partition you want to fix
  • Then type “sudo ms-sys -m /dev/sda”
  • Next restart, everything should work fine.

11 comments:

Jim said...

Way to go *sswipe. All I wanted to do was restore a boot option for my windows partition. Instead, I took your advice and the result was "ntldr not found"- NOT EVEN AN OPTION TO BOOT BACK INTO MY LINUX INSTALLATION. I ended up having to re-install Ubuntu a 2nd time, since I do not have any more disks to burn a Windows boot disk. What a waste of time. You NEVER should have advised to run ms-sys. There is a reason it has disappeared from the repository. Thanks a lot.

Deepal Jayasinghe said...

Hey Jim,

I am so sorry to hear that, I have posted the steps I followed to get my machine working. As I mentioned in the post everything worked fine with me.

Ernie said...

Worked like a charm. Thanks!

Michael said...

Can I perform this on the same partition as my ubuntu distro without messing it up? I have no bootable device when I try to boot up and I reinstalled grub and everything?

Ian said...

thanks, worked like a charm

Skuld said...

Really nice, it even worked on my Windows 7 Installation, when I had the problem that Bootrec.exe /fixboot via Win7 Installation CD gave the error "Command not found"!

Rodrigo said...

You have to select only the partition where the Windows OS is installed and then run the command

Mogurnda said...

Legendary!

Worked perfectly.

Thanks.

Ben said...

Worked very well on my Windows Vista system. I did an ubuntu install on an external device (SSD, connected to USB) but after disconnecting the USB SSD Grub ended in an error message.

Followed your instructions, all works great now ! Thanks !!

miro said...

Never thought I'd use an Ubuntu live CD again. Thanks!

khalid said...

i have deleted both operating systems. Now my lptp is booting only from ubuntu cd not windows. how to install windows now?