支持重装的系统: Debian 9/10 Ubuntu 18.04/16.04 CentOS 6/7 自定义DD镜像
使用方法:非常简单
wget https://disk.wej.cc/AutoReinstall.sh && chmod +x AutoReinstall.sh && bash AutoReinstall.sh
1:复制以上代码,ssh连接服务器,粘贴回车
2:选择你需要的系统,输入序号回车
3:默认root密码是
"Pwd@CentOS"
或
“Pwd@Linux"
dd过程请耐心等候15分钟以上..自动断开ssh是正常现象
腾讯云机器修改为内网软件源
cat <<EOF > /etc/apt/sources.list
deb http://mirrors.tencentyun.com/debian/ buster main contrib non-free
deb http://mirrors.tencentyun.com/debian/ buster-updates main contrib non-free
deb http://mirrors.tencentyun.com/debian/ buster-backports main contrib non-free
deb http://mirrors.tencentyun.com/debian-security buster/updates main contrib non-free
deb-src http://mirrors.tencentyun.com/debian/ buster main contrib non-free
deb-src http://mirrors.tencentyun.com/debian/ buster-updates main contrib non-free
deb-src http://mirrors.tencentyun.com/debian/ buster-backports main contrib non-free
deb-src http://mirrors.tencentyun.com/debian-security buster/updates main contrib non-free
EOF
更新并安装一些常用软件
apt update && apt upgrade -y && apt install -y curl wget vim net-tools
若执行更新出错可修改内网dns
nano /etc/resolv.conf
##添加以下
nameserver 183.60.83.19
nameserver 183.60.82.98
保存更新即可
本文出自https://hostloc.com/forum.php?mod=viewthread&tid=645870&highlight=%E7%9C%9F%2B%E7%A9%B6%E6%9E%81
以下是萌咖版本
所需环境
以网络流传较广的Vicer一键DD为例,其所需环境为:
架构:KVM/XEN,不支持OpenVZ。
系统:Debian/Ubuntu/CentOS
一键DD脚本使用教程
注意事项:
Vicer脚本目前不支持重装为CentOS 7系统,支持CentOS 6.9以下版本。
重装的系统源自官方发行版。
安装过程全自动进行,无需VNC操作,无需进入救援模式。
系统安装完成后的默认用户名为root,默认密码为: MoeClub.org
DD脚本示例:
由于脚本命令中需要写明目标系统版本,所以根据需求不同,最终的运行命令也各不相同。
下面提供几个使用范例,可以直接复制使用,也可以将命令中的系统版本替换为其它版本。
重装为CentOS:
以下命令中的 -c 后面为CentOS版本号,-v 后面为64位/32位,可根据需求进行替换。
# CentOS 6.10 64位:
bash <(wget --no-check-certificate -qO- 'https://www.moeelf.com/attachment/LinuxShell/InstallNET.sh') -c 6.10 -v 64 -a
# CentOS 6.10 32位:
bash <(wget --no-check-certificate -qO- 'https://www.moeelf.com/attachment/LinuxShell/InstallNET.sh') -c 6.10 -v 32 -a
重装为Debian:
以下命令中的 -d 后面为Debian版本号,-v 后面为64位/32位,可根据需求进行替换。
# Debian 8 64位:
bash <(wget --no-check-certificate -qO- 'https://www.moeelf.com/attachment/LinuxShell/InstallNET.sh') -d 8 -v 64 -a
# Debian 9 64位:
bash <(wget --no-check-certificate -qO- 'https://www.moeelf.com/attachment/LinuxShell/InstallNET.sh') -d 9 -v 64 -a
# (国内)Debian 10 64位:
bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh') -d 10 -v 64 -a -p "root密码" -port "ssh端口" --mirror 'https://mirrors.ustc.edu.cn/debian'
# Debian 11 64位:
bash <(wget --no-check-certificate -qO- 'https://www.moeelf.com/attachment/LinuxShell/InstallNET.sh') -d 11 -v 64 -a
重装为Ubuntu:
以下命令中的 -u 后面为Ubuntu版本号,-v 后面为64位/32位,可根据需求进行替换。
# Ubuntu 12.04 64位:
bash <(wget --no-check-certificate -qO- 'https://www.moeelf.com/attachment/LinuxShell/InstallNET.sh') -u 12.04 -v 64 -a
# Ubuntu 14.04 64位:
bash <(wget --no-check-certificate -qO- 'https://www.moeelf.com/attachment/LinuxShell/InstallNET.sh') -u 14.04 -v 64 -a
# Ubuntu 16.04 64位:
bash <(wget --no-check-certificate -qO- 'https://www.moeelf.com/attachment/LinuxShell/InstallNET.sh') -u 16.04 -v 64 -a
# Ubuntu 18.04 64位:
bash <(wget --no-check-certificate -qO- 'https://www.moeelf.com/attachment/LinuxShell/InstallNET.sh') -u 18.04 -v 64 -a
# Ubuntu 20.04 64位:
bash <(wget --no-check-certificate -qO- 'https://www.moeelf.com/attachment/LinuxShell/InstallNET.sh') -u 20.04 -v 64 -a
关于系统重装过程
运行包含正确系统版本号的脚本后,新系统的安装会自动进行,无需人工干预。
可能的三种情况:
正常情况下10分钟左右就可以安装成功了,期间可以在VNC中观察安装过程:遇到卡住的回车即可
dd之后失联:
可能是网卡没有自启
ifconfig #查看网卡 例如我的:ens5
vim /etc/network/interfaces
#添加以下两行实现网卡自启 dhcp自动获取ip
auto ens5
iface ens5 inet dhcp
#务必把ens5修改成你自己的网卡名称