reinstall
One-click reinstallation script
中文 | English
Highlights
- By default, the official installation program is used. When the memory requirements of the installation program are not met, the official cloud image (Cloud Image) will be used.
- The script does not include third-party links or homemade packages; all resources are obtained in real-time from the source site.
- Compatible with 512M + 5G small servers and supports installing Alpine on 256M small servers.
- Supports installing Windows using the official ISO.
- Supports reinstalling Windows as Linux or Windows itself.
- Supports BIOS, EFI, ARM.
- The original system partition supports LVM, Btrfs.
- Supports installing Alpine, Arch, openSUSE, Gentoo, and can also install these systems from them.
- Progress of DD and cloud image installation can be viewed through SSH, browser, serial console, and background VNC.
- Includes many comments.
Download (Current system is Linux)
For users outside China:
curl -O https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.sh
For users in China:
curl -O https://raw.fgit.cf/bin456789/reinstall/main/reinstall.sh
Download (Current system is Windows)
Before proceeding, please disable the 'Real-time protection' feature in Windows Defender
. This feature may prevent certutil
from downloading any files.
For users outside China:
certutil -urlcache -f -split https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.bat
For users in China:
certutil -urlcache -f -split https://raw.fgit.cf/bin456789/reinstall/main/reinstall.bat
Usage
All features can be used on both Linux and Windows.
- on Linux, execute
bash reinstall.sh
- on Windows, execute
reinstall.bat
Feature 1: Install Linux
- For machines with static IP, install CentOS, Alma, Rocky, Fedora, Debian, Ubuntu, and add the --ci parameter to force the use of the cloud image.
bash reinstall.sh centos 7|8|9 (8|9 for the stream version)
alma 8|9
rocky 8|9
fedora 38|39
debian 10|11|12
ubuntu 20.04|22.04
alpine 3.16|3.17|3.18|3.19
opensuse 15.5|tumbleweed (only supports cloud image)
arch (only supports amd64 cloud image)
gentoo (only supports amd64 cloud image)
If no version number is entered, the latest version will be installed.
Parameters:
--ci Force the use of the cloud image
Feature 2: DD
-
Supports gzip, xz formats.
-
For machines with static IP, DD Windows, and the script will automatically configure the IP.
bash reinstall.sh dd --img https://example.com/xxx.xz
Feature 3: Reboot to Alpine Rescue System (Live OS)
-
Can be connected via SSH to perform manual DD, modify partitions, manually install Arch / Gentoo, etc.
-
If the disk content is not modified, rebooting again will return to the original system.
bash reinstall.sh alpine --hold=1
Feature 4: Reboot to netboot.xyz
- Can install more systems using background VNC.
bash reinstall.sh netboot.xyz
Feature 5: Install Windows ISO
bash reinstall.sh windows \
--iso 'https://drive.massgrave.dev/en-us_windows_10_enterprise_ltsc_2021_x64_dvd_d289cf96.iso' \
--image-name 'Windows 10 Enterprise LTSC 2021'
Parameters:
--iso
Original image link
--image-name
Specify the image to install, case-insensitive, should be enclosed in quotes on both sides, for example:
'Windows 7 Ultimate'
'Windows 10 Enterprise LTSC 2021'
'Windows 11 Pro'
'Windows Server 2022 SERVERDATACENTER'
Use Dism++
File menu > Open Image File, select the iso to be installed to get the image name.
-
Supported systems:
- Windows Vista to Windows 11
- Windows Server 2008 to Windows Server 2022
- Windows Server variants, such as
- Windows Server Essentials
- Windows Server Annual Channel
- Hyper-V Server
- Azure Stack HCI
-
The script will install the following drivers as needed:
- KVM (Virtio)
- XEN (XEN PV, AWS PV)
- AWS (ENA Network Adapter, NVMe Storage Controller)
- GCP (gVNIC Network Adapter, GGA Graphics)
- Azure (MANA Network Adapter)
-
Vista (Server 2008) and 32-bit systems may lack drivers.
-
If the machine has a static IP, the IP will be automatically set after installation.
-
Can bypass Windows 11 hardware restrictions.
-
Supports Azure ARM (Hyper-V), does not support Oracle ARM (KVM).
-
The process
wsappx
will occupy CPU for a long time after installing the imagezh-cn_windows_10_enterprise_ltsc_2021_x64_dvd_033b7312.iso
.This is an issue with the image, and the solution is to install the
VCLibs
library. -
The following website provides iso links.
Memory Requirements
System | Traditional Installation | Cloud Image |
---|---|---|
Debian | 384M | 512M |
Ubuntu | 1G | 512M |
CentOS / Alma / Rocky / Fedora | 1G | 512M |
Alpine | 256M | - |
openSUSE | - | 512M |
Arch | - | 512M |
Gentoo | - | 512M |
Windows 8.1 (Server 2012 R2) or below | 512M | - |
Windows 10 (Server 2016) or above | 1G | - |
Network Requirements
Install Linux using the Install Mode
must have DHCPv4.
Other cases support static IP, IPv6 (including installing Alpine, Linux cloud image, Windows iso, dd).
No need to fill in the static IP address when running the script.
Virtualization Requirements
Not supported on OpenVZ, LXC virtual machines.
Please use https://github.com/LloydAsp/OsMutation.
Default Passwords
System | Username | Password |
---|---|---|
Linux | root | 123@@@ |
Windows (iso) | administrator | 123@@@ |
Windows (dd) | Image username | Image password |
If the script cannot be downloaded under Windows
You can try the following methods:
-
Disable Windows Defender Real-time Protection.
-
For Windows 7, install this patch to enable TLS 1.2.
-
Update SSL root certificates.
certutil -generateSSTFromWU root.sst certutil -addstore Root root.sst
-
Download manually by copying these two files through
Remote Desktop Connection
.https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.bat
https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.sh
TODO
- Install mode: Static IP, IPv6, multiple NICs