Hegwin.Me

Thoughts grows up by feeding itself with its own words.

Windows 10 upgrade from Windows 7 dual boot with Ubuntu

Windows7 + Ubuntu 双系统下,如何升级到 Windows 10

I have a desktop computer purchased in 2014. It was a dual system of Windows 7 + Ubuntu 14.04 and I had been considering upgrading Windows 7 to Windows 10 for a long time, but there were potential problems with the process that made me hesitate to do so. I finally took the plunge and upgraded it recently, and I'll share my upgrade process here.

At the time I bought this computer, Microsoft had already released Windows 8, but Win 8 was not very popular among my community due to some radical modifications, so the seller conservatively installed Windows 7 Pro for me. I bought this PC mainly for entertainment, but I also use it occasionally for programming, so I installed Ubuntu 14.04 desktop (a Linux distribution) in addition to Win 7 to form a dual-system PC. Then I can switch to Linux when I need to do programming.

The problem

When installing Ubuntu, it comes with the installation of GNU GRUB, an operating system bootloader that allows the user to install the Linux OS along with Windows. After the installation is complete, the GNU GRUB interface will be available at boot time, allowing me to choose between a Windows or Ubuntu system, which is quite convenient.

3551681717090_.pic.jpg

But as a system boot program, GRUB needs to be written to the first physical sector of the master hard disk, so it also overwrites the Windows MBR, also known as the Master Boot Record, which is the first sector that must be read when the computer accesses the hard disk after booting. It contains the system boot information and if it is corrupted, then it will not be able to boot the operating system.

In such a context, if you rashly upgrade Windows or use its own system repair, it is likely that the contents of the C drive in Windows will be updated, but the Windows MBR will not be restored. This will create a disaster - the next time the computer boots up, the BIOS cannot find the operating system to boot through the MBR, and at this point you will not be able to access either Windows or Linux.

In this case there is a solution, we need to use a Windows DVD or a USB stick to repair the Windows MBR. In China, a more mainstream situation is that the repairer in the 3C market (or your programmer boyfriend) will use a USB stick containing Windows PE to repair the MBR in order to make the Windows OS boot and load properly.

Motivation to upgrade

I was motivated to upgrade for two reasons:

  1. I already have a MacBook Pro M1 as my programming workhorse, and I no longer rely on Ubuntu for writing code.

  2. The game I wanted to play, Swords and Fairy 7, did not support Windows 7, and its minimum system requirement was Windows 10; and World of Warcraft 10.0, which had various bugs on Windows 7, was relatively normal on Windows 10.

Sure enough, entertainment is the first productivity.

So, one of the contexts in which I upgraded Windows 7 to Windows 10 was that I could drop the Ubuntu system; therefore, I also needed to free up the hard drive partition occupied by Ubuntu and restore it to Windows.

Steps

Here are the steps how I removed Ubuntu safely and then upgraded Windows from 7 to 10.

  1. Check the files on the Ubuntu hard drive partition and back up the useful ones

  2. Recover the Windows bootloader: use MBRFix to repair the master boot record and replace it with the Windows bootloader

  3. Go back to Windows OS and use its "Disk Management" to format the hard disk space previously occupied by Ubuntu and then allocate it to Windows

  4. Buy Windows 10 activation code (please support genuine software) and download MediaCreationTool to upgrade to Windows 10.

The above is the main idea. Among them, we may encounter some other problems:

  1. Windows 10 upgrade has a certain demand for space on the C drive, if there is not enough space on the C drive, and the hard disk space you get from cleaning Ubuntu is not contiguous with the C drive, then its disk management tool cannot add the freed space to the C drive. At this point, we need to install an additional partition assistant tool, such as Aomei, which allows us to partition freely and its documentation is easy to understand.

  2. If there are some errors in the process of upgrading Win 7 to Win 10, for example, I encountered an error, its error code is 0x80072F8F-0x20000. At this point, we can go to Google or Bing and search for "Windows 10 + error code", and we can usually get the answer. For example, for my error, I downloaded a repair tool MicrosoftEasyFix51044 from the official website and ran it to solve it.

Repair MBR

We need to download a tool called MBRFix.exe from the internet, although the name suggests it is an executable file under Windows, it is actually a command line tool.

3541681717089_.pic.jpg

We need to access the Windows cmd utility to execute it. If your OS is on the first hard drive, by default the following command will solve the problem (please be careful):

MbrFix.exe /drive 0 fixmbr /yes

We can execute `MbrFix.exe /? to see the documentation, or check the instructions on his website. My suggestion is to use MbrFix.exe /drive 0 driverinfo to see the driver information first, and then run fixmbr to fix it.

Principle

Although I mentioned MBR before, I didn't get very specific, so I can elaborate on what happens when Win + Linux boots.

I will only talk about BIOS booting, which reads the MBR when booting and contains pointers to the bootloader and partition information; the bootloader for Linux is GRUB and the bootloader for Windows 7 is BCD; GRUB recognizes the Windows system and writes to the boot file, while BCD does not. A diagram to explain this is as follows:

Dual-OS-launch.png

< Back