reinstall
One-click reinstallation script
中文 | English
Highlights
- Support arbitrary conversion between the following systems (including Windows to Linux).
- Compatible low-spec servers and automatically select the appropriate official slimmed-down kernel.
- Supports installing Windows using the official ISO.
- Automatically detect dynamic/static IPv4/IPv6, eliminating the need to fill in IP/mask/gateway (even for DD/ISO installation of Windows).
- Supports BIOS, EFI, ARM. The original system partition supports LVM, Btrfs.
- Progress of DD and cloud image installation can be viewed through SSH, HTTP port 80, serial console, and vendor backend VNC.
- The script does not include third-party homemade packages; all resources are obtained in real-time from the source site.
- Includes many comments.
System Requirements
Target System | Memory | Disk |
---|---|---|
Alpine | 256 MB | 1 GB |
Debian / Kali | 256 MB | 1~1.5 GB ^ |
Ubuntu | 512 MB * | 2 GB |
CentOS / Alma / Rocky | 512 MB * | 5 GB |
Fedora | 512 MB * | 5 GB |
openSUSE | 512 MB * | 5 GB |
Arch | 512 MB | 5 GB |
Gentoo | 512 MB | 5 GB |
DD | 512 MB | Depending on the image |
Windows 8.1 (Server 2012 R2) or below (ISO installation) | 512 MB | 20~25 GB |
Windows 10 (Server 2016) or above (ISO installation) | 1G | 20~25 GB |
(*) Indicates installation using cloud images
(^) indicates requiring either 256 MB memory + 1.5 GB disk, or 512 MB memory + 1 GB disk
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://mirror.ghproxy.com/https://raw.githubusercontent.com/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://mirror.ghproxy.com/https://raw.githubusercontent.com/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
- If no version number is entered, the latest version will be installed.
- When installing on a virtual machine, it will automatically select a slimmed-down kernel.
bash reinstall.sh centos 7|8|9 (8|9 for the stream version)
alma 8|9
rocky 8|9
fedora 38|39|40
debian 10|11|12
opensuse 15.5|tumbleweed
ubuntu 20.04|22.04|24.04
alpine 3.16|3.17|3.18|3.19
kali
arch
gentoo
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 vendor backend VNC.
- If the disk content is not modified, rebooting again will return to the original system.
bash reinstall.sh netboot.xyz
Feature 5: Install Windows ISO
- Pay attention to the quotation marks around the parameters
- Supports automatically searching for some ISO links. Need to set the language using
--lang
, default isen-us
.
bash reinstall.sh windows \
--image-name 'Windows 10 Enterprise LTSC 2021' \
--lang zh-cn
- You can also specify an ISO link.
bash reinstall.sh windows \
--image-name 'Windows 10 Enterprise LTSC 2021' \
--iso 'https://drive.massgrave.dev/en-us_windows_10_enterprise_ltsc_2021_x64_dvd_d289cf96.iso'
Parameters Description:
--image-name
Specify the image to install, case-insensitive, Commonly used images include:
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 11
- Windows Server 2008 to 2022, including the following variants
- 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, Citrix, AWS)
- 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.
-
For EFI machines without CSM enabled, Windows 7 (Server 2008 R2) cannot be installed.
-
If the machine has a static IP, the IP will be automatically set after installation.
-
Can bypass Windows 11 hardware restrictions.
-
Supports Windows 11 on ARM, exclusively for Hyper-V (Azure), not compatible with KVM (Oracle Cloud).
-
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.
https://massgrave.dev/genuine-installation-media.html (Recommended, iso sourced from official channels, updated monthly, includes the latest patches)
https://www.microsoft.com/software-download/windows8
https://www.microsoft.com/software-download/windows10 (Need to open it with a mobile User-Agent)
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 encountering a password error during remote login to Windows, try using the username .\administrator.
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
Thanks
Thanks to the following businesses for providing free servers.