2023-12-04 22:20:52 +08:00
2023-11-01 23:14:13 +08:00
2024-01-19 11:55:35 +08:00
2024-01-19 11:55:35 +08:00
2023-10-08 21:46:45 +08:00
2023-12-05 22:41:36 +08:00
2023-10-27 12:09:45 +08:00
2023-12-05 22:41:36 +08:00
2023-08-28 19:33:53 +08:00

reinstall

Codacy Badge CodeFactor Lines of Code

One-click Reinstallation Script

中文 | English

Highlights

  • Default usage of official installation programs. In cases where the memory requirements of the installation program are not met, the official cloud image will be used.
  • Excludes third-party links and self-made packages; all resources are fetched in real-time from the source site.
  • Adapted for 512M + 5G small VPS, and supports installing Alpine on 256M VPS.
  • Supports installing Windows using the official ISO (does not support ARM).
  • Supports reinstalling Windows as Linux and vice versa.
  • Supports BIOS, EFI, ARM (Windows installation not supported on ARM).
  • Supports original system partition with LVM, Btrfs.
  • Supports installing Alpine, Arch, openSUSE, Gentoo, and installing from these systems.
  • Progress of DD and cloud image installation can be viewed through SSH, a browser, serial console, or background VNC.
  • Contains extensive comments.

Usage on Linux

Download

curl -O https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.sh

Download (from within China)

curl -O https://raw.fgit.cf/bin456789/reinstall/main/reinstall.sh

Usage 1: Install Linux

Note: For machines with static IP, installing centos, alma, rocky, fedora, debian, ubuntu, requires adding the --ci parameter to force the use of the cloud mirror.

bash reinstall.sh centos   7|8|9  (8|9 for stream versions)
                  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 (supports cloud mirror only)
                  arch     (supports only amd64 cloud mirror)
                  gentoo   (supports only amd64 cloud mirror)

                  If no version number is entered, it installs the latest version.

Optional parameters: --ci     Force the use of the cloud mirror.

Usage 2: DD

Supports gzip, xz formats.

Supports automatic configuration of static IP, system disk expansion.

bash reinstall.sh dd --img=https://example.com/xxx.xz

Usage 3: Restart to Alpine Rescue System (Live OS)

Can be connected via SSH to perform manual DD, modify partitions, manually install Arch Linux, and other operations.

bash reinstall.sh alpine --hold=1

Usage 4: Restart to netboot.xyz

bash reinstall.sh netboot.xyz

Usage 5: Install Windows ISO

bash reinstall.sh windows \
     --iso='https://example.com/en-us_windows_10_enterprise_ltsc_2021_x64_dvd_d289cf96.iso' \
     --image-name='Windows 10 Enterprise LTSC 2021'

Parameter Description

--iso Original image link without integrating VirtIO, Xen, AWS, GCP drivers.

--image-name Specifies the image to install, case insensitive, enclosed in quotes, 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 get the image name.

image-name

Other Notes

  1. Successfully tested systems: 7, 10, 11, 2022. Tested platforms: vultr (bios), oracle (efi), aws t2 (xen), aws t3 (nitro).

  2. Supports 32/64-bit systems; UEFI machines only support 64-bit.

  3. Can bypass Windows 11 hardware restrictions.

  4. Tested not to support ARM.

  5. zh-cn_windows_10_enterprise_ltsc_2021_x64_dvd_033b7312.iso: After installing this image, the wsappx process may occupy CPU for an extended period.

    This is an issue with the image, and the solution is to install the VCLibs library.

    https://www.google.com/search?q=ltsc+wsappx

  6. The following websites contain iso links:

    https://archive.org

    https://massgrave.dev/genuine-installation-media.html

Usage on Windows

Run cmd with administrator privileges.

If running powershell, switch to cmd first.

Download

certutil -urlcache -f -split https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.bat

Download (from within China)

certutil -urlcache -f -split https://raw.fgit.cf/bin456789/reinstall/main/reinstall.bat

If unable to download

Usage

All functionalities available in Linux can be used on Windows, using parameters similar to those in Linux.

For example, to install centos 7:

reinstall.bat centos-7

Memory Requirements

System Traditional Install Cloud Image
Debian 384M 512M
Ubuntu 1G 512M
CentOS / Alma / Rocky / Fedora 1G 512M
Alpine 256M -
openSUSE - 512M
Arch - 512M
Gentoo - 512M
Windows 1G -

Network Requirements

For 'Installation Mode' installing Linux, DHCPv4 is required.

Other cases support static IP, IPv6 (including installing Alpine, cloud mirror, Windows iso, dd).

No need to fill in the static IP address when running the script.

Virtualization Requirements

Does not support OpenVZ, LXC virtual machines.

Please use https://github.com/LloydAsp/OsMutation.

Default Passwords

System Username Password
Linux root 123@@@
Windows (ISO install) administrator 123@@@

TODO

  • Installation modes: Static IP, IPv6, multiple NICs.

Sponsor

DartNode

Languages
Shell 93.9%
Batchfile 5%
HTML 0.9%
PowerShell 0.2%