The most powerful universal system reinstallation script in history Windows and Linux one-click reinstallation script

Support Debian 12 raid 0 Ubuntu 22.04 AlmaLinux/RockyLinux/CentOS 9 Fedora 38 AlpineLinux Kali Windows Linux one-click reinstallation script Linux one-click reinstallation script, for the various scripts on the market support too few Linux distributions, based on BIOS or UEFI different motherboard firmware models

Support Debian 12 raid 0 Ubuntu 22.04 AlmaLinux/RockyLinux/CentOS 9 Fedora 38 AlpineLinux Kali Windows Linux one-click reinstall script

One-click reinstall script There are too few distribution types, and the path discrimination, validity recognition, and new menuentry boot menu writing of the grub boot menu based on different BIOS or UEFI motherboard firmware models are weak. It only supports IPv4 dhcp or only supports IPv4 static (I wonder if you have a grudge against people who use IPv6 when you were developing it?). It does not support IPv6 at all, dhcp or static IPv4. The detection of IPv6 network configuration and automatic correction of incorrect gateway settings in merchant templates have been deeply improved and optimized.

Many European oneman small businesses, even Hetzner Due to the extremely amateur technical level of network management, the static network mask settings of their template systems have fatal flaws. For example, IPv4 is set to 255.255.255.255, and IPv6 prefix is set to 128, which results in The IP address range that the installer and other network installation kernels look for is too narrow, triggering an unreachable gateway error. If it is read from the original system as is, without comparing and calculating and correcting it based on the main IP and gateway IP to obtain a suitable mask, or if the default template is based on the Red Hat system, reinstalling with other similar scripts will definitely cause such problems and cannot be solved.

As the highest link in the complete realization of server functions, network configuration is the aspect that my script focuses on improving. All supported Linux distributions, including dual-stack machines with IPv4 and IPv6, can automatically configure the network after reinstallation without manual configuration (if there are dual network cards with one network configured on each card, Debian also supports it at present), and there is no problem in supporting pure IPv6 machines (not including AlpineLinux/Ubuntu for the time being).

At present, the project has been recognized by many friends and supports Debian 9+, including Debian 12, the new version of AlmaLinux, RockyLinux,, Fedora, AlpineLinux , Ubuntu 20.04 22.04 and other systems, arm64 and amd64 architectures can be permanently installed, and Oracle's own Reinstall Linux and other Red Hat-like systems to any system supported by the script (Red Hat systems require higher memory, more than 2GB). Of course, they can also be installed to Windows. Reinstalling from Windows back to Linux is not supported yet.

Currently the script supports automatic detection of whether the machine is running Warp implements a "pseudo dual stack" and removes the IPv4 stack or IPv6 stack implemented by CloudFlare Warp to identify the native network stack status of the machine before reinstallation, avoiding the configuration of the network part during reinstallation and writing incorrect expected network stack parameters.

Linux one-click reinstall script

Github project: https://github.com/leitbogioro/Tools

Interface demonstration (the gallery is from imgur.com, and global access is required to display it normally):

The most powerful universal system reinstallation script in history Linux and Windows one-click reinstallation script-1
The most powerful universal system reinstallation script in history Linux and Windows one-click reinstallation script-2
The most powerful universal system reinstallation script in history Linux and Windows one-click reinstallation script-3
The most powerful universal system reinstallation script in history Linux and Windows one-click reinstallation script-4
The most powerful universal system reinstallation script in history Linux and Windows one-click reinstallation script-5

The desktop terminal client (terminal) for connecting to the server is only recommended to be downloaded from the official website, Xshell or putty. Do not use some terminals with extremely cool interfaces but extremely limited key exchange algorithms, unknown sources, strange, or even cracked terminals to connect to the reinstalled system, otherwise there is a high probability of password errors. What my script does is only to ensure that the target port and password are set, and it can be connected normally after reinstallation. Important operations such as key login can be set manually. Please do not rely on one-click scripts, and do not blame my script for reinstalling the system! Unknown clients may also secretly upload keys and use your machine as a zombie. If terminal software such as Xshell also has security issues in the future, I will also publicize it.

How to enable IPv6 on Oracle Cloud, and how to enable IPv6 DHCP access on the current machine after manually enabling IPv6 DHCP 6 in the web panel for machines with only IPv4 public network access:

