2023-12-16 16:41:34 +08:00
# reinstall
[![Codacy Badge ](https://app.codacy.com/project/badge/Grade/dc679a17751448628fe6d8ac35e26eed )](https://app.codacy.com/gh/bin456789/reinstall/dashboard?utm_source=gh& utm_medium=referral& utm_content=& utm_campaign=Badge_grade)
[![CodeFactor ](https://www.codefactor.io/repository/github/bin456789/reinstall/badge )](https://www.codefactor.io/repository/github/bin456789/reinstall)
2024-01-27 23:08:34 +08:00
[![Lines of Code ](https://tokei.rs/b1/github/bin456789/reinstall?category=code&style=flat )](https://github.com/XAMPPRocky/tokei_rs)
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
One-click reinstallation script
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
[中文 ](README.md ) | English
2023-12-16 16:41:34 +08:00
## Highlights
2024-01-27 23:08:34 +08:00
- 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.
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
## Download (Current system is Linux)
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
For users outside China:
2023-12-16 16:41:34 +08:00
```bash
curl -O https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.sh
```
2024-01-27 23:08:34 +08:00
For users in China:
2023-12-16 16:41:34 +08:00
```bash
curl -O https://raw.fgit.cf/bin456789/reinstall/main/reinstall.sh
```
2024-01-27 23:08:34 +08:00
## Download (Current system is Windows)
First, disable the `Real-time Protection` feature of `Windows Defender` .
For users outside China:
```batch
certutil -urlcache -f -split https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.bat
```
For users in China:
```batch
certutil -urlcache -f -split https://raw.fgit.cf/bin456789/reinstall/main/reinstall.bat
```
[Unable to download? ](#if-the-script-cannot-be-downloaded-under-windows )
## Usage
- The following examples are for running on Linux; for Windows, run `reinstall.bat` with the same parameters.
2023-12-16 16:41:34 +08:00
### Usage 1: Install Linux
2024-01-27 23:08:34 +08:00
- 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.
2023-12-16 16:41:34 +08:00
```bash
2024-01-27 23:08:34 +08:00
bash reinstall.sh centos 7|8|9 (8|9 for the stream version)
2023-12-16 16:41:34 +08:00
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
2024-01-27 23:08:34 +08:00
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.
```
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
Parameters:
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
```bash
--ci Force the use of the cloud image
2023-12-16 16:41:34 +08:00
```
### Usage 2: DD
2024-01-27 23:08:34 +08:00
- Supports gzip, xz formats.
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
- For machines with static IP, DD Windows, and the script will automatically configure the IP.
2023-12-16 16:41:34 +08:00
```bash
2024-01-27 23:08:34 +08:00
bash reinstall.sh dd --img https://example.com/xxx.xz
2023-12-16 16:41:34 +08:00
```
2024-01-27 23:08:34 +08:00
### Usage 3: Reboot to Alpine Rescue System (Live OS)
- Can be connected via SSH to perform manual DD, modify partitions, manually install Arch / Gentoo, etc.
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
- If the disk content is not modified, rebooting again will return to the original system.
2023-12-16 16:41:34 +08:00
```bash
bash reinstall.sh alpine --hold=1
```
2024-01-27 23:08:34 +08:00
### Usage 4: Reboot to [netboot.xyz](https://netboot.xyz/)
- Can install more systems using background VNC.
2023-12-16 16:41:34 +08:00
```bash
bash reinstall.sh netboot.xyz
```
2024-01-27 23:08:34 +08:00
![netboot.xyz ](https://netboot.xyz/images/netboot.xyz.gif )
2023-12-16 16:41:34 +08:00
### Usage 5: Install Windows ISO
```bash
bash reinstall.sh windows \
2024-01-27 23:08:34 +08:00
--iso 'https://drive.massgrave.dev/en-us_windows_10_enterprise_ltsc_2021_x64_dvd_d289cf96.iso' \
--image-name 'Windows 10 Enterprise LTSC 2021'
2023-12-16 16:41:34 +08:00
```
2024-01-27 23:08:34 +08:00
![windows installer ](https://filestore.community.support.microsoft.com/api/images/67c13a8c-cee6-47cd-ae80-a55923875c83 )
Parameters:
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
`--iso` Original image link, no need to integrate VirtIO, Xen, AWS, GCP drivers.
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
`--image-name` Specify the image to install, case-insensitive, should be enclosed in quotes on both sides, for example:
2023-12-16 16:41:34 +08:00
```text
'Windows 7 Ultimate'
'Windows 10 Enterprise LTSC 2021'
'Windows 11 Pro'
'Windows Server 2022 SERVERDATACENTER'
```
2024-01-27 23:08:34 +08:00
Use `Dism++` File menu > Open Image File, select the iso to be installed to get the image name.
2023-12-16 16:41:34 +08:00
![image-name ](https://github.com/bin456789/reinstall/assets/7548515/5aae0a9b-61e2-4f66-bb98-d470a6beaac2 )
2024-01-27 23:08:34 +08:00
1. 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
2. BIOS can be used for 32/64 bit, UEFI machines can only use 64-bit.
3. If the machine has a static IP, the IP will be automatically set after installation.
4. Can bypass Windows 11 hardware restrictions.
5. Supports Azure ARM (Hyper-V), does not support Oracle ARM (KVM).
6. The process `wsappx` will occupy CPU for a long time after installing the image `zh-cn_windows_10_enterprise_ltsc_2021_x64_dvd_033b7312.iso` .
2023-12-16 16:41:34 +08:00
This is an issue with the image, and the solution is to install the `VCLibs` library.
< https: / / www . google . com / search ? q = ltsc+wsappx >
2024-01-27 23:08:34 +08:00
7. The following website provides iso links.
2023-12-16 16:41:34 +08:00
< https: / / massgrave . dev / genuine-installation-media . html >
2024-01-27 23:08:34 +08:00
## Memory Requirements
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
| 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 | - |
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
## Network Requirements
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
Install Linux using the `Install Mode` must have DHCPv4.
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
Other cases support static IP, IPv6 (including installing Alpine, Linux cloud image, Windows iso, dd).
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
No need to fill in the static IP address when running the script.
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
## Virtualization Requirements
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
Not supported on OpenVZ, LXC virtual machines.
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
Please use < https: / / github . com / LloydAsp / OsMutation > .
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
## Default Passwords
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
| System | Username | Password |
| ------------- | -------------- | -------------- |
| Linux | root | 123@@@ |
| Windows (iso) | administrator | 123@@@ |
| Windows (dd) | Image username | Image password |
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
## If the script cannot be downloaded under Windows
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
You can try the following methods:
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
1. Disable Windows Defender Real-time Protection.
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
2. For Windows 7, install this patch to enable TLS 1.2.
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
< https: / / aka . ms / easyfix51044 >
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
3. Update SSL root certificates.
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
```batch
certutil -generateSSTFromWU root.sst
certutil -addstore Root root.sst
```
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
4. Download manually by copying these two files through `Remote Desktop Connection` .
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
< https: / / raw . githubusercontent . com / bin456789 / reinstall / main / reinstall . bat >
2023-12-16 16:41:34 +08:00
2024-01-27 23:08:34 +08:00
< https: / / raw . githubusercontent . com / bin456789 / reinstall / main / reinstall . sh >
2023-12-16 16:41:34 +08:00
## TODO
2024-01-27 23:08:34 +08:00
- Install mode: Static IP, IPv6, multiple NICs
2024-01-19 11:55:35 +08:00
2024-01-27 23:08:34 +08:00
## Promotion
2024-01-19 11:55:35 +08:00
[![DartNode ](https://github.com/bin456789/reinstall/assets/7548515/7531e443-4069-4bf1-a40e-2e965f311e3f )](https://dartnode.com/)