Reinstall Windows system as Linux (CentOS 7.9) server

Table of contents

Overview

Preliminary step one

Pre-step two

USB Part A

USB Part B

first start

second start

Installation Precautions


Overview

Use a USB flash drive to change the Windows operating system to CentOS 7.9 operating system!

Software: Laomaotao (download from Laomaotao official website), UltraISO

Preparation: a Windows system computer to be reinstalled , a personal computer , two USB flash drives (USB flash drive A, USB flash drive B) with a size of more than ten gigabytes, a Linux system image (CentOS 7.9 system image), and a backup of important data ( Subsequent operations do not include the backup process )

Note: If there is only one USB flash drive, it can be used as the second USB flash drive after the first USB flash drive is used and formatted.

Considering that the computer that needs to be reinstalled may be stuck, the driver is damaged, and there is no network, etc. , it is recommended that the following pre-steps be completed on the personal computer in advance.

Preliminary step one

Download Laomaotao to your personal computer , install it, and make USB flash drive A a Windows startup disk.

Steps to make USB flash drive A as a Windows startup disk : (omitted) Please check it yourself on the Laomaotao official website

Purpose: In order to enter PE on a computer that needs to be reinstalled, and use DiskGenius in Laomaotao PE to format each partition (because it is reinstalled into a Linux system, all disks must be formatted into FAT32 or exFAT file systems)

Question: Why not use DiskGenius to format the partition directly on the computer that needs to be reinstalled?

Answer: If you use DiskGenius directly on a computer that needs to be reinstalled, it will eventually be formatted to the disk with DiskGenius installed and the system disk, so it is a good choice to do it in PE.

Pre-step two

Download UltraISO to your personal computer , install it, and make USB flash drive B a CentOS boot disk.

Steps to make USB flash drive B as a Linux boot disk : Open UltraISO, click File in the upper left corner, click Open, and select the prepared CentOS image.

At this point, the CentOS image is loaded into UltraISO, click above to start, and click to write the hard disk image.

The writing method is default (USB-HDD+), click Portable Boot, click Write new drive boot sector, click Syslinux.

When finished, click Write below and wait until the progress bar is full and the writing is completed.

Complete the following steps on the Windows computer to be reinstalled

USB Part A

Insert USB flash drive A into the computer that needs to be reinstalled and turn it on (restart if it is already turned on). Depending on the computer model, different keys are used to enter the bios interface (for example, the key to enter the bios on DELL desktop computers is the delete key).

After entering the bios, find the boot option, set USB boot as the first startup item, use the arrow keys to find English words such as save, save and exit (pressing esc will also exit, but will not save).

After entering PE, format each partition (format into a Linux-adapted file system, NTFS cannot be selected, you can select FAT32 or exFAT, but the same partition format must be selected, all FAT32 or all exFAT, no mixed selection), select One-click Partition, custom, 1 partition (default system partition). After formatting the partition, shut down the computer and pull out USB flash drive A. The role of USB flash drive A ends here.

If you want to format USB flash drive A and use it as USB flash drive B, you should format it into the FAT32 or exFAT file system.

USB Part B

(You can format USB flash drive A and use it as USB flash drive B)

Insert USB flash drive B into the computer that needs to be reinstalled and turn it on. Since USB has been set as the first boot item, there is no need to enter the bios interface again.

first start

Select Install CentOS 7, press the Enter key, and a series of warning error messages will appear on the screen. Wait until "dracut:/#" appears at the bottom, enter cd dev and ls | grep sd (pipe redirection, redirect the output of the previous command) For input of the next command), some English words starting with sd will appear. Don’t worry about it for now. Pull out the USB disk and enter cd dev and ls | grep sd again . Some English words starting with sd will appear again.

cd dev
ls | grep sd

Compare the upper and lower sections and find out the difference. Since the USB flash drive is pulled out, the data in the USB flash drive will be missing from the lower section, and there will be more data from the upper section than from the lower section.

Record the English words starting with sd that are more at the top than at the bottom.

As shown in the figure, it is sda and sda4.

second start

Enter reboot to restart, and also select Install CentOS 7. At this time, instead of pressing the Enter key, press the Tab key on the keyboard (press the Tab key on desktop computers and the E key on laptops). A line ending with quiet appears at the bottom. , the first startup is to find the location where the CentOS image is stored so that you can modify this item.

Modify this item.

At the beginning " vmlinuz initrd=initrd.img inst.stage2=hd: " remains unchanged,

The " quiet " at the end remains unchanged,

In the middle, " LABEL=CentOS\x207\x20x86_64 " is changed to " /dev/sda4 " (fill in the extra sda4 recorded),

The complete version is " vmlinuz initrd=initrd.img inst.stage2=hd:/dev/sda4 quiet ".

Different environments are different, and it may not be sda4. It is recommended to try more.

Press the Enter key and click Next to successfully enter the graphical installation interface of the CentOS system.

Enter the installation interface. There are tutorials online for subsequent options, so I won’t go into details.

Installation Precautions

In the installation interface, "Software Selection" defaults to minimal installation. After installation, CentOS only has a command line interface. It is troublesome and inconvenient to change it to a graphical interface later.

Install CentOS 7.9 with a graphical interface in the installation interface

  1. Click "Software Selection"
  2. Under "Basic Environment" check " Server with GUI "
  3. Check " Development Tools " under "Additional options for the selected environment" to install the graphical interface.

If the above operations are not performed, CentOS 7.9 will be installed as a command line interface. At this time, if you want to change CentOS 7.9 from the command line interface to the graphical interface, you need to enter the following commands in sequence:

sudo yum groupinstall "GNOME Desktop" -y
sudo systemctl set-default graphical.target
sudo reboot

Installing the GNOME desktop environment may take a long time, please be patient.

After the installation is complete, you can enjoy a pleasant Linux journey!

Guess you like

Origin blog.csdn.net/m0_59302403/article/details/132119884