{"id":71,"date":"2009-10-29T10:38:00","date_gmt":"2009-10-29T00:38:00","guid":{"rendered":"https:\/\/www.serenux.com\/?p=71"},"modified":"2021-01-14T10:40:02","modified_gmt":"2021-01-14T00:40:02","slug":"howto-restore-the-windows-master-boot-record-without-using-a-windows-cd-using-ubuntu-karmic","status":"publish","type":"post","link":"https:\/\/www.serenux.com\/index.php\/2009\/10\/29\/howto-restore-the-windows-master-boot-record-without-using-a-windows-cd-using-ubuntu-karmic\/","title":{"rendered":"HowTo: Restore the Windows Master Boot Record (without using a Windows CD) using Ubuntu Karmic."},"content":{"rendered":"\n<p>You know how it is \u2013 you take a client\u2019s Windows based machine, do a dual-boot installation of Ubuntu (which replaces the Windows Master Boot Record, or MBR, with GRUB and sets up an option to boot Ubuntu or Windows) so the client can evaluate Ubuntu, but then later on for whatever reason, Ubuntu is no longer wanted. It\u2019s removed and you need to restore the system\u2019s ability to natively boot Windows directly without a GRUB menu.<\/p>\n\n\n\n<p>You\u2019re probably thinking \u201cwhy the hell would anyone want to do that?!\u201d\u2026 well, the fact of the matter is you sometimes come across a client who is just too mind-set and refuses to use anything but Windows, so yes \u2013 sometimes you need to restore the Windows MBR, but how do you do that when you don\u2019t have a Windows CD handy?<\/p>\n\n\n\n<p>Well, here\u2019s how to do it using nothing but an Ubuntu 9.10 (or later) LiveCD.<\/p>\n\n\n\n<p>It\u2019s a little known fact that the Windows bootloader is nothing special. In fact it contains nothing proprietary to Windows at all. All the Windows bootloader does is simply look for the partition marked as \u201cbootable\u201d or \u201cactive\u201d and transfer control of the boot process to it.<\/p>\n\n\n\n<p>And would you know it? The Ubuntu LiveCD has a binary image of a generic open source bootloader that does just that!<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Boot your soon-to-be-Windows-only machine using the Ubuntu 9.10 (or later) LiveCD. Doesn\u2019t matter if it\u2019s the 32-bit or 64-bit version.<br><\/li><li>Once booted on the LiveCD, open a terminal by going to the Applications menu and then choose Accessories and then Terminal.<br><\/li><li>Find out what the designation of the Windows drive is (generally it will be the first drive, eg: \/dev\/sda or \/dev\/hda). If you are not sure, issue the command:<br><br><code>$ sudo fdisk -l<\/code><br><br>\u2026and review the output, looking for your NTFS Windows partition. Make note of the\u00a0<em>drive<\/em>\u00a0that partition resides on (not the partition itself), eg: \u201c\/dev\/sda\u201d,\u00a0not\u00a0\u201c\/dev\/sda1\u2033.\u00a0<br><\/li><li>Now type in the following (remembering to substitute the correct drive device name for your setup in place of \u201c\/dev\/sda\u201d):<br><br><code>$ sudo dd if=\/usr\/lib\/syslinux\/mbr.bin of=\/dev\/sda<\/code><br><br>\u2026which will write the image of a standard MBR contained in the \/usr\/lib\/syslinux directory of the LiveCD environment to the first hard-drive, overwriting GRUB.<br><br><span class=\"has-inline-color has-vivid-red-color\"><strong><em>WARNING: Do NOT use a partition designation, eg: \u201csda1\u2033 or \u201csda2\u2033, etc. This will overwrite the start of that partition which will effectively destroy data. The MBR exists at the start of the drive only, so only specify \u201csda\u201d with no number on the end.<\/em><\/strong>\u00a0<\/span><br><\/li><li>Shutdown and reboot. Windows should now start \u201cnatively\u201d without GRUB appearing at all.<br><\/li><li>Normally I\u2019d say \u201cpat yourself on the back\u201d here, but it\u2019s Windows\u2026\u00a0;-)<\/li><\/ol>\n","protected":false},"excerpt":{"rendered":"<p>You know how it is \u2013 you take a client\u2019s Windows based machine, do a dual-boot installation of Ubuntu (which replaces the Windows Master Boot Record, or MBR, with GRUB and sets up an option to boot Ubuntu or Windows) so the client can evaluate Ubuntu, but then later on for whatever reason, Ubuntu is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-71","post","type-post","status-publish","format-standard","hentry","category-tutorials"],"_links":{"self":[{"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/posts\/71","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/comments?post=71"}],"version-history":[{"count":1,"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/posts\/71\/revisions"}],"predecessor-version":[{"id":72,"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/posts\/71\/revisions\/72"}],"wp:attachment":[{"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/media?parent=71"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/categories?post=71"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.serenux.com\/index.php\/wp-json\/wp\/v2\/tags?post=71"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}