Why does Windows setup lay down a new boot sector?

Raymond Chen

Why does Windows setup lay down a new boot sector? Because the alternative is worse.

You would expect that after installing an operating system, the operating system should boot. If your boot sector is damaged, say because this is a brand new hard drive with no boot sector, or because it was infected with a boot sector virus, you expect the operating system’s setup program to replace the boot sector with a good one. If it didn’t, you’d have an operating system that didn’t boot.

Not the greatest introduction to a new operating system.

I know some people are going to suggest, “Why doesn’t the setup program ask before overwriting the boot sector?” But think about it. It’s Christmas Day, you’re installing Windows XP on your computer, you go through the setup process, and it asks you a question you can’t answer. “Gosh, the computer says that I have a custom boot sector. It says that this could be for legitimate reasons, or it could be due to a virus. How the heck am I supposed to know the difference?” That’s assuming they even read the dialog. A much more realistic scenario is, “Eek! The computer is asking me a scary question! How do I cancel out of this? I hate computers. They’re so hard to use.”

Yes, this means that if you are an ultradweeb with a custom boot sector, you will lose it when you install Windows. But Windows isn’t picking on you. It even destroys itself. If you take a Windows XP machine and install Windows 2000 onto it, the Windows 2000 setup program will lay down a new boot sector that knows how to boot Windows 2000 but doesn’t know about Windows XP. You’ll have to restore the Windows XP boot files to restore that functionality.

[Update 9am: Even if Windows Setup did give you the option of “don’t overwrite the boot sector” you still wouldn’t like it. Windows Setup would get to the point where it lays down a new boot sector, and it says, “Ooh, an unrecognized boot sector, and the user said they want to leave it alone. Okay, I won’t touch it. Now, how do I tell the foreign boot sector where I installed this operating system?” Since the authors of Windows Setup are not clairvoyant, they don’t know what kind of boot sector you’re going to have, so they won’t know how to tell that foreign boot sector, “Please add ‘Windows’ to the list of known operating systems, and here is how you start it.” The result: You just installed an operating system and have no way to run it.]

Things are a little better starting with Windows XP Service Pack 2 and Windows Server 2003 Service Pack 1, though. Those and future versions of Windows setup check the version of the NTLDR file and will leave a newer version of the boot loader intact rather than overwriting it with an older version. Let’s just hope that you’re not installing because you need a fresh boot sector…

0 comments

Discussion is closed.

Feedback usabilla icon