Chinese Tutorial:

https://www.google.com/search?q=%E7%94%B2%E9%AA%A8%E6%96%87+%E5%BC%80%E5%90%AF+ipv6+%E8%AE%BF%E9%97%AE+%E6%AD%A5%E9%AA%A4

English Tutorial:

https://www.google.com/search?q=oracle+cloud+ipv6+public+access+enable

Get the network card name:

[root@instance-20230624-1531 ~]# ip -4 route show default
default via 10.0.0.1 dev ens3
default via 10.0.0.1 dev ens3 proto dhcp src 10.0.0.138 metric 100

If the current network card has DHCP IPv6 access rights, and the current system configuration file only regulates IPv4 network access and does not regulate IPv6 DHCP access, the command to enable DHCP IPv6 access (excluding IPv6 static access) in the system requires a restart:

dhclient -6 "Network card name such as ens3"
reboot

Remember to update the source and install the wget component before downloading. The following commands only apply to the original system:

Debian system (Debian Kali Ubuntu):

apt update apt update install wget -y

Red Hat series (CentOS AlmaLinux RockyLinux Fedora, etc.):

dnf install wget -y

AlpineLinux (need to install the wget bash component and change the system's default shell from ash to bash):

apk update apk install wget bash sed -i 's/root:\/bin\/ash/root:\/bin\/bash/g' /etc/passwd

Download and run the script:

wget --no-check-certificate -qO InstallNET.sh 'https://raw.githubusercontent.com/leitbogioro/Tools/master/Linux_reinstall/InstallNET.sh' && chmod a+x InstallNET.sh

Domestic machines can now be obtained from download:

wget --no-check-certificate -qO InstallNET.sh 'https://gitee.com/mb9e8j2/Tools/raw/master/Linux_reinstall/InstallNET.sh' && chmod a+x InstallNET.sh

Quick Start (This is only valid if the script does not include parameters such as -pwd -port -mirror. If it does, you must specify the release version number of the corresponding system!):

No need to enter which architecture to use(-v option has been replaced by -version, and both have been deprecated), the script will automatically detect the architecture and implement intelligent conversion between Debian and Redhat architecture names!

Debian 12 (supports 9 to 12)

bash InstallNET.sh -debian

Kali rolling (supports three branches: rolling/dev/experimental. In principle, rolling is recommended)

bash InstallNET.sh -kali

Kali is compatible with ARM64 and AMD64 architectures. Kali is compatible with ARM64 and AMD64 architectures. Although Oracle ARM installation will display a black screen after restarting the original system, and there is no prompt, and progress cannot be observed and debugged in VNC, as long as it is installed from the panel's own template or any other pure system installed with one-click scripts, 100% guarantees success. Don't be afraid of seeing a black screen in VNC, and don't reboot hard in the middle. If you don't know what Kali is, you know that Kali is often used by hackers in daily life, movies and TV series, and it comes with many security testing tools. It is a cool Debian distribution. Kali has three versions, arranged in order of radicality, namely experimental > dev > rolling. Ordinary people don't like to toss, so it's best to use rolling as the main method.

Alpine Linux edge (supports 3.16 to 3.18 and edge, edge is recommended)

A super lightweight Linux distribution, but it should be noted that Alpine Linux saves memory when running, and the memory usage is only about 80m, but it does not save memory when installing, because it will complete all initialization operations in memory until the end and then write the entire disk to the hard disk. Unlike Debian and Red Hat, the boot kernel is ready in memory, and then it starts to format the disk and write files from the image source to the hard disk. This results in the memory requirement for installing Alpine Linux is not low. Machines with less than 1GB of memory should not be installed. Since the Alpine Linux iPXE boot document only describes how to boot from an IPv4 network through DHCP or static, machines with only IPv6 public network access should not be installed. The IPv6 part of the dual-stack machine will be automatically configured during the installation process.

bash InstallNET.sh -alpine

CentOS 9 stream (supports 7-9)

bash InstallNET.sh -centos

AlmaLinux 9 (supports 8-9)

bash InstallNET.sh -alma

RockyLinux 9 (supports 8-9)

bash InstallNET.sh -rocky

Fedora 38 (37-38 supported)

bash InstallNET.sh -fedora

Ubuntu 22.04 (supports 20.04 or 22.04)

bash InstallNET.sh -ubuntu

Windows Server 2022 (based on dd implementation under AlpineLinux intermediary, supports automatic identification of corresponding dd packages under different BIOS UEFI firmware, supports Windows 10 Enterprise LTSC, Windows 11 Pro for Workstation 22H2, Windows Server 2012 R2, Windows Server 2016, Windows Server 2019, Windows Server 2022. When reinstalling, just enter the digital version number of the corresponding system. If you can log in to the system through VNC, you can automatically perform IPv4 static configuration and automatically expand the system disk partition. The dd package comes from Qiu Shui Yibing. Thanks again for his selfless dedication)

bash InstallNET.sh -windows

Thanks to Wang Jianbing's genius idea, I found AlpineLinux, a great dd intermediary system, which allowed me to show off:

Wang Jianbing Next Door Forum ID: https://hostloc.com/space-uid-35316.html
Wang Jianbing github homepage: https://github.com/bin456789/

The principle is too complicated to explain. If you are interested, please go to my separate post to learn more:

https://www.nodeseek.com/post-9558-1 (The technical principles for installing Ubuntu 22.04 and later versions, as well as my views and comments on "native network installation" and "dd installation")

Except for Ubuntu and Windows, other Linux distributions support self-selected mirror sources. The script only has official backup built in, and can distinguish between domestic and foreign machines. When reinstalling domestic machines, the configuration files that must be obtained through the Internet can also be connected to the gitee.com mirror of my project, ensuring that domestic machines will not get stuck or suffer from reinstallation during peak hours. .com is blocked by the Great Firewall.

The Linux systems that other scripts support reinstalling all support native installation by specifying mirror sources around the world. If you do not specify the source, the script will distinguish between foreign and domestic sources and automatically switch to the domestic source for the domestic VPS to avoid slow connections. If you want to manually specify the source, enter the system and the corresponding version, and add the parameter "-mirror", such as:

bash InstallNET.sh -debian 12 -mirror "http://ftp.riken.jp/Linux/debian/debian/"

Debian source list for countries and regions around the world:

https://www.debian.org/mirror/list.html

Kali source list for countries and regions around the world:

https://http.kali.org/README.mirrorlist

Kali official repository https://http.kali.org/ Because pure IPv6 access is not supported, the default foreign source selected in the script is Berkeley College in the United States https://mirrors.ocf.berkeley.edu/kali/ It is an academic institution, neutral and reliable, supports both IPv4 and IPv6 access, has large bandwidth and good download quality.

CentOS 7 and 8-stream, source list for countries and regions around the world:

https://www.centos.org/download/mirrors/

CentOS 9-stream and later source lists for countries and regions around the world:

https://admin.fedoraproject.org/mirrormanager/mirrors/CentOS

List of AlmaLinux sources in countries and regions around the world:

https://mirrors.almalinux.org/

List of RockyLinux sources in various countries and regions around the world:

https://mirrors.rockylinux.org/mirrormanager/mirrors

Fedora source list for countries and regions around the world:

https://admin.fedoraproject.org/mirrormanager/mirrors/Fedora

Default Passwordas follows:

LeitboGi0ro

Since AlpineLinux and Ubuntu use plain text (unencrypted ciphertext, only local variables are transmitted, not transmitted to other places, don't worry) to pass password parameters to the configuration file, adding special symbols may cause errors during sed processing, so the default passwords of AlpineLinux and Ubuntu are unified as LeitboGi0ro and cannot be modified for the time being.

To customize the password, add -pwd 'password content' to modify it. It is recommended to use single English quotation marks (' ') before and after the password field to prevent the shell from passing the password with special characters in double English quotation marks (" ") as a command and causing errors. Do not set it too long or too complicated, for example:

-pwd 'xiaoming'

In particular, if the password contains an English single quote ('), be sure to add ''' before the single quote to escape it. In other words, the following escaped characters are equivalent to a single quote:

'\''

In other words, the above symbols are equivalent to the ' symbol in the actual passwordFor example, if you want to set your password to 'xiaoming', then the following input is correct:

-pwd ''\''xiaoming'\'''

If you used the default password, please change it immediately after installation!

The default ssh port depends on the original system.For example, if the original system ssh port of your machine is 65432, and the newly installed system port number is also 65432, you can also add -port "port number" to modify it. It supports all supported Linux systems, ranging from "1-65535". If the original system port is wrong or cannot be determined, the backup value is:

22

example:

-port "12345"

If you wantForced dual network dynamicsTo configure, enter:

bash InstallNET.sh -debian 12 --network "dhcp"

If you wantForced dual network staticTo configure, enter:

bash InstallNET.sh -debian 12 --network "static"

Currently supports dual network cards, each with a static IPv4 or IPv6 configuration, the network configuration of both network cards in the newly installed system can be automatically configured, only for Debian/Kali:

The most powerful universal system reinstallation script in history Linux and Windows one-click reinstallation script-6

To facilitate friends who have multiple disks and dedicated servers, we support the establishment of soft raid in newly installed Debian/Kali/CentOS/AlmaLinux/RockyLinux/Fedora systems. Just enter -raid "method (support: 0 1 5 6 10)". Please select the corresponding raid method according to your needs.

Raid 0 and 1 require at least two disks;

Raid 5 requires at least three disks;

Raid 6, 10 requires at least four disks.

In principle, the capacity of each hard disk used to form a raid should be equal, otherwise the total capacity of the system will be limited by the smallest capacity hard disk in the raid. Any hard disk model and controller (whether vda sda nvme0n1 hda, etc.) can be used, as long as the capacity is equal and the number is sufficient, the corresponding raid array can be successfully formed without wasting space.

bash InstallNET.sh -debian 12 -raid "0"

-setdisk "hard disk name or all", supports installing the system on a certain hard disk, such as vdb sdc, etc., just enter the hard disk name; it can also be set to "all", in addition to installing the system on the default first readable and writable hard disk, you can also erase other hard disk spaces. This parameter conflicts with -raid, so don't give both.

bash InstallNET.sh -debian 12 -setdisk "all"

bash InstallNET.sh -debian 12 -setdisk "vda"

If you want to install in manual mode, such as for debugging, please enter (you must be able to access the machine using VNC). AlpineLinux Ubuntu is not supported:

bash InstallNET.sh -debian 12 --allbymyself

If you want to use netbootxyz manual mode to install a supported system, such as Archlinux, please enter (Not recommended, requiring that the machine must be accessible using VNC, only for x86_64 AMD64 architecture, BIOS firmware machines use it, Oracle UEFI firmware machines use netbootxyz to boot, please refer to this tutorial: https://zhuanlan.zhihu.com/p/97527349):

bash InstallNET.sh -netbootxyz

Now a parameter is enabled, --setipv6 "0", which specifies to forcibly turn off the loading of the IPv6 module during system installation. Setting it to 0 means turning it off, and specifying other values or not specifying it means loading the IPv6 module. Regardless of whether the machine actually has an IPv6 network, as long as --setipv6 "0" is set, the IPv6 module in the new system will be completely disabled and the IPv6 network will not be accessible. Please choose according to the actual situation. It is effective for some pure IPv4 machines from merchants such as Racknerd and Virmach, because these merchants' pure IPv4 machines will also be assigned a public IPv6 address by DHCP, and When resolving external website domain names, their IPv6 addresses will be forced to be returned. However, the machine does not have an IPv6 network, which causes network connection tools such as ping, wget, and curl to fail due to continuous attempts to connect to the IPv6 address. Forcing the new system not to load the IPv6 module can solve this problem. However, this will result in The module that loads the IPv6 network fails to start. Please go to /etc/nginx/ In the directory

# listen [::]:80 default_server;

Racknerd Virmach When installing on a pure IPv4 machine without specifying --setipv6 "0", wget always prioritizes connecting to IPv6, and only uses IPv4 after failing several times, resulting in a long connection wait.

The most powerful universal system reinstallation script in history Linux and Windows one-click reinstallation script-7

Comment out, this option applies to all Linux distributions except AlpineLinux

bash InstallNET.sh -debian 12 --setipv6 "0"

Now a parameter is enabled:--nomemcheck, after entering, the memory capacity check will be skipped, and you can try to install the target system on a machine with any memory, even if you can successfully download and package the network installation and boot kernel in the current system,However, there is no guarantee that the installation will be successful after restarting.

bash InstallNET.sh -debian 12 --nomemcheck

How to use this script to dd from Linux to Windows?

  1. Any based on For QEMU or XEN machines, regardless of whether the original system is Debian or Redhat, the grub boot menu can be successfully written and started after reboot:

bash InstallNET.sh -dd 'DD mirror link'

  1. Some dedicated servers that support multiple startup modes, such as rescue mode, normal mode, etc., such as Kimsufi, etc.:

Switch the boot mode to rescue mode, obtain the login account password from the mailbox, enter the rescue mode temporary system, and execute:

wget -O- 'DD mirror link' | xzcat | dd of=/dev/sda

Wait for the dd image to be downloaded and unzipped, change the boot mode to normal mode, enter the reboot command, and wait for the Windows system initialized by dd to complete.

reboot

Thanks to Mr. Qiushui Yibing for his selfless dedication. He has worked hard to produce a batch of mature Windows series dd images and provide direct links. From the temporary transfer Debian 12 format disk, the dd image source, connection details, and hardware requirements are all based on Mr. Qiushui Yibing's dd image.

Qiushui Yibing's blog: https://teddysun.com/
Qiushui Yibing github: https://github.com/teddysun/

Username: Administrator
Password: Teddysun.com
RDC(Remote Desktop) Port: 5900
Network: IPv4 DHCP is required
CPU: AMD64 architecture only, at least single core, dual core or above is better
Hard disk: at least 20GB, 50GB or above recommended, solid state drive is preferred
Memory: At least 2GB, 8GB or above is preferred

Windows dd package source:

BIOS motherboard firmware, MBR partition

Windows 11 Pro for Workstations 22H2

Simplified Chinese: https://dl.lamp.sh/vhd/zh-cn_windows11_22h2.xz
English: https://dl.lamp.sh/vhd/en-us_windows11_22h2.xz
Japanese: https://dl.lamp.sh/vhd/ja-jp_windows11_22h2.xz

Windows Server 2022 Datacenter

Simplified Chinese: https://dl.lamp.sh/vhd/zh-cn_win2022.xz
English: https://dl.lamp.sh/vhd/en-us_win2022.xz
Japanese: https://dl.lamp.sh/vhd/ja-jp_win2022.xz

Windows 10 Enterprise LTSC

Simplified Chinese: https://dl.lamp.sh/vhd/zh-cn_windows10_ltsc.xz
English: https://dl.lamp.sh/vhd/en-us_windows10_ltsc.xz
Japanese: https://dl.lamp.sh/vhd/ja-jp_windows10_ltsc.xz

Windows Server 2012 R2 Datacenter

Simplified Chinese: https://dl.lamp.sh/vhd/cn_win2012r2.xz
English: https://dl.lamp.sh/vhd/en_win2012r2.xz
Japanese: https://dl.lamp.sh/vhd/ja_win2012r2.xz

UEFI motherboard firmware, GPT partition

Windows 11 Pro for Workstations 22H2

Simplified Chinese: https://dl.lamp.sh/vhd/zh-cn_windows11_22h2_uefi.xz
English: https://dl.lamp.sh/vhd/en-us_windows11_22h2_uefi.xz
Japanese: https://dl.lamp.sh/vhd/ja-jp_windows11_22h2_uefi.xz

Windows Server 2022 Datacenter

Simplified Chinese: https://dl.lamp.sh/vhd/zh-cn_win2022_uefi.xz
English: https://dl.lamp.sh/vhd/en-us_win2022_uefi.xz
Japanese: https://dl.lamp.sh/vhd/ja-jp_win2022_uefi.xz

Windows 10 Enterprise LTSC

Simplified Chinese: https://dl.lamp.sh/vhd/zh-cn_win10_ltsc_uefi.xz
English: https://dl.lamp.sh/vhd/en-us_win10_ltsc_uefi.xz
Japanese: https://dl.lamp.sh/vhd/ja-jp_win10_ltsc_uefi.xz

Windows Server 2012 R2 Datacenter

Simplified Chinese: https://dl.lamp.sh/vhd/cn_win2012r2_uefi.xz
English: https://dl.lamp.sh/vhd/en_win2012r2_uefi.xz
Japanese: https://dl.lamp.sh/vhd/ja_win2012r2_uefi.xz

score

Leave a Reply

Your email address will not be published. Required fields are marked *