Posts Tagged windows
Fixing Windows MBR with Ubuntu 8.04.1 Live-CD
UPDATE: This works on Ubuntu 8.10 Live-CD too, just boot the livecd and execute the install-mbr command
I’ve fixed MBRs before, using both the Windows install CD, and also using grub from an Ubuntu Live-CD. Today, neither of these worked on an HP 6710b laptop, where an Ubuntu partition (which contained grub) was removed (In favour of running Ubuntu inside Virtualbox). The Windows XP Professional CD didn’t detect any harddrives to fix, and grub kept on giving a “That is not a valid block device” error.
Many Google search results later, I found an article on arsgeek that showed how to use an Ubuntu package called ms-sys to put the MBR back. Boot the CD, add the universe repository, apt-get update, install ms-sys, run ms-sys. Sounded simple. After waiting for the update to happen, I finally try to install ms-sys, to no avail.
More Google search results, and it turns out that ms-sys was removed from Debian Unstable, and thus removed from Ubuntu Hardy’s repositories, due to “Unresolved licensing issues”.
Luckily, a comment on the bug entry asking why ms-sys was removed, pointed me to the mbr Ubuntu package that provides the same functionality as ms-sys.
So, how *does* one fix a Windows MBR with an Ubuntu 8.04.1 Live-CD? Simple (Works with older Live-CDs too, from Dapper onwards):
- Boot from the Live-CD
- Open up a Terminal and run: sudo vi /etc/apt/sources.list
And uncomment the 6 ‘universe’ repositories at the bottom - Run: sudo apt-get update
to update the local repositories - Run: apt-get install mbr
to install the mbr package - Run: install-mbr /dev/sda
where /dev/sda is your primary boot drive
This installs a default MBR to that drive
Easy.
Reboot and you’re set.
No hassling with grub or lilo or dd’ing some dodgy MBR downloaded from some site.
Yet another example of how Ubuntu saved some other commercial OS from destruction. (Previously Ubuntu helped me save a SUSE 10 machine’s harddrive…)
Pity about having to update to the universe repositories first, the mbr package really should be part of the live cd.

