Tag Archive for 'repair'

Repair Windows MBR with Ubuntu LiveCD

If something happens to your Windows Master Boot Record (MBR), here is a very quick and easy way to restore it with nothing but an Ubuntu LiveCD

WARNING: You are working with your disks in a very direct manner throughout this process. As always, having thorough and recent backups is essential.

  1. Boot into your Ubuntu LiveCD on the offending machine.
  2. Once Ubuntu has started up, go to System > Administration > Software Sources and enable the Universal Repository.
  3. Open a terminal session (Applications > Accessories > Terminal) and type sudo apt-get install ms-sys
  4. Now you need to figure out which partition is the one hosting your Windows operating system. Start by typing sudo fdisk -l in to Terminal window.
  5. From the resultant list of available partitions, you are looking for a partition that says something like:

    /dev/sda1 1 8619 94723115 81 NTFS

    The two important bits are the /dev/sda1 which is the partition label and the NTFS which tells us it is a Windows formatted partition. So, in this example, your Windows partition exists on the drive sda and it is at partition 1.

  6. We nned to fix the MBR on /dev/sda so type sudo ms-sys -m /dev/sda. You will need to change the sda text if your results from step 4 are different.
  7. Remove the LiveCD from the CD drive and reboot the machine. Windows should come back to you.

Of course, you could do this by inserting the correct Windows CD and booting into repair mode but the Ubuntu way doesn’t care about versions and is actually a bit faster.