How to ms-sys (Fix MBR / make Windows installer in Linux)

My experience with this involves a motherboard that uses BIOS, not UEFI. This topic assumes as such. EFI directions would be helpful if somebody would like to source those.

:ubuntu_mate: # Introduction
So you're done with Ubuntu MATE. That's alright, you can always try any Linux system again later! We enjoyed your company here while it lasted.

You remove it from your hard drive with gparted by deleting the Ext4 partition(s) you made, filling in that space by extending your NTFS partition and... oh $#^!.

The bootloader is broken; GRUB tries to find something which does not exist. You can't boot into Windows. You have no recovery media to fix it. Well, no worry. What you're done with can help you fix the master boot record and make your Windows session bootable again.

While recently unavailable for Debian systems due to Microsoft's meddling, you can still find older copies of ms-sys banging about on the internet, in various places. In the next section, ms-sys is provided via two mirrors for the two mainstream processor architectures in use; You can use it to replace the present Master Boot Record (MBR) with any of the ones provided via that tool.

:arrow_down: Download mirrors

:one: pCloud

Choose to download, not to save to pCloud account unless you already have an account to pCloud
ms-sys 2.4.2-0 32-bit
ms-sys 2.4.2-0 64-bit

:two: Dropbox

Dropbox may request registration for those without an account; click on the bottom No thanks, continue to view and proceed with download.
ms-sys 2.4.2-0 32-bit
ms-sys 2.4.2-0 64-bit

:install: Installing and using ms-sys

They are converted with Alien from RPM files. They have been tested on their respective architectures from live session to ensure they work.

:wrench: Repairing Windows' MBR

If the problem is only the MBR, here's what you need to do to replace it and fix the media WIndows is on:

  • Install one of the two Debian files above in your live session, per the architecture of the system
  • Do man ms-sys to read what MBR you need
  • Apply the MBR you want using the example command the ms-sys manual gave you, to the affected drive with Microsoft Windows
    • All versions of Windows 7, 8 and 10 can use the Windows 7 MBR
  • Reboot and see if that fixed your problem

If successful, your previous operating system's bootloader should be usable again, due to the MBR GRUB uses being superseded. Else, below are instructions on using GParted to make a new installation media for Windows.

:harddrive: Making a new Windows installation media (for USB)

If you need to format Windows and start fresh instead, you can perform the following;

  • Do gksu gparted and on a 4GB or higher USB media
  • write an MS-DOS partition table to your desired device (if necessary)
  • Write an NTFS partition onto it (if necessary)
  • Right-click on the partition, then enable the boot flag so you can boot into the drive later
  • Use ms-sys to write the MBR relative to the installation media for that USB stick (see above for installing and using it)
  • Download (if applicable) and unpack with engrampa the ISO for your version of Windows to the USB media

If all went well, you'll have a bootable Windows installer you can use to format and give yourself a fresh start, should something happened where fixing the MBR isn't enough.

:penguin: Else...

You could try Ubuntu MATE again, since after all, you're managing to make your Windows install accessible with a Linux system. That should show you how superior and less crippled in core function Ubuntu MATE, or any Linux distribution is compared to Windows.

Apologies for people who kept clicking on my mirror link for pCloud and continually being denied; When I manipulated my file system on pCloud, that appeared to had broken something, probably because pCloud doesn’t have files hosted in a central repository, then linked into different folders for each user. Or maybe because I’m stupid, either / or.

Dropbox is now included, just in case pCloud becomes broken again due to my meddling. And maybe, Dropbox makes it harder to break files you upload. I don’t know anymore, nor do I care.

PM me incessantly if you need the files and both mirrors are rendered unusable. Or, you could grab one of the various versions of ms-sys from pkgs.org and convert it with alien (preferably from a live session), should a Debian package for it exist which is not sufficient to fix Windows 7 / 8 / 10…

Reminder: This only applies to Master Boot Record-formatted partition tables.

Also, thanks for being awesome and having my converted packages installed over one-thousand times. Lots of you in the world seem to keep on messing your computers up, to which I hope this information has been helpful for you.