Categorized | HowTo

How to fix your Windows MBR with an Ubuntu liveCD


Imagine some problem happened to a windows Master Boot Record (MBR- is the 512-byte boot sector that is the first sector (”LBA Sector 0″) of a partitioned data storage device such as a hard disk.)

 Do you know you can restore it completely with a Live CD ?

Caution: Make sure you have made a Back-Up of everything.

Step-by-Step Instructions

 

1. Boot into your Ubuntu LiveCD on the problematic machine. Once Ubuntu starts up, go to System -> Administration -> Software Sources and enable (by checking it off) the Universal repository.

2. Next, open a terminal session (Applications -> Accessories -> Terminal) and type the following:
sudo apt-get install ms-sys (program used to write Microsoft compatible boot records).

3. Figure out what partition is the one hosting your Windows operating system. Back in the command line, type:
sudo fdisk -l

4. That will list the available partitions. You’re looking for a partition that says something like
/dev/sda1 1 9327 74919096 83 NTFS.

5. The wanted bits are the ‘/dev/sda1‘ which is the partition itself and the ‘NTFS‘ which tells us it’s a Windows formatted partition. So your Windows partition exists on your drive sda and it’s partition 1. The MBR for drive sda (assuming you boot into windows using it’s native boot loader) is what you want to repair.
We want to fix the MBR on /dev/sda. You will want to, type:
sudo ms-sys -m /dev/sda.

6. You’ll want to change the ’sda’ bit if your results from ‘fdisk -l‘ are different.  If for instance your windows install is on sdb or hda.

7. After that, reboot the machine, after removing the LiveCD from the drive and Windows be coming right back.

8. yes ofcourse, you can also get this done by inserting the correct Windows CD and booting into repair mode from it – But the Ubuntu way a bit faster and I’m more likely to have an Ubuntu LiveCD on me than a Windows CD.

Leave a Reply

Subscribe to the RSS Feed
Subscribe to my feed via email:

Subscribe in your RSS reader of choice:

My Zimbio