基本所有的云服务器商家,都会提供免费的Linux系统供安装,比如CentOS、Debian、Ubuntu等。那为什么还要使用一键DD脚本重装/更换系统呢?

  1. 商家提供的系统版本有限,可能没有自己需要的版本。
  2. 商家的系统安装有自己不想要的服务,比如国内的阿里云盾(安骑士)。
  3. 商家的系统无法安装特定软件,比如很挑内核的锐速。

以上几种情况,一键DD脚本就可以为服务器更换一个纯净的系统,帮你解决问题

所需环境

以网络流传较广的Vicer一键DD为例,其所需环境为:

架构:KVM/XEN,不支持OpenVZ。

系统:Debian(首选)/Ubuntu/CentOS

使用脚本前最好先安装如下软件:

# CentOS 与 RedHat
yum install -y xz openssl gawk file wget

# Debian 与 Ubuntu
apt-get install -y xz-utils openssl gawk file

如果出现了错误,请运行
ubuntu/debian 系统安装Curl 命令:

apt-get update -y && apt-get install curl -y

centos 系统安装Curl命令:

yum update -y && yum install curl -y

一键DD脚本使用教程

注意事项:

  1. Vicer脚本目前不支持重装为CentOS 7系统,支持CentOS 6.9以下版本。
  2. 重装的系统源自官方发行版。
  3. 安装过程全自动进行,无需VNC操作,无需进入救援模式。
  4. 系统安装完成后的默认用户名为root,默认密码为:MoeClub.orgDD脚本示例

DD脚本示例

由于脚本命令中需要写明目标系统版本,所以根据需求不同,最终的运行命令也各不相同。下面提供几个使用范例,可以直接复制使用,也可以将命令中的系统版本替换为其它版本。


一键脚本可选系统

下列脚本支持系统重置为 CentOS 7、CentOS 6、Debian 9、Debian 10、Debian 11、Ubuntu 18.10。(注意有些脚本需要获取 IP、网关、子网掩码等信息,需要填写正确才行安装成功。)

注意重装有风险,可能导致无法开机,谨慎操作!

注意重装有风险,可能导致无法开机,谨慎操作!

注意重装有风险,可能导致无法开机,谨慎操作!

国内无法连接,香港可以正常安装

wget --no-check-certificate -O AutoReinstall.sh https://git.io/AutoReinstall.sh && bash AutoReinstall.sh

回车之后会显示密码(Centos默认密码Pwd@CentOS,其它系统Pwd@Linux)


重装为CentOS 6.9:

以下命令中的 -c 后面为CentOS版本号,-v 后面为64位/32位,可根据需求进行替换。
#CentOS 6.9 64位:

