Another easy-to-use one-click DD system script

Original link: https://meledee.com/2023/05/4254.html

I once wrote an article introducing “One-click DD Linux System Script” by the cute coffee boss . Now, a new one-key DD Linux system script is launched, which supports one-key DD conversion between any Redhat series system (such as CentOS, Oracle Linux, Rocky Linux, AlmaLinux, etc.) and Debian/Ubuntu system. At the same time, it completely solved the problem that the original version of Grub failed to boot and could only install CentOS 6.9, and strengthened the optimization of details such as IPv4 and IPv6 shunt disposal.

One-click DD system script


Prepare the script before running:

 # for Debian/Ubuntu 
  
apt update -y 
  
apt install wget -y 
  
 
  
#For CentOS/Alma Linux/Rocky Linux/Oracle Linux/Fedora/Vz Linux 
  
yum install wget -y

How to run the script?

 #Recommend to use this script, it is recommended to use wget --no-check-certificate -qO InstallNET.sh 'https://raw.githubusercontent.com/leitbogioro/Tools/master/Linux_reinstall/InstallNET.sh' && chmod a+ x InstallNET.sh 
  
 
  
#Domestic Gitee mirror, it is recommended to use wget --no-check-certificate -qO InstallNET.sh 'https://gitee.com/mb9e8j2/Tools/raw/master/Linux_reinstall/InstallNET.sh' && chmod a+ x InstallNET.sh

Default login information

 root #Default login username LeitboGi0ro #Default password 22 #Default ssh port# Warm reminder: If you have not customized the ssh password or port, please run the command passwd immediately after login to prevent unauthorized access.

Install Debian 9 or later, support Debian 9, Debian 10, Debian 11, Debian 12 (Debian 12 is not recommended for productivity environments)

 bash InstallNET.sh -debian 9/10/11/12

Install CentOS 7 or newer version, support CentOS 7, CentOS 8, CentOS 9(Stream)

 bash InstallNET.sh -centos 7/8/9-stream

Install AlmaLinux 8 or later, support AlmaLinux 8, AlmaLinux 9

 bash InstallNET.sh -almalinux/alma 8/9

Install Rocky Linux 8 or later, support Rocky Linux 8, Rocky Linux 9

 bash InstallNET.sh -rockylinux/rocky 8/9

Install Fedora 34 or later, support Fedora 34, Fedora 35, Fedora 36, ​​Fedora 37

 bash InstallNET.sh -fedora 34/35/36/37

Install Ubuntu 16.04 or later, support Ubuntu16.04, Ubuntu18.04, Ubuntu20.04, but not support Ubuntu20.04

 bash InstallNET.sh -ubuntu 16.04/18.04/20.04

Install Windows Server 2012 R2 Datacenter Edition

 bash InstallNET.sh -dd "https://dl.lamp.sh/vhd/cn_win2012r2.xz" #Chinese version bash InstallNET.sh -dd "https://dl.lamp.sh/vhd/en_win2012r2.xz" # English version

Install Windows Server 2019 Datacenter Edition

 bash InstallNET.sh -dd "https://dl.lamp.sh/vhd/cn_win2019.xz" #Chinese version bash InstallNET.sh -dd "https://dl.lamp.sh/vhd/en_win2019.xz" # English version

Install Windows Server 2022 Datacenter Edition

 bash InstallNET.sh -dd "https://dl.lamp.sh/vhd/zh-cn_win2022.xz" #Chinese version bash InstallNET.sh -dd "https://dl.lamp.sh/vhd/en-us_win2022 .xz" #English version

Windows system login information

 Administrator #default user Teddysun.com #default password

