Ubuntu – Fix Windows MBR using Ubuntu Live CD and ms-sys tool

bootbootloaderlive-environmentmbr

I'm trying to fix the MBR using Ubuntu live CD. I already have the ms-sys installed but from the threads that I saw, I'm not completely sure in which /dev I should execute the command:

sudo ms-sys --mbr7 /dev/???

(is it mbr7 the correct option when using Windows 7?)

ubuntu@ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x1f205b1f

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          38          38           0    0  Empty
/dev/sda2   *        2048      206847      102400    7  HPFS/NTFS/exFAT
/dev/sda3          206848   155854847    77824000    7  HPFS/NTFS/exFAT
/dev/sda4       155854848   625137663   234641408    7  HPFS/NTFS/exFAT
ubuntu@ubuntu:~$ 

Why is /dev/sda1 empty?

I'm trying to fix the MBR because I'm getting a black screen when trying to load the operating system.

Best Answer

To restore the MBR, the accepted method is to use a Windows CD. We didn’t have that luxury. Fortunately we had a Ubuntu Live USB in hand.

The method to fix the MBR is:

  1. Boot the machine using the Live USB/CD.
  2. Install lilo sudo apt-get install lilo
  3. Fix the MBR using lilo using the command: sudo lilo -M /dev/sda mbr

Works like a charm!