bash <(wget --no-check-certificate -qO- 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh') -c 6.9 -v 64 -a

重装为Debian:

以下命令中的 -d 后面为Debian版本号,-v 后面为64位/32位,可根据需求进行替换。

#Debian 8 64位:

bash <(wget --no-check-certificate -qO- 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh') -d 8 -v 64 -a

#Debian 9 64位:

bash <(wget --no-check-certificate -qO- 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh') -d 9 -v 64 -a

重装为Ubuntu:

以下命令中的 -u 后面为Ubuntu版本号,-v 后面为64位/32位,可根据需求进行替换。

# Ubuntu 12.04 64位:
bash <(wget --no-check-certificate -qO- 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh') -u 12.04 -v 64 -a
# Ubuntu 14.04 64位:
bash <(wget --no-check-certificate -qO- 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh') -u 14.04 -v 64 -a
# Ubuntu 16.04 64位:
bash <(wget --no-check-certificate -qO- 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh') -u 16.04 -v 64 -a
# Ubuntu 18.04 64位:
bash <(wget --no-check-certificate -qO- 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh') -u 18.04 -v 64 -a

关于系统重装过程

运行包含正确系统版本号的脚本后,新系统的安装会自动进行,无需人工干预。

可能的三种情况:

  1. 正常情况下10分钟左右就可以安装成功了,期间可以在VNC中观察安装过程:

  2. 如果安装CentOS 7版本,会出现下图提示,表示不支持:

  1. 如果输入了其它不支持或不存在的系统版本,则会出现下图提示,中止安装:


重装系统后更改root密码

耐心等待系统安装成功后,出于安全考虑,建议立即更改默认密码。

具体方法:

1、使用Putty以上文提供的默认密码登录,输入以下命令:passwd root

2、接下来会分两次要求输入新的密码,可以手动输入,也可以在其它位置复制一个密码,然后在Putty界面右键点击即可粘贴上去。

注意:输入新密码时并不会直接显示出来,光标也不会移动,这是正常的。

3、再次登录系统时,记得使用新的root密码。


无限制全自动dd安装windows一键脚本

示例脚本,补全DD包直连地址后运行即可;

wget --no-check-certificate -qO InstallNET.sh 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh' && bash InstallNET.sh -dd '[Windows dd包直连地址]'

精简版DD包

选择好版本,输入以下一键脚本即可

# DD Windows Server 2003 32位 精简版 [账户Administrator密码cxthhhhh.com]
wget --no-check-certificate -qO InstallNET.sh 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh' && bash InstallNET.sh -dd 'https://oss.sunpma.com/Windows/Win_Server2003_86_Administrator_cxthhhhh.com.gz'

# DD Windows Server 2008 R2 64位 精简版 [账户Administrator密码nat.ee]
wget --no-check-certificate -qO InstallNET.sh 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh' && bash InstallNET.sh -dd 'https://oss.sunpma.com/Windows/Win_Server2008R2_sp1_64_Administrator_nat.ee.gz'

# DD Windows Server 2012 R2 64位 精简版 [账户Administrator密码WinSrv2012r2x64-Chinese]
wget --no-check-certificate -qO InstallNET.sh 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh' && bash InstallNET.sh -dd 'https://oss.sunpma.com/Windows/Win_Server2012R2_64_Administrator_WinSrv2012r2x64-Chinese.gz'

# DD Windows Server 2019 Datacenter 64位 精简版 [账户Administrator密码WinSrv2019dc-Chinese]
wget --no-check-certificate -qO InstallNET.sh 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh' && bash InstallNET.sh -dd 'https://oss.sunpma.com/Windows/Win_Server2019_64_Administrator_WinSrv2019dc-Chinese.gz'

# DD Windows7 32位 精简版 [账户Administrator密码Windows7x86-Chinese]
wget --no-check-certificate -qO InstallNET.sh 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh' && bash InstallNET.sh -dd 'https://oss.sunpma.com/Windows/Win7_86_Administrator_Windows7x86-Chinese.gz'

# DD Windows7 sp1 64位 企业精简版 [账户Administrator密码nat.ee]
wget --no-check-certificate -qO InstallNET.sh 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh' && bash InstallNET.sh -dd 'https://oss.sunpma.com/Windows/Win7_sp1_64_Administrator_nat.ee.gz'

#DD Windows8.1 64位 专业精简版 [账户Administrator密码nat.ee]
wget --no-check-certificate -qO InstallNET.sh 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh' && bash InstallNET.sh -dd 'https://oss.sunpma.com/Windows/Win8.1_64_Administrator_nat.ee.gz'

#DD Windows8.1 64位 适量精简版 [账户Administrator密码Vicer]
wget --no-check-certificate -qO InstallNET.sh 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh' && bash InstallNET.sh -dd 'https://oss.sunpma.com/Windows/Win8.1_64_Administrator_Vicer.gz'

# DD Windows10 2016LTSB 64位 企业深度精简版 [账户Administrator密码nat.ee]
wget --no-check-certificate -qO InstallNET.sh 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh' && bash InstallNET.sh -dd 'https://oss.sunpma.com/Windows/Win10_2016LTSB_64_Administrator_nat.ee.gz'

# DD Windows10 2019LTSC 64位 企业适量精简版 [账户Administrator密码Vicer]
wget --no-check-certificate -qO InstallNET.sh 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh' && bash InstallNET.sh -dd 'https://oss.sunpma.com/Windows/Win10_2019LTSC_64_Administrator_Vicer.gz'

完整版DD包

# DD Windows Server 2012 R2 Datacenter 64位 完整版 [账户administrator密码Password147]
wget --no-check-certificate -qO InstallNET.sh 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh' && bash InstallNET.sh -dd 'https://oss.sunpma.com/Windows/Whole/cn_windows2012r2_administrator_Password147.gz'

# DD Windows Server 2016 Datacenter 64位 完整版 [账户administrator密码Password147]
wget --no-check-certificate -qO InstallNET.sh 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh' && bash InstallNET.sh -dd 'https://oss.sunpma.com/Windows/Whole/cn_windows2016_administrator_Password147.gz'

# DD Windows Server 2019 Datacenter 64位 完整版 [账户administrator密码Password147]
wget --no-check-certificate -qO InstallNET.sh 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh' && bash InstallNET.sh -dd 'https://oss.sunpma.com/Windows/Whole/cn_windows2019_administrator_Password147.gz'

# DD Windows7 sp1 64位 [账户Administrator密码nat.ee]
wget --no-check-certificate -qO InstallNET.sh 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh' && bash InstallNET.sh -dd 'https://oss.sunpma.com/Windows/Whole/Win7_sp1_64_Administrator_nat.ee.gz'

# DD Windows8.1 64位 [账户Administrator密码nat.ee]
wget --no-check-certificate -qO InstallNET.sh 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh' && bash InstallNET.sh -dd 'https://oss.sunpma.com/Windows/Whole/Win8.1_64_Administrator_nat.ee.gz'

# DD Windows10 LTSC 64位 [账户Administrator密码nat.ee]
wget --no-check-certificate -qO InstallNET.sh 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh' && bash InstallNET.sh -dd 'https://oss.sunpma.com/Windows/Whole/Win10_LTSC_64_Administrator_nat.ee.gz'

如果一直卡在starting up the partitioner这个页面很久的话,我们可以查看后台监控的磁盘性能等参数,如果发现磁盘读写降下来的时候可以尝试重启机器,正常情况下都会DD成功。注意:DD完系统后一定要先修改密码。