You can also customize the installation script

 bash InstallNET.sh -debian/ubuntu/centos/almalinux/rockylinux/fedora(OS Type) 11(OS Version) -version 64(OS Bit) -port "your server port" -pwd "your server password" -mirror "a valid url for linux image source" -dd/--image "dd image url" -filetype "gz or xz" -timezone "like Asia/Tokyo etc" --dhcp-static/--ip-addr 'xxxx'(ip address) --ip-mask 'xxxx'(subnet mask) --ip-gate 'xxxx'(gateway) -firmware(Debian with hardware drivers)

Commonly used custom parameters for scripts:

 -port "" 
  
#You can pre-designate the ssh port of the system, the range is 1~65535, both Redhat series and Debian series can support it, and the default is port '22'. 
  
 
  
-pwd'' 
  
#You can specify the ssh password of the system in advance, which can be supported by Redhat series or Debian series, and the default is 'LeitboGi0ro'. 
  
 
  
-dd/--image "DD image from a valid url" 
  
#This parameter is used in DD mode of KVM or XEN virtualization platform, the current operating system must be Debian series -filetype "gz/xz" 
  
#Determine the DD file type, not only ".gz" (default), but also ".xz" is supported. 
  
 
  
-timezone "like Asia/Shanghai etc" 
  
# This means assigning the timezone manually, if you use a proxy to connect to your machine and then execute "InstallNET.sh", the automatic timezone configuration may not work for you in this case. 
  
 
  
-raid "0" 
  
#Only applicable to raid 0 disk partition, if your machine has only one hard disk, don't specify it --network "dhcp/auto" or "static/manual" 
  
#By default, DHCP is used to complete network configuration. If your cloud service provider is a small or medium vendor, your machine's network may be static, so you need to add it. It is equivalent to adding --ip-addr "" --ip-mask "" --ip-gate "", if you add this, do not assign the following three items! It must be added at the end of the command . 
  
 
  
--ip-addr "IPv4 address": It must be added together with --ip-gate and --ip-mask, if you have added --dhcp-static, don't assign it again! 
  
--ip-gate "IPv4 gateway": It must be added together with --ip-addr and --ip-mask, if you have already added --dhcp-static, don't specify it again! 
  
--ip-mask "IPv4 subnet musk": It must be added together with --ip-addr and --ip-gate, if you have already added --dhcp-static, don't assign it again! 
  
--ip-dns "IPv4 DNS server": This is only suitable for static network configuration, the default is 1.0.0.1, you can also change other IPv4 dns servers, such as 8.8.8.8, 9.9.9.9, 4.4.2.2, etc. to replace it. If your machine's network is DHCP, don't assign it! 
  
 
  
-firmware 
  
#Debian specifies a driver that supports old hardware. If your server is in mainland China, the program will switch to the mirror of "University of Science and Technology of China (https://mirrors.ustc.edu.cn/debian-cdimage/)", For faster downloads, the default mirror is from http://cdimage.debian.org/cdimage/. 
  
 
  
-version 32/i386 or 64/amd64 or arm/arm64 
  
#Specify whether it is a 32-bit or 64-bit operating system. The program will automatically detect and redirect your machine's CPU architecture to the new system it will be installed on, if you don't know it, don't assign it! 
  
 
  
-mirror "a valid DIST mirror url" 
  
#Specify a source mirror address to speed up Linux installation

Officially recommended mirror source

 https://meledee.com/2022/12/4112.html #Includes well-known domestic mirror sites https://www.debian.org/mirror/list.html #Debian 
  
https://launchpad.net/ubuntu/+cdmirrors #Ubuntu 
  
https://www.centos.org/download/mirrors/ #CentOS 7/8-stream 
  
https://admin.fedoraproject.org/mirrormanager/mirrors/CentOS #CentOS 9-stream 
  
https://mirrors.almalinux.org/ #AlmaLinux 
  
https://mirrors.rockylinux.org/mirrormanager/mirrors #RockyLinux 
  
https://admin.fedoraproject.org/mirrormanager/mirrors/Fedora #Fedora

This article is transferred from: https://meledee.com/2023/05/4254.html
This site is only for collection, and the copyright belongs to the original author.