- How to Remove Linux and Install Windows on Your Computer
- Summary
- More Information
- Examples of Linux Partition Tables
- Single SCSI drive
- Multiple SCSI drives
- Single IDE drive
- Multiple IDE drives
- Скачивание пакетов дистрибутива подсистемы Windows для Linux вручную Manually download Windows Subsystem for Linux distro packages
- Скачивание дистрибутивов Downloading distributions
- Скачивание дистрибутивов с помощью командной строки Downloading distros via the command line
- Скачивание с помощью PowerShell Download using PowerShell
- Скачивание с помощью cURL Download using curl
- Установка дистрибутива Installing your distro
- Installing Windows and Linux On the Same Computer
How to Remove Linux and Install Windows on Your Computer
For a Microsoft Windows XP version of this article, see 314458.
Summary
This article describes how you can remove the Linux operating system from your computer, and install a Windows operating system. This article also assumes that Linux is already installed on the hard disk using Linux native and Linux swap partitions, which are incompatible with the Windows operating system, and that there is no free space left on the drive.
Windows and Linux can coexist on the same computer. For additional information, refer to your Linux documentation.
More Information
To install Windows on a system that has Linux installed when you want to remove Linux, you must manually delete the partitions used by the Linux operating system. The Windows-compatible partition can be created automatically during the installation of the Windows operating system.
IMPORTANT: Before you follow the steps in this article, verify that you have a bootable disk or bootable CD-ROM for the Linux operating system, because this process completely removes the Linux operating system installed on your computer. If you intend to restore the Linux operating system at a later date, verify that you also have a good backup of all the information stored on your computer. Also, you must have a full release version of the Windows operating system you want to install.
Linux file systems use a «superblock» at the beginning of a disk partition to identify the basic size, shape, and condition of the file system.
The Linux operating system is generally installed on partition type 83 (Linux native) or 82 (Linux swap). The Linux boot manager (LILO) can be configured to start from:
The hard disk Master Boot Record (MBR).
The root folder of the Linux partition.
The Fdisk tool included with Linux can be used to delete the partitions. (There are other utilities that work just as well, such as Fdisk from MS-DOS 5.0 and later, or you can delete the partitions during the installation process.) To remove Linux from your computer and install Windows:
Remove native, swap, and boot partitions used by Linux:
Start your computer with the Linux setup floppy disk, type fdisk at the command prompt, and then press ENTER.
NOTE: For help using the Fdisk tool, type m at the command prompt, and then press ENTER.
Type p at the command prompt, and then press ENTER to display partition information. The first item listed is hard disk 1, partition 1 information, and the second item listed is hard disk 1, partition 2 information.
Type d at the command prompt, and then press ENTER. You are then prompted for the partition number you want to delete. Type 1, and then press ENTER to delete partition number 1. Repeat this step until all the partitions have been deleted.
Type w, and then press ENTER to write this information to the partition table. Some error messages may be generated as information is written to the partition table, but they should not be significant at this point because the next step is to restart the computer and then install the new operating system.
Type q at the command prompt, and then press ENTER to quit the Fdisk tool.
Insert either a bootable floppy disk or a bootable CD-ROM for the Windows operating system on your computer, and then press CTRL+ALT+DELETE to restart your computer.
Install Windows. Follow the installation instructions for the Windows operating system you want to install on your computer. The installation process assists you with creating the appropriate partitions on your computer.
Examples of Linux Partition Tables
Single SCSI drive
Multiple SCSI drives
Single IDE drive
Multiple IDE drives
Also, Linux recognizes more than forty different partition types, such as:
FAT 16 > 32 M Primary (Type 06)
FAT 16 Extended (Type 05)
FAT 32 w/o LBA Primary (Type 0b)
FAT 32 w/LBA Primary (Type 0c)
FAT 16 w/LBA (Type 0e)
FAT 16 w/LBA Extended (Type 0f)
Note that there are other ways to remove the Linux operating system and install Windows than the one mentioned above. The preceding method is used in this article because the Linux operating system is already functioning and there is no more room on the hard disk. There are methods of changing partition sizes with software. Microsoft does not support Windows installed on partitions manipulated in this manner.
Another method of removing an operating system from the hard disk and installing a different operating system is to use an MS-DOS version 5.0 or later boot disk, a Windows 95 Startup disk, or a Windows 98 Startup disk that contains the Fdisk utility. Run the Fdisk utility. If you have multiple drives, there are 5 choices; use option 5 to select the hard disk that has the partition to be deleted. After that, or if you have only one hard disk, choose option 3 («Delete partition or logical DOS drive»), and then choose option 4 («Delete non-DOS partition»). You should then see the non-DOS partitions you want to delete. Typically, the Linux operating system has two non-DOS partitions, but there may be more. After you delete one partition, use the same steps to delete any other appropriate non-DOS partitions.
After the partitions are deleted, you can create partitions and install the operating system you want. You can only create one primary partition and an extended partition with multiple logical drives by using Fdisk from MS-DOS version 5.0 and later, Windows 95, and Windows 98. The maximum FAT16 primary partition size is 2 gigabytes (GB). The largest FAT16 logical drive size is 2 GB. For additional information, click the article number below to view the article in the Microsoft Knowledge Base:
105074 MS-DOS 6.2 Partitioning Questions and Answers
If you are installing Windows NT 4.0 or Windows 2000, the Linux partitions can be removed and new partitions created and formatted with the appropriate file system type during the installation process. Windows allows you to create more than one primary partition. The largest partition that Windows NT 4.0 allows you to create during installation is 4 GB because of the limitations of the FAT16 file system during installation. Also, the 4-GB partitions use 64-KB cluster sizes. MS-DOS 6.x and Windows 95 or Windows 98 do not recognize 64-KB cluster file systems, so this file system is usually converted to NTFS during installation. Windows 2000, unlike Windows NT 4.0, recognizes the FAT32 file system. During the installation of Windows 2000, you can create a very large FAT32 drive. The FAT32 drive can be converted to NTFS after the installation has completed if appropriate.
Скачивание пакетов дистрибутива подсистемы Windows для Linux вручную Manually download Windows Subsystem for Linux distro packages
Существует несколько сценариев, в которых вы не сможете (или не захотите) устанавливать дистрибутивы WSL Linux с помощью Microsoft Store. There are several scenarios in which you may not be able (or want) to, install WSL Linux distros via the Microsoft Store. В частности, вы можете использовать номер SKU классической ОС Windows Server или Long-Term Servicing (LTSC), который не поддерживает Microsoft Store, или политики корпоративной сети и административные параметры, запрещающие использовать Microsoft Store в вашей среде. Specifically, you may be running a Windows Server or Long-Term Servicing (LTSC) desktop OS SKU that doesn’t support Microsoft Store, or your corporate network policies and/or admins to not permit Microsoft Store usage in your environment.
В таких случаях, когда подсистема WSL доступна, как скачать и установить дистрибутивы Linux в WSL, если нет доступа к магазину? In these cases, while WSL itself is available, how do you download and install Linux distros in WSL if you can’t access the store?
Примечание. Среды оболочки командной строки, в том числе дистрибутивы Linux/WSL, Cmd и PowerShell не могут выполняться в S-режиме Windows 10. Note: Command-line shell environments including Cmd, PowerShell, and Linux/WSL distros are not permitted to run on Windows 10 S Mode. Это ограничение существует, чтобы обеспечить целостность и безопасность, которые предоставляет S-режим. Дополнительные сведения см. в этой записи блога. This restriction exists in order to ensure the integrity and safety goals that S Mode delivers: Read this post for more information.
Скачивание дистрибутивов Downloading distributions
Если приложение Microsoft Store недоступно, вы можете скачать и вручную установить дистрибутивы Linux, щелкнув следующие ссылки: If the Microsoft Store app is not available, you can download and manually install Linux distros by clicking these links:
Это приведет к скачиванию пакетов .appx в выбранную папку. This will cause the .appx packages to download to a folder of your choosing. Следуйте инструкциям по установке скачанных дистрибутивов. Follow the installation instructions to install your downloaded distro(s).
Скачивание дистрибутивов с помощью командной строки Downloading distros via the command line
При желании вы также можете скачать предпочтительные дистрибутивы с помощью командной строки. If you prefer, you can also download your preferred distro(s) via the command line:
Скачивание с помощью PowerShell Download using PowerShell
Чтобы скачать дистрибутивы с помощью PowerShell, используйте командлет Invoke-WebRequest. To download distros using PowerShell, use the Invoke-WebRequest cmdlet. Ниже приведены инструкции по скачиванию Ubuntu 16.04. Here’s a sample instruction to download Ubuntu 16.04.
Если загрузка занимает много времени, выключите индикатор выполнения, задав $ProgressPreference = ‘SilentlyContinue’ . If the download is taking a long time, turn off the progress bar by setting $ProgressPreference = ‘SilentlyContinue’
Скачивание с помощью cURL Download using curl
Обновление Windows 10 Spring 2018 (или более поздней версии) содержит популярную служебную программу командной строки cURL, с помощью которой можно вызывать веб-запросы (например, команды HTTP GET, POST, PUT и т. д.) из командной строки. Windows 10 Spring 2018 Update (or later) includes the popular curl command-line utility with which you can invoke web requests (i.e. HTTP GET, POST, PUT, etc. commands) from the command line. Вы можете использовать curl.exe , чтобы скачать приведенные выше дистрибутивы: You can use curl.exe to download the above distros:
В приведенном выше примере выполняется curl.exe (а не только curl ), чтобы убедиться, что в PowerShell вызывается реальный исполняемый файл cURL, а не его псевдоним для Invoke-WebRequest. In the above example, curl.exe is executed (not just curl ) to ensure that, in PowerShell, the real curl executable is invoked, not the PowerShell curl alias for Invoke-WebRequest
Примечание. Использование curl может быть предпочтительным, если необходимо вызвать или создать сценарий для скачивания с помощью командлетов командной строки и сценариев .bat / .cmd . Note: Using curl might be preferable if you have to invoke/script download steps using Cmd shell and/or .bat / .cmd scripts.
Установка дистрибутива Installing your distro
Если вы используете Windows 10, вы можете установить дистрибутив с помощью PowerShell. If you’re using Windows 10 you can install your distro with PowerShell. Просто перейдите в папку, содержащую скачанный выше дистрибутив, и в этом каталоге выполните следующую команду, в которой app_name — это имя APPX-файла дистрибутива. Simply navigate to folder containing the distro downloaded from above, and in that directory run the following command where app_name is the name of your distro .appx file.
Если вы используете Windows Server или у вас возникли проблемы с выполнением приведенной выше команды, можно найти альтернативные инструкции по установке на странице документации Windows Server, чтобы установить файл .appx , изменив его на ZIP-файл. If you are using Windows server, or run into problems running the command above you can find the alternate install instructions on the Windows Server documentation page to install the .appx file by changing it to a zip file.
После установки дистрибутива следуйте обычным инструкциям по * обновлению WSL 1 до WSL 2 или создайте новую учетную запись пользователя и пароль. Once your distribution is installed, follow the normal instructions to * Update from WSL 1 to WSL 2 or create a new user account and password.
Installing Windows and Linux On the Same Computer
Today’s Best Tech Deals
Picked by PCWorld’s Editors
Top Deals On Great Products
Picked by Techconnect’s Editors
SabrinaSouza asked the Answer Line forum how to install Linux onto a PC without losing Windows.
You can pick from many versions of Linux, but I’ll confine my instructions here to Ubuntu. It’s popular, it’s powerful, and it plays well with Windows.
There are other versions that I’ll recommend for specific jobs (such as diagnosing an unbootable PC), but for learning Linux and possibly using it for productive work, Ubuntu is the best choice I know.
You download Ubuntu in the form of an .iso file, which is an image file of a CD—in this case a bootable one. Double-click the file, and a program will likely come up and walk you through the process of burning the disc.
If no such program pops up, download and install the Active@ ISO Burner, then try again.
Another option: Use the Universal USB Installer to create a bootable flash drive out of that same .iso file. I actually prefer the flash drive; it’s faster.
So what can you do with this CD or flash drive? Plenty, but I’ll give you three options:
Just Boot It
Ubuntu is a live version of Linux. You don’t have to install it. You can simply boot it from the CD or flash drive, and, when asked, say you want to run rather than install Ubuntu.
This works for getting a feel for the operating system, but not for actual work. For instance, the contents of Ubuntu’s Document folder disappears when you reboot.
Install Ubuntu Within Windows
You can actually install Ubuntu as a Windows program, although you can’t launch it as one.
Insert the CD or flash drive. If nothing starts up automatically, open the drive in Windows Explorer and run wubi.exe. Select the option Install inside Windows, and follow the prompts.
When you reboot after the install, your PC will boot Linux and start setting it up. This can take a long time—especially if you’re using a CD. Be patient.
The next time you boot, and with every boot afterwards, you’ll get to pick between Windows and Ubuntu. And you can uninstall Ubuntu like any other Windows program.
Install Ubuntu in a Virtual Machine
You can run both OSes simultaneously by installing Ubuntu inside a virtual machine (VM). In a VM, software imitates hardware so that you effectively run one computer inside another.
I can recommend two free VM programs: VMware Player and Oracle VM VirtualBox. Ubuntu installs just fine in either of them. VirtualBox is more powerful, but I find VMware Player easier for the virtual machine novice. (Yes, I know that I recommended VirtualBox just last week, but that was for a Windows 8-specific job.)
By the way, you don’t actually need to burn a CD or prepare a flash drive to install Ubuntu inside a virtual machine. Both VMware Player and Oracle VM VirtualBox can install directly from the .iso file.