2023-05-17 22:54:26 +08:00
|
|
|
|
# reinstall
|
2023-09-21 00:12:35 +08:00
|
|
|
|
|
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
|
|
|
|
|
- 支持用官方 iso 安装 Windows (不支持 ARM)
|
|
|
|
|
- 支持 Windows 重装成 Linux,也可重装 Windows
|
|
|
|
|
- 支持 BIOS、EFI、ARM (ARM 不支持安装 Windows)
|
|
|
|
|
- 原系统分区支持 LVM、Btrfs
|
|
|
|
|
- 支持安装 Alpine、Arch、openSUSE、Gentoo,也可从这些系统安装
|
|
|
|
|
- 可通过 SSH、浏览器、串行控制台、后台 VNC 查看 DD、云镜像安装进度
|
2023-08-12 21:11:46 +08:00
|
|
|
|
- 有很多注释
|
|
|
|
|
|
2023-09-21 00:12:35 +08:00
|
|
|
|
## Linux 下使用
|
|
|
|
|
|
|
|
|
|
### 下载
|
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
|
|
|
|
|
2023-09-21 00:12:35 +08:00
|
|
|
|
### 下载 (国内)
|
|
|
|
|
|
2023-10-22 23:02:48 +08:00
|
|
|
|
```bash
|
|
|
|
|
curl -O https://ghps.cc/https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.sh
|
|
|
|
|
```
|
2023-09-21 00:12:35 +08:00
|
|
|
|
|
|
|
|
|
### 安装 Linux
|
2023-08-12 21:11:46 +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
|
|
|
|
|
fedora 37|38
|
|
|
|
|
debian 10|11|12
|
|
|
|
|
ubuntu 20.04|22.04
|
|
|
|
|
alpine 3.16|3.17|3.18
|
|
|
|
|
opensuse 15.4|15.5|tumbleweed (只支持云镜像)
|
|
|
|
|
arch (只支持 amd64 云镜像)
|
|
|
|
|
gentoo (只支持 amd64 云镜像)
|
2023-09-16 20:00:07 +08:00
|
|
|
|
|
2023-10-22 23:02:48 +08:00
|
|
|
|
不输入版本号,则安装最新版
|
|
|
|
|
|
|
|
|
|
可选参数: --ci 强制使用云镜像
|
|
|
|
|
```
|
2023-09-21 00:12:35 +08:00
|
|
|
|
|
|
|
|
|
### 安装 Windows
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2023-10-22 23:02:48 +08:00
|
|
|
|
```bash
|
|
|
|
|
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'
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### DD
|
|
|
|
|
|
|
|
|
|
支持 gzip、xz 格式
|
2023-09-21 00:12:35 +08:00
|
|
|
|
|
2023-10-22 23:02:48 +08:00
|
|
|
|
支持自动配置静态 IP、扩展系统盘
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2023-11-01 22:19:48 +08:00
|
|
|
|
```bash
|
|
|
|
|
bash reinstall.sh dd --img=https://example.com/xxx.xz
|
|
|
|
|
```
|
|
|
|
|
|
2023-10-31 22:49:49 +08:00
|
|
|
|
### 重启到 Alpine 救援系统(不运行重装)
|
|
|
|
|
|
|
|
|
|
可用 ssh 连接,进行手动 DD、修改分区等操作
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
bash reinstall.sh alpine --hold=1
|
|
|
|
|
```
|
|
|
|
|
|
2023-09-21 00:12:35 +08:00
|
|
|
|
## Windows 下使用
|
|
|
|
|
|
2023-11-01 22:19:48 +08:00
|
|
|
|
管理员权限打开 `cmd` 窗口
|
|
|
|
|
|
|
|
|
|
如果打开的是 `powershell` 窗口,先进入 `cmd`
|
|
|
|
|
|
|
|
|
|
### 下载
|
|
|
|
|
|
|
|
|
|
```batch
|
|
|
|
|
certutil -urlcache -f -split https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.bat
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### 下载(国内)
|
|
|
|
|
|
|
|
|
|
```batch
|
|
|
|
|
certutil -urlcache -f -split https://ghps.cc/https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.bat
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### 如果无法下载
|
|
|
|
|
|
|
|
|
|
- 关闭 Windows Defender 实时保护
|
|
|
|
|
|
|
|
|
|
- 系统的 SSL 根证书没更新
|
|
|
|
|
|
|
|
|
|
可用`链接另存为`,或者`远程桌面`复制以下两个文件
|
|
|
|
|
|
|
|
|
|
<https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.bat>
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2023-11-01 22:19:48 +08:00
|
|
|
|
<https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.sh>
|
2023-09-21 00:12:35 +08:00
|
|
|
|
|
2023-11-01 22:19:48 +08:00
|
|
|
|
### 使用
|
2023-07-06 22:52:18 +08:00
|
|
|
|
|
2023-11-01 22:19:48 +08:00
|
|
|
|
可将 centos-7 换成其他,所有功能均可在 Windows 下使用
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2023-11-01 22:19:48 +08:00
|
|
|
|
```batch
|
|
|
|
|
reinstall.bat centos-7
|
2023-10-22 23:02:48 +08:00
|
|
|
|
```
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2023-10-22 23:02:48 +08:00
|
|
|
|
## Windows iso 安装
|
2023-09-21 00:12:35 +08:00
|
|
|
|
|
2023-10-22 23:02:48 +08:00
|
|
|
|
```bash
|
|
|
|
|
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'
|
|
|
|
|
```
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2023-09-21 00:12:35 +08:00
|
|
|
|
### 参数
|
|
|
|
|
|
2023-10-22 23:02:48 +08:00
|
|
|
|
`--iso` 原版镜像链接,无需集成 VirtIO、Xen、AWS、GCP 驱动
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2023-10-22 23:02:48 +08:00
|
|
|
|
`--image-name` 指定要安装的映像。不区分大小写,但两边要有引号,例如:
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2023-10-22 23:02:48 +08:00
|
|
|
|
```text
|
|
|
|
|
'Windows 7 Ultimate'
|
|
|
|
|
'Windows 10 Enterprise LTSC 2021'
|
|
|
|
|
'Windows 11 Pro'
|
|
|
|
|
'Windows Server 2022 SERVERDATACENTER'
|
|
|
|
|
```
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
|
|
|
|
使用 Dism++ 文件菜单 > 打开映像文件,选择要安装的 iso,可以得到映像名称
|
2023-09-21 00:12:35 +08:00
|
|
|
|
|
2023-07-06 22:52:18 +08:00
|
|
|
|
![image-name](https://github.com/bin456789/reinstall/assets/7548515/5aae0a9b-61e2-4f66-bb98-d470a6beaac2)
|
|
|
|
|
|
2023-09-21 00:12:35 +08:00
|
|
|
|
### 其它说明
|
|
|
|
|
|
2023-08-12 21:11:46 +08:00
|
|
|
|
1. 测试成功的系统有 7 10 11 2022,测试平台为 vultr (bios)、甲骨文 (efi)、aws t2 (xen)、aws t3 (nitro)
|
|
|
|
|
2. 支持 32/64 位系统,UEFI 机器只支持 64 位
|
2023-10-22 23:02:48 +08:00
|
|
|
|
3. 可绕过 Windows 11 硬件限制
|
|
|
|
|
4. 实测不支持 ARM
|
|
|
|
|
5. `zh-cn_windows_10_enterprise_ltsc_2021_x64_dvd_033b7312.iso` 此镜像安装后 `wsappx` 进程会长期占用 CPU
|
|
|
|
|
|
|
|
|
|
这是镜像的问题,解决方法是安装 `VCLibs` 库
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2023-09-21 00:12:35 +08:00
|
|
|
|
<https://www.google.com/search?q=ltsc+wsappx>
|
|
|
|
|
|
2023-10-22 23:02:48 +08:00
|
|
|
|
6. 以下网站可找到 iso 链接
|
|
|
|
|
|
|
|
|
|
<https://archive.org>
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2023-10-22 23:02:48 +08:00
|
|
|
|
<https://massgrave.dev/genuine-installation-media.html>
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2023-09-21 00:12:35 +08:00
|
|
|
|
## 内存要求
|
|
|
|
|
|
|
|
|
|
| 系统 | 传统安装 | 云镜像 |
|
|
|
|
|
| ------------------------------ | -------- | ------ |
|
|
|
|
|
| Debian | 384M | 512M |
|
|
|
|
|
| Ubuntu | 1G | 512M |
|
|
|
|
|
| CentOS / Alma / Rocky / Fedora | 1G | 512M |
|
|
|
|
|
| Alpine | 256M | - |
|
2023-10-22 23:02:48 +08:00
|
|
|
|
| openSUSE | - | 512M |
|
|
|
|
|
| Arch | - | 512M |
|
|
|
|
|
| Gentoo | - | 512M |
|
2023-09-21 00:12:35 +08:00
|
|
|
|
| Windows | 1G | - |
|
|
|
|
|
|
|
|
|
|
## 网络要求
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2023-10-22 23:02:48 +08:00
|
|
|
|
用`安装模式`安装 Linux 要有 DHCPv4
|
|
|
|
|
|
|
|
|
|
其他情况支持静态 IP、IPv6(包括安装 Alpine、云镜像、Windows iso、dd)
|
|
|
|
|
|
|
|
|
|
运行脚本时不需要填写静态 IP 地址
|
|
|
|
|
|
|
|
|
|
## 虚拟化要求
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2023-10-22 23:02:48 +08:00
|
|
|
|
不支持 OpenVZ、LXC 虚拟机
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2023-10-22 23:02:48 +08:00
|
|
|
|
请使用 <https://github.com/LloydAsp/OsMutation>
|
2023-08-12 21:11:46 +08:00
|
|
|
|
|
2023-09-21 00:12:35 +08:00
|
|
|
|
## 默认密码
|
|
|
|
|
|
2023-10-22 23:02:48 +08:00
|
|
|
|
| 系统 | 用户名 | 密码 |
|
|
|
|
|
| ------------------ | ------------- | ------ |
|
|
|
|
|
| Linux | root | 123@@@ |
|
|
|
|
|
| Windows (iso 安装) | administrator | 123@@@ |
|
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、多网卡
|