2023-05-17 22:54:26 +08:00
|
|
|
|
# reinstall
|
2023-09-21 00:12:35 +08:00
|
|
|
|
|
2023-12-04 22:19:59 +08:00
|
|
|
|
[![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-04 22:19:59 +08:00
|
|
|
|
|
2023-12-16 16:41:34 +08:00
|
|
|
|
一键重装脚本
|
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
中文 | [English](README.en.md)
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2023-09-21 00:12:35 +08:00
|
|
|
|
## 亮点
|
|
|
|
|
|
2023-08-12 21:11:46 +08:00
|
|
|
|
- 默认使用官方安装程序,不满足安装程序内存要求时,将使用官方云镜像 (Cloud Image)
|
2023-10-22 23:02:48 +08:00
|
|
|
|
- 不含第三方链接和自制包,所有资源均实时从源站点获得
|
|
|
|
|
- 适配 512M + 5G 小鸡,并支持 256M 小鸡安装 Alpine
|
2024-01-27 23:08:34 +08:00
|
|
|
|
- 支持用官方 iso 安装 Windows
|
2023-10-22 23:02:48 +08:00
|
|
|
|
- 支持 Windows 重装成 Linux,也可重装 Windows
|
2024-01-27 23:08:34 +08:00
|
|
|
|
- 支持 BIOS、EFI、ARM
|
2023-10-22 23:02:48 +08:00
|
|
|
|
- 原系统分区支持 LVM、Btrfs
|
|
|
|
|
- 支持安装 Alpine、Arch、openSUSE、Gentoo,也可从这些系统安装
|
|
|
|
|
- 可通过 SSH、浏览器、串行控制台、后台 VNC 查看 DD、云镜像安装进度
|
2023-08-12 21:11:46 +08:00
|
|
|
|
- 有很多注释
|
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
## 下载(当前系统是 Linux)
|
2023-09-21 00:12:35 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
国外:
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2023-10-22 23:02:48 +08:00
|
|
|
|
```bash
|
|
|
|
|
curl -O https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.sh
|
|
|
|
|
```
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
国内:
|
2023-09-21 00:12:35 +08:00
|
|
|
|
|
2023-10-22 23:02:48 +08:00
|
|
|
|
```bash
|
2023-12-12 13:09:03 +08:00
|
|
|
|
curl -O https://raw.fgit.cf/bin456789/reinstall/main/reinstall.sh
|
2023-10-22 23:02:48 +08:00
|
|
|
|
```
|
2023-09-21 00:12:35 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
## 下载(当前系统是 Windows)
|
|
|
|
|
|
|
|
|
|
先关闭 `Windows Defender` 的 `实时保护` 功能
|
|
|
|
|
|
|
|
|
|
国外:
|
|
|
|
|
|
|
|
|
|
```batch
|
|
|
|
|
certutil -urlcache -f -split https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.bat
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
国内:
|
|
|
|
|
|
|
|
|
|
```batch
|
|
|
|
|
certutil -urlcache -f -split https://raw.fgit.cf/bin456789/reinstall/main/reinstall.bat
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
[无法下载?](#如果-windows-下无法下载脚本)
|
|
|
|
|
|
|
|
|
|
## 使用
|
|
|
|
|
|
|
|
|
|
- 以下用法以 Linux 下运行为例
|
|
|
|
|
- Windows 下运行 `reinstall.bat`,参数相同
|
|
|
|
|
|
2023-11-09 23:23:33 +08:00
|
|
|
|
### 用法 1: 安装 Linux
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
- 静态 IP 的机器安装 centos、alma、rocky、fedora、debian、ubuntu,需添加参数 --ci 强制使用云镜像
|
2023-12-04 22:19:59 +08:00
|
|
|
|
|
2023-10-22 23:02:48 +08:00
|
|
|
|
```bash
|
|
|
|
|
bash reinstall.sh centos 7|8|9 (8|9 为 stream 版本)
|
|
|
|
|
alma 8|9
|
|
|
|
|
rocky 8|9
|
2023-12-16 16:41:34 +08:00
|
|
|
|
fedora 38|39
|
2023-10-22 23:02:48 +08:00
|
|
|
|
debian 10|11|12
|
|
|
|
|
ubuntu 20.04|22.04
|
2023-12-07 23:06:15 +08:00
|
|
|
|
alpine 3.16|3.17|3.18|3.19
|
2024-01-18 23:52:54 +08:00
|
|
|
|
opensuse 15.5|tumbleweed (只支持云镜像)
|
2023-10-22 23:02:48 +08:00
|
|
|
|
arch (只支持 amd64 云镜像)
|
|
|
|
|
gentoo (只支持 amd64 云镜像)
|
2023-09-16 20:00:07 +08:00
|
|
|
|
|
2023-10-22 23:02:48 +08:00
|
|
|
|
不输入版本号,则安装最新版
|
2024-01-27 23:08:34 +08:00
|
|
|
|
```
|
2023-10-22 23:02:48 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
参数:
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
--ci 强制使用云镜像
|
2023-10-22 23:02:48 +08:00
|
|
|
|
```
|
2023-09-21 00:12:35 +08:00
|
|
|
|
|
2023-11-09 23:23:33 +08:00
|
|
|
|
### 用法 2: DD
|
2023-11-04 14:37:22 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
- 支持 gzip、xz 格式
|
2023-11-04 14:37:22 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
- 静态 IP 的机器 DD Windows,会自动配置好 IP
|
2023-11-04 14:37:22 +08:00
|
|
|
|
|
|
|
|
|
```bash
|
2024-01-27 23:08:34 +08:00
|
|
|
|
bash reinstall.sh dd --img https://example.com/xxx.xz
|
2023-11-04 14:37:22 +08:00
|
|
|
|
```
|
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
### 用法 3: 重启到 Alpine 救援系统 (Live OS)
|
2023-11-09 23:23:33 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
- 可用 ssh 连接,进行手动 DD、修改分区、手动安装 Arch / Gentoo 等操作
|
|
|
|
|
|
|
|
|
|
- 如果没有修改硬盘内容,再次重启将回到原系统
|
2023-11-09 23:23:33 +08:00
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
bash reinstall.sh alpine --hold=1
|
|
|
|
|
```
|
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
### 用法 4: 重启到 [netboot.xyz](https://netboot.xyz/)
|
|
|
|
|
|
|
|
|
|
- 可使用后台 VNC 安装更多系统
|
2023-11-09 23:23:33 +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-11-09 23:23:33 +08:00
|
|
|
|
### 用法 5: 安装 Windows ISO
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2023-10-22 23:02:48 +08:00
|
|
|
|
```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-10-22 23:02:48 +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)
|
|
|
|
|
|
|
|
|
|
参数:
|
2023-10-22 23:02:48 +08:00
|
|
|
|
|
2023-11-04 14:37:22 +08:00
|
|
|
|
`--iso` 原版镜像链接,无需集成 VirtIO、Xen、AWS、GCP 驱动
|
2023-09-21 00:12:35 +08:00
|
|
|
|
|
2023-11-04 14:37:22 +08:00
|
|
|
|
`--image-name` 指定要安装的映像,不区分大小写,两边要有引号,例如:
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2023-11-04 14:37:22 +08:00
|
|
|
|
```text
|
|
|
|
|
'Windows 7 Ultimate'
|
|
|
|
|
'Windows 10 Enterprise LTSC 2021'
|
|
|
|
|
'Windows 11 Pro'
|
|
|
|
|
'Windows Server 2022 SERVERDATACENTER'
|
2023-11-01 22:19:48 +08:00
|
|
|
|
```
|
|
|
|
|
|
2023-11-04 14:37:22 +08:00
|
|
|
|
使用 `Dism++` 文件菜单 > 打开映像文件,选择要安装的 iso,可以得到映像名称
|
|
|
|
|
|
|
|
|
|
![image-name](https://github.com/bin456789/reinstall/assets/7548515/5aae0a9b-61e2-4f66-bb98-d470a6beaac2)
|
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
1. 支持的系统:
|
|
|
|
|
- Windows Vista 到 Windows 11
|
|
|
|
|
- Windows Server 2008 到 Windows Server 2022
|
|
|
|
|
- Windows Server 变体,例如
|
|
|
|
|
- Windows Server Essentials
|
|
|
|
|
- Windows Server Annual Channel
|
|
|
|
|
- Hyper-V Server
|
|
|
|
|
- Azure Stack HCI
|
|
|
|
|
2. BIOS 可使用 32/64 位,UEFI 机器只可使用 64 位
|
|
|
|
|
3. 如果机器是静态 IP,安装后会自动设置 IP
|
|
|
|
|
4. 可绕过 Windows 11 硬件限制
|
|
|
|
|
5. 支持 Azure ARM (Hyper-V),不支持甲骨文 ARM (KVM)
|
|
|
|
|
6. `zh-cn_windows_10_enterprise_ltsc_2021_x64_dvd_033b7312.iso` 此镜像安装后 `wsappx` 进程会长期占用 CPU
|
2023-11-04 14:37:22 +08:00
|
|
|
|
|
|
|
|
|
这是镜像的问题,解决方法是安装 `VCLibs` 库
|
|
|
|
|
|
|
|
|
|
<https://www.google.com/search?q=ltsc+wsappx>
|
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
7. 以下网站可找到 iso 链接
|
2023-11-04 14:37:22 +08:00
|
|
|
|
|
|
|
|
|
<https://massgrave.dev/genuine-installation-media.html>
|
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
## 内存要求
|
2023-11-01 22:19:48 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
| 系统 | 传统安装 | 云镜像 |
|
|
|
|
|
| ----------------------------------- | -------- | ------ |
|
|
|
|
|
| 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) 或以下 | 512M | - |
|
|
|
|
|
| Windows 10 (Server 2016) 或以上 | 1G | - |
|
2023-11-01 22:19:48 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
## 网络要求
|
2023-11-04 14:37:22 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
用`安装模式`安装 Linux 要有 DHCPv4
|
2023-11-01 22:19:48 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
其他情况支持静态 IP、IPv6(包括安装 Alpine、Linux 云镜像、Windows iso、dd)
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
运行脚本时不需要填写静态 IP 地址
|
2023-09-21 00:12:35 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
## 虚拟化要求
|
2023-07-06 22:52:18 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
不支持 OpenVZ、LXC 虚拟机
|
2023-11-04 14:37:22 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
请使用 <https://github.com/LloydAsp/OsMutation>
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
## 默认密码
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
| 系统 | 用户名 | 密码 |
|
|
|
|
|
| ------------- | ------------- | -------- |
|
|
|
|
|
| Linux | root | 123@@@ |
|
|
|
|
|
| Windows (iso) | administrator | 123@@@ |
|
|
|
|
|
| Windows (dd) | 镜像用户名 | 镜像密码 |
|
2023-09-21 00:12:35 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
## 如果 Windows 下无法下载脚本
|
2023-09-21 00:12:35 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
可尝试以下几种方法
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
1. 关闭 Windows Defender 实时保护
|
2023-10-22 23:02:48 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
2. Windows 7 安装此补丁启用 TLS 1.2
|
2023-10-22 23:02:48 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
<https://aka.ms/easyfix51044>
|
2023-10-22 23:02:48 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
3. 更新 SSL 根证书
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
```batch
|
|
|
|
|
certutil -generateSSTFromWU root.sst
|
|
|
|
|
certutil -addstore Root root.sst
|
|
|
|
|
```
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
4. 手动下载,通过 `远程桌面` 复制这两个文件
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
<https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.bat>
|
2023-09-21 00:12:35 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
<https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.sh>
|
2023-09-21 00:12:35 +08:00
|
|
|
|
|
|
|
|
|
## TODO
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2023-10-22 23:02:48 +08:00
|
|
|
|
- 安装模式:静态 IP、IPv6、多网卡
|
2024-01-19 11:55:35 +08:00
|
|
|
|
|
2024-01-27 23:08:34 +08:00
|
|
|
|
## 推广
|
2024-01-19 11:55:35 +08:00
|
|
|
|
|
|
|
|
|
[![DartNode](https://github.com/bin456789/reinstall/assets/7548515/7531e443-4069-4bf1-a40e-2e965f311e3f)](https://dartnode.com/)
|