If there’s one complaint nearly everyone seems to have about Windows, it’s that it wants to reboot so frequently. Whether it’s for Windows updates or just when installing, uninstalling, or updating software, Windows will often ask to reboot.
Windows generally has to reboot because it can’t modify system files while they’re being used. Those files are locked, and can only be modified when they’re not being used.
What Does Rebooting Do?
Windows can’t update or remove files that are in-use. When Windows Update downloads new updates, it can’t apply them to Windows system files right away. Those files are in-use and locked against any changes. To actually install these updates, Windows has to shut down most of the operating system. Windows can then restart the system and load the updated files when it boots.
Reboots can also be necessary when updating or removing certain types of software. For example, if you’re using some sort of antivirus program or a hardware driver that hooks deep into the system, its files will be loaded into memory and protected against modification. When updating or removing in-use files, Windows may need to reboot the computer and modify the files before the system fully starts up.
Windows Update Reboots
Microsoft frequently releases patches for Windows, with most of them arriving on “Patch Tuesday,” the second Tuesday of each month. Most of these updates modify system files that can’t be updated while Windows is running, so they require a reboot. Not every Windows Update requires a reboot, however. For example, updates for Microsoft Office shouldn’t require a reboot — these files can be unloaded from memory by restarting Office.
Windows hassles you to reboot because the security updates aren’t actually installed until you do. Microsoft introduced pop-ups that bug you to restart your computer and even reboot the computer automatically back in the early days of Windows XP, when worms like Blaster, Sasser, and Mydoom were running wild. Microsoft wanted to ensure everyone would reboot quickly after getting the updates so they wouldn’t be infected. The updates wouldn’t help if people waited days or weeks before rebooting and became infected in the meantime.
Installing, Uninstalling, or Updating Software
Software programs sometimes want to reboot your computer when you install, uninstall, or update them. This can be because they use low-level system files and drivers that can’t be updated or removed on the fly. For example, let’s say you uninstall your antivirus program. The uninstaller probably won’t be able to remove all the files immediately, so you’ll need to reboot. The uninstaller will schedule file deletions, and Windows will automatically delete the files the next time the computer boots.
Some programs may also want you to reboot after you install them. For example, when you install an antivirus, it may want you to reboot immediately so it can watch over the startup process. Some low-level hardware drivers may require a reboot before they can function. Of course, it’s also possible that some program installers may ask you to reboot when it’s not really necessary.
How Windows Schedules File Moves and Deletes on Reboot
Windows offers an API that application developers can use to move, rename, or delete a file that’s in use. The application asks Windows to rename or move a file when the computer next reboots, and the request is written to the HKLM\System\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations value in the registry. When Windows boots up, it checks this registry key and performs any file operations programs have asked for.
You can view the list of pending file changes and schedule your own moves and deletions using the PendMoves and MoveFile SysInternals utilities. This allows you to delete and move files that you can’t delete because they’re currently in use. There are other utilities that offer to move or delete files on reboot, and they all work by writing to this Windows registry key. Some utilities also allow you unlock locked files and delete or move them, but these will cause problems if you attempt to unlock and modify files that the system depends on.
What About Linux and Other Operating Systems?
If you’ve ever used Linux or another operating system, you’ve probably noticed that Windows wants to reboot more often than it does. Linux just doesn’t bug you to reboot like Windows does, even after installing system updates. This is true, but it isn’t so simple.
On Windows, files that are in use are normally locked and can’t be modified or deleted. On Linux, in-use files can normally be modified or deleted. This means that, on a Linux system, those system library files can be updated immediately without a reboot. Any in-use files can likely be deleted immediately.
Here’s the catch: The changes won’t necessarily take effect until you reboot. For example, if you install an update for a system library, the files on disk will be updated immediately, but any running processes using that library will still be using the old, insecure version. If you update a program, the new version of that program won’t be used until you close the program and restart it. If you install a new Linux kernel, you won’t be using the new kernel until you reboot your computer and boot into the new kernel. There are some ways to switch to a new kernel without rebooting, but these generally aren’t used in consumer Linux systems and are more for servers that require maximum uptime.
In other words, a reboot is often still necessary to make sure important updates have taken effect on Linux. Sure, if you’re running a server and uptime is important to you, you can get around the need for updates by restarting affected processes. But, if you’re a normal desktop user, you’ll probably just want to reboot your computer.
The good news is that rebooting has become less necessary over time. Windows can now swap out many types of drivers — graphics drivers, for example — without rebooting the system. Modern security features (like having the Windows Firewall enabled) have made Windows more secure, so Windows 8 offers a three-day grace period for rebooting after Windows Updates.
Image Credit: SoniaT 360. on Flickr