Update README.md

This commit is contained in:
Molly Lau 2022-11-28 05:22:31 +09:00 committed by GitHub
parent c5e315966c
commit 50d2e85054
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

225
README.md
View file

@ -1,19 +1,27 @@
# Tools
Something about scripts
# Linux reinstall useage
## Features:
## Features and updates:
- "InstallNET.sh" will give you a clean, safe, official Linux system, and help you escape of your server providers' monitoring.
- The operation is easy, several minutes installation will be complated.
- Support Debian 8+, Ubuntu 14.04+, CentOS 6.
- Support install to Debian 8+, Ubuntu 14.04~20.04, Redhat series(including CentOS 7+, Almalinux 8+, Rockylinux 9+, Fedora 34+).
- Can also run in mainline version of other redhat series(Oracle Linux, VzLinux) to install supported system.
- Support major cloud providers, especially support Oracle Cloud ARM machine.
- Detect the CPU architecture of current os automatically, you need not to add parameter '-v' to comfirm architecture manually.
- Can handle boot item automatically of grub2 in different hardware platforms(AMD64 legacy/AMD64 UEFI/ARM64 UEFI) to make sure all supported bootfile can be loaded correctly.
- Support install from Linux to Windows. details refer to "How to install Windows?" section.
- Support single-stack(only have IPv6 public address) server like Vultr 2.5$/mo model, only for DHCP.
- Support network auto configurations in bio-stack(have both IPv4 and IPv6 public address), after log into system, you don't have to config IPv6 address manually, only for Debian, DHCP.
- You can modify architecture, mirror, firmware, ssh port, password etc.
- Friendly to low memory machine(recommend RAM above 256MB), <b>If your machine RAM is less than 768MB, before Debian 11 and above version installation, you may should not bash it with "-firmware" or "-firmware --cdimage" parameters because it won't let machine installation go into low memory mode and causes installation failed!</b>
- Friendly to low memory machine, for debian series, recommend RAM is above 512MB, for redhat series, recommend RAM is above 2GB.</b>
- Ubuntu 22.04 has cancelled net boot start features, so this program don't support Ubuntu 22.04 and above reinstallation(source: https://www.reddit.com/r/Ubuntu/comments/uroape/is_there_a_netbootiso_equivalent_for_2204_jammy/).
- South Korea debian official mirror(http://ftp.kr.debian.org/debian/) is usually crashed down, so I change mirror of Kyoto University to replace it. Japan debian mirror is from https://www.riken.jp/, a science research organization in Japan. America debian mirror is from Massachusetts Institute of Technology: https://web.mit.edu/.
- South Korea debian official mirror(http://ftp.kr.debian.org/debian/) is usually crashed down, so I change recommend mirror for Jaist University to replace it. Japan recommend debian mirror is from https://www.riken.jp/, a science research organization in Japan. America recommend debian mirror is from University of California, Berkeley: https://www.berkeley.edu/.
- Completely modified debian, such as support terminal files colorful displaying, permanently change dns server, disable expired certificates, add on a cute welcome introduction, pre-install many complements in preseeding progress, now enjoy a newly, comfortable, graceful debian experience!
- Support grub2 boot file modify, it can switch debian to Redhat or switch Redhat to debian smoothly, in old version if you installed from debian to redhat, you will no more switch to debian.
- Support xfs file system(only for Debian 9 and later), it's better than the old ext2 and it's the default option of redhat series.
- Detect if the machine is operating in mainland of China or outside and switch mirror automatically.
- Support the parameter of '-port' to modify ssh port of redhat series.
- Detect the network of machine is DHCP or static automatically.
![1](1.jpg)
@ -22,57 +30,61 @@ Something about scripts
to make changes validating!
## Defects:
- Debian preseeding process can only config one IP address, for bio-stack machine(both have IPv4 and IPv6 address), after loggin to new system, you can realize that only IPv4 address has been configurated, we need to config IPv6 address manually.
<br />
edit network interfaces:
<br />
<br />
<pre><code>vim /etc/network/interfaces</code></pre>
add ipv6 configurations:
<br />
<br />
<pre><code>iface ens3 inet6 static
address ::1
netmask 64
dns-nameservers 2606:4700:4700:0:0:0:0:6400</code></pre>
In above sample, you just need to change "::1" to your own IPv6 address which assigned by your cloud provider. "netmask" 64 is a typical value, "dns-nameservers" is from Cloudflare.com.
<br />
<br />
Save files and restart system.
<br />
<br />
<pre><code>:wq
reboot</code></pre>
<br />
- "InstallNET.sh" doesn't support pure IPv6 stack machine(have no IPv4 address, such as Vultr.com 2.5$/month plan).
- Don't support Ubuntu 22.04(jammy) and later, because Canonical deprecated netboot file and force users to use its fuckin cloud-init, it must virtualization demanded but most of VPS can't support.
- For redhat series 8, the minimum memory requirement is 2.5GB, for redhat series 9, the minimum memory requirement is 2GB.
- Because the syntax of grub1 in CentOS 6 is different from other version of grub1 or grub2 completely, so I removed support to CentOS6 or Oracle Linux 6.
## Download:
<pre><code>wget --no-check-certificate -qO InstallNET.sh 'https://raw.githubusercontent.com/leitbogioro/Tools/master/Linux_reinstall/InstallNET.sh' && chmod a+x InstallNET.sh</code></pre>
## Dependences:
Debian series(Debian/Ubuntu):
<pre><code>apt update -y</code></pre>
<pre><code>apt install xz-utils dnsutils wget file efibootmgr -y</code></pre>
Redhat series(CentOS/Almalinux/Rockylinux/Oraclelinux/Fedora):
<pre><code>yum update --allowerasing -y</code></pre>
<pre><code>yum install xz dnsutils wget file efibootmgr -y</code></pre>
## Quickly start
If you need to add other parameters, version number must be assigned!
### Debian 11
<pre><code>bash InstallNET.sh -debian</code></pre>
### CentOS 9 stream
<pre><code>bash InstallNET.sh -centos</code></pre>
### Almalinux 9
<pre><code>bash InstallNET.sh -almalinux</code></pre>
### RockyLinux 9
<pre><code>bash InstallNET.sh -rockylinux</code></pre>
### Fedora 37
<pre><code>bash InstallNET.sh -fedora</code></pre>
### Ubuntu 20.04
<pre><code>bash InstallNET.sh -ubuntu</code></pre>
## Fully useage sample
<pre><code>bash InstallNET.sh -d/u/c(os type) 11(os version) -v 64(os bit) -port "your server port" -pwd "your server password" -a(auto install)/m(manually in VNC) -mirror "a valid url for OS image source" --ip-addr 'x.x.x.x'(ip address) --ip-mask 'x.x.x.x'(subnet mask) --ip-gate 'x.x.x.x'(gateway) -firmware(with hardware drivers) --cdimage "cn"(this option is only for Debian)</code></pre>
<pre><code>bash InstallNET.sh -debian/ubuntu/centos/almalinux/rockylinux/fedora(os type) 11(os version) -v 64(os bit) -port "your server port" -pwd "your server password" -a(auto install)/m(manually in VNC) -mirror "a valid url for OS image source" --dhcp-static --ip-addr 'x.x.x.x'(ip address) --ip-mask 'x.x.x.x'(subnet mask) --ip-gate 'x.x.x.x'(gateway) -firmware(with hardware drivers)</code></pre>
## Parameters Descriptions
**-d** : Debian
**-debian 9/10/11** : Debian 9 and later
<br />
<br />
**-u**: Ubuntu
**-centos 7/8/9**: CentOS 7 and later
<br />
<br />
**-c**: CentOS
**-almalinux/alma 8/9**: AlmaLinux 8 and later
<br />
<br />
**32/i386 or 64/amd64 or arm64**: OS bit
**-rockylinux/rocky 8/9**: RockyLinux 8 and later
<br />
<br />
**-centos**: CentOS 7 and later
<br />
<br />
**-ubuntu 16.04/18.04/20.04**: Ubuntu from 16.04 to 20.04
<br />
<br />
@ -80,23 +92,34 @@ Redhat series(CentOS/Almalinux/Rockylinux/Oraclelinux/Fedora):
<br />
<br />
for Debian, official recommend mirror lists are here:
For Debian, official recommend mirror lists are here:
<br />
<pre><code>https://www.debian.org/mirror/list.html</code></pre>
<br />
for Ubuntu, official recommend mirror lists are here:
<br />
<pre><code>https://launchpad.net/ubuntu/+cdmirrors</code></pre>
<br />
for CentOS, official recommend mirror lists are here:
For CentOS, official recommend mirror lists are here:
<br />
<pre><code>https://www.centos.org/download/mirrors/</code></pre>
<br />
**-firmware or -firmware --cdimage "cn"**: specify hardware drivers for Debian, if your server location is in mainland China, you can prefer it to mirror of 'University of Science and Technology of China(https://mirrors.ustc.edu.cn/debian-cdimage/)' for downloading more quickly, default mirror is from http://cdimage.debian.org/cdimage/.
For Almalinux, official recommend mirror lists are here:
<br />
<pre><code>https://mirrors.almalinux.org/</code></pre>
<br />
For RockyLinux, official recommend mirror lists are here:
<br />
<pre><code>https://mirrors.rockylinux.org/mirrormanager/mirrors</code></pre>
<br />
For Fedora, official recommend mirror lists are here:
<br />
<pre><code>https://admin.fedoraproject.org/mirrormanager/mirrors/Fedora</code></pre>
<br />
For Ubuntu, official recommend mirror lists are here:
<br />
<pre><code>https://launchpad.net/ubuntu/+cdmirrors</code></pre>
<br />
**-port**: you can pre-specify ssh port of system, range is 1~65535, **default is '22'**.
@ -119,143 +142,67 @@ for CentOS, official recommend mirror lists are here:
<br />
<br />
## Quickly start
### Debian 8
<pre><code>bash InstallNET.sh -d 8 -v 64 -a</code></pre>
### Debian 9
<pre><code>bash InstallNET.sh -d 9 -v 64 -a</code></pre>
### Debian 10
<pre><code>bash InstallNET.sh -d 10 -v 64 -a</code></pre>
### Debian 11 (prefer mirror manually with firmware, recommend for servers which are locating in mainland China)
Tsinghua University:
**-firmware: specify drivers for Debian to support old hardwares, if your server location is in mainland China, you can prefer it to mirror of 'University of Science and Technology of China(https://mirrors.ustc.edu.cn/debian-cdimage/)' for downloading more quickly, default mirror is from http://cdimage.debian.org/cdimage/.
<br />
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "https://mirrors.tuna.tsinghua.edu.cn/debian/" -firmware --cdimage "cn"</code></pre>
<br />
for low memory(less than 768MB) machines, you can bash:
<br />
<br />
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "https://mirrors.tuna.tsinghua.edu.cn/debian/" -dnserv "cn"</code></pre>
<br />
Netease, Inc:
<br />
<br />
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://mirrors.163.com/debian/" -firmware --cdimage "cn"</code></pre>
<br />
for low memory(less than 768MB) machines, you can bash:
<br />
<br />
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://mirrors.163.com/debian/" -dnserv "cn"</code></pre>
<br />
Tencent Cloud:
<br />
<br />
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://mirrors.cloud.tencent.com/debian/" -firmware --cdimage "cn"</code></pre>
<br />
for low memory(less than 768MB) machines, you can bash:
<br />
<br />
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://mirrors.cloud.tencent.com/debian/" -dnserv "cn"</code></pre>
<br />
Alibaba Cloud:
<br />
<br />
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://mirrors.aliyun.com/debian/" -firmware --cdimage 'cn'</code></pre>
<br />
for low memory(less than 768MB) machines, you can bash:
<br />
<br />
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://mirrors.aliyun.com/debian/" -dnserv "cn"</code></pre>
<br />
### Debian 11 (prefer mirror manually with firmware, recommend for servers which are locating outside of mainland China)
**32/i386 or 64/amd64 or arm/arm64**: OS bit
If you don't know, don't assign it!
<br />
<br />
### Advanced usage, for example Debian 11 (recommend for servers which are locating outside of mainland China)
Japan:
<br />
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://ftp.riken.jp/Linux/debian/debian/" -firmware</code></pre>
<br />
for low memory(less than 768MB) machines, you can bash:
<br />
<br />
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://ftp.riken.jp/Linux/debian/debian/"</code></pre>
<br />
<pre><code>bash InstallNET.sh -debian 11 -mirror "http://ftp.riken.jp/Linux/debian/debian/"</code></pre>
HongKong:
<br />
<br />
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://ftp.hk.debian.org/debian/" -firmware</code></pre>
<br />
for low memory(less than 768MB) machines, you can bash:
<br />
<br />
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://ftp.hk.debian.org/debian/"</code></pre>
<br />
<pre><code>bash InstallNET.sh -debian 11 -mirror "http://ftp.hk.debian.org/debian/"</code></pre>
Singapore:
<br />
<br />
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://ftp.sg.debian.org/debian/" -firmware</code></pre>
<br />
for low memory(less than 768MB) machines, you can bash:
<br />
<br />
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://ftp.sg.debian.org/debian/"</code></pre>
<br />
<pre><code>bash InstallNET.sh -debian 11 -mirror "http://ftp.sg.debian.org/debian/"</code></pre>
South Korea:
<br />
<br />
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://studenno.kugi.kyoto-u.ac.jp/debian/" -firmware</code></pre>
<br />
for low memory(less than 768MB) machines, you can bash:
<br />
<br />
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://studenno.kugi.kyoto-u.ac.jp/debian/"</code></pre>
<br />
<pre><code>bash InstallNET.sh -debian 11 -mirror "https://ftp.jaist.ac.jp/pub/Linux/debian/"</code></pre>
Taiwan:
<br />
<br />
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://ftp.tw.debian.org/debian/" -firmware</code></pre>
<pre><code>bash InstallNET.sh -debian 11 -mirror "http://ftp.tw.debian.org/debian/"</code></pre>
America:
<br />
<br />
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://debian.csail.mit.edu/debian/" -firmware</code></pre>
<br />
for low memory(less than 768MB) machines, you can bash:
<br />
<br />
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://debian.csail.mit.edu/debian/"</code></pre>
<br />
<pre><code>bash InstallNET.sh -debian 11 -mirror "https://mirrors.ocf.berkeley.edu/debian/"</code></pre>
Canada:
<br />
<br />
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://ftp.ca.debian.org/debian/" -firmware</code></pre>
<pre><code>bash InstallNET.sh -debian 11 -mirror "http://ftp.ca.debian.org/debian/" -firmware</code></pre>
British:
<br />
<br />
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://ftp.uk.debian.org/debian/" -firmware</code></pre>
<pre><code>bash InstallNET.sh -debian 11 -mirror "http://ftp.uk.debian.org/debian/" -firmware</code></pre>
Germany:
<br />
<br />
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://ftp.de.debian.org/debian/" -firmware</code></pre>
<pre><code>bash InstallNET.sh -debian 11 -mirror "http://ftp.de.debian.org/debian/" -firmware</code></pre>
France:
<br />
<br />
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://ftp.fr.debian.org/debian/" -firmware</code></pre>
<pre><code>bash InstallNET.sh -debian 11 -mirror "http://ftp.fr.debian.org/debian/" -firmware</code></pre>
Russia:
<br />
<br />
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://ftp.ru.debian.org/debian/" -firmware</code></pre>
<pre><code>bash InstallNET.sh -debian 11 -mirror "http://ftp.ru.debian.org/debian/" -firmware</code></pre>
Australia:
<br />
<br />
<pre><code>bash InstallNET.sh -d 11 -v 64 -a -mirror "http://ftp.au.debian.org/debian/" -firmware</code></pre>
<pre><code>bash InstallNET.sh -debian 11 -mirror "http://ftp.au.debian.org/debian/" -firmware</code></pre>
### Ubuntu 16.04
<pre><code>bash InstallNET.sh -u 16.04 -v 64 -a</code></pre>
### Ubuntu 18.04
<pre><code>bash InstallNET.sh -u 18.04 -v 64 -a</code></pre>
### Ubuntu 20.04
<pre><code>bash InstallNET.sh -u 20.04 -v 64 -a</code></pre>
### Cent OS 6
<pre><code>bash InstallNET.sh -c 6.10 -v 64 -a</code></pre>
## Default Configurations
### Time zone
Asia Shanghai
### Time zone
Asia Tokyo
### Default User name
root
@ -265,7 +212,7 @@ LeitboGi0ro
22
<br />
<br />
<b>After system installation, you must change passwords immediately if you assigned default password(LeitboGi0ro)!</b>
<b>If you didn't assign other ssh password or port, after system installation, you must change passwords immediately if you assigned default password(LeitboGi0ro)!</b>
<br />
<br />