Oracle的Centos7重装为Centos7 2020-04-16T10:52:48.000Z 2025-10-31T12:22:48.556Z China
此为甲骨文原生 Centos7 系统专用! 2022年6月18日 测试: CentOS-7-2022.05.30-0 镜像 正常重装
Centos7重装 首次从C7重装为C7 将以下代码全部复制后到ssh粘贴回车即可
主要是使用initrd.img 和vmlinuz 来运行网络VNC
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 yum -y install wget vim lsof net-tools cat << EOF >/boot/Reinstall.sh #!/bin/bash rm -rf /boot/initrd77.img /boot/vmlinuz77 wget -P /boot/ http://vault.centos.org/7.2.1511/os/x86_64/images/pxeboot/initrd.img -O /boot/initrd77.img wget -P /boot/ http://vault.centos.org/7.2.1511/os/x86_64/images/pxeboot/vmlinuz -O /boot/vmlinuz77 cat << EOFEOF>/etc/grub.d/40_custom #!/bin/sh exec tail -n +3 \\\$0 menuentry VNCInstallCentos7 { set root='(hd0,gpt3)' linuxefi /boot/vmlinuz77 inst.vnc inst.vncpassword=11223355 inst.headless ip=dhcp nameserver=114.114.114.114 inst.repo=http://vault.centos.org/7.2.1511/os/x86_64/ inst.lang=en_US inst.keymap=us initrdefi /boot/initrd77.img } EOFEOF #sed -i 's/GRUB_DEFAULT=saved/g' /etc/default/grub grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg grub2-reboot VNCInstallCentos7 EOF bash /boot/Reinstall.sh reboot
请注意!
/boot/efi/EFI/centos/grub.cfg
有的是
/boot/efi/EFI/redhat/grub.cfg
等待网络核心启动完成,然后用vnc连接机器IP:1 密码为11223355
再次从C7重装为C7 将以下代码全部复制后到ssh粘贴回车即可(注意这里的gpt2,有些机器可能是gpt3)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 yum -y install wget vim lsof net-tools cat << EOF >/boot/Reinstall.sh #!/bin/bash rm -rf /boot/initrd77.img /boot/vmlinuz77 wget -P /boot/ http://vault.centos.org/7.2.1511/os/x86_64/images/pxeboot/initrd.img -O /boot/initrd77.img wget -P /boot/ http://vault.centos.org/7.2.1511/os/x86_64/images/pxeboot/vmlinuz -O /boot/vmlinuz77 cat << EOFEOF>/etc/grub.d/40_custom #!/bin/sh exec tail -n +3 \\\$0 menuentry VNCInstallCentos7 { set root='(hd0,gpt2)' linuxefi /vmlinuz77 inst.vnc inst.vncpassword=11223355 inst.headless ip=dhcp nameserver=114.114.114.114 inst.repo=http://vault.centos.org/7.2.1511/os/x86_64/ inst.lang=en_US inst.keymap=us initrdefi /initrd77.img } EOFEOF #sed -i 's/GRUB_DEFAULT=saved/g' /etc/default/grub grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg grub2-reboot VNCInstallCentos7 EOF bash /boot/Reinstall.sh reboot
等待网络核心启动完成,然后用vnc连接机器IP:1 密码为11223355
从原生Linux系统重装为C7 将以下代码全部复制后到ssh粘贴回车即可
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 yum -y install wget vim lsof net-tools cat << EOF >/boot/Reinstall.sh #!/bin/bash rm -rf /boot/initrd77.img /boot/vmlinuz77 wget -P /boot/ http://vault.centos.org/7.2.1511/os/x86_64/images/pxeboot/initrd.img -O /boot/initrd77.img wget -P /boot/ http://vault.centos.org/7.2.1511/os/x86_64/images/pxeboot/vmlinuz -O /boot/vmlinuz77 cat << EOFEOF>/etc/grub.d/40_custom #!/bin/sh exec tail -n +3 \\\$0 menuentry VNCInstallCentos7 { set root='(hd0,gpt3)' linuxefi /boot/vmlinuz77 inst.vnc inst.vncpassword=11223355 inst.headless ip=dhcp nameserver=114.114.114.114 inst.repo=http://vault.centos.org/7.2.1511/os/x86_64/ inst.lang=en_US inst.keymap=us initrdefi /boot/initrd77.img } EOFEOF #sed -i 's/GRUB_DEFAULT=saved/g' /etc/default/grub grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg grub2-reboot VNCInstallCentos7 EOF bash /boot/Reinstall.sh reboot
等待网络核心启动完成,然后用vnc连接机器IP:1 密码为11223355
Win7
此DD包仅适用于Oracle甲骨文Ubuntu DD Win使用
说明:Oracle是采用UEFI启动,普通DD包均不支持UEFI启动
DD Windows 7 64位旗舰精简版 Oracle甲骨文专用 [账户Administrator密码www.nat.ee\]
1 2 apt-get install -y xz-utils openssl gawk file wget --no-check-certificate -qO InstallNET.sh 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh' && bash InstallNET.sh -dd 'https://api.moeclub.org/GoogleDrive/1NHKdm3xfQ3HySNCGvrzgdz7RMVCI1qGy'
Debian 甲骨文云 / Oracle Cloud DD Debian 10/11
https://github.com/bohanyang/debi
暂不支持 Oracle Linux 作为原系统。创建新机器时请选择 Ubuntu 20.04 或 18.04 系统模板。
1 2 3 4 curl -fLO https://raw.githubusercontent.com/bohanyang/debi/master/debi.sh && chmod a+rx debi.sh ./debi.sh --cdn --network-console --ethx --bbr --user root --password Kot6qKWr8K3bS7pKno
--bbr 开启 BBR
--ethx 网卡名称使用传统形式,如 eth0 而不是 ens3
--cloud-kernel 安装占用空间较小的 cloud 内核,但可能会导致 UEFI 启动的机器(如 Oracle、Azure 及 Hyper-V、Google Cloud 等)VNC 黑屏。BIOS 启动的普通 VPS 则没有此问题。
默认使用 Debian 官方 CDN 镜像源(deb.debian.org),添加 --china 可使用阿里云镜像源。
如果没有报错可以重启:
约 30 秒后可以尝试 SSH 登录 installer 用户名,密码与之前设置的相同。如果成功连接,可以按 Ctrl-A 然后再按 4 监控安装日志。安装完成后会自动重启进入新系统。
萌咖一键网络重装为 debian9+/ubuntu16.04+
重装后 SSH 登录,用户名 root, 密码:MoeClub.org
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 sudo -i运行: apt-get update yum update apt-get install -y xz-utils openssl gawk file yum install -y xz openssl gawk file wget --no-check-certificate -qO InstallNET.sh 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh' && chmod a+x InstallNET.sh Usage: bash InstallNET.sh -d/--debian [dist-name] -u/--ubuntu [dist-name] -c/--centos [dist-version] -v/--ver [32/i38664/amd64] --ip-addr/--ip-gate/--ip-mask -apt/-yum/--mirror -dd /--image -a/-m bash <(wget --no-check-certificate -qO- 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh' ) -d 9 -v 64 -a -firmware bash <(wget --no-check-certificate -qO- 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh' ) -d 9 -v 64 -a -firmware --mirror 'http://mirrors.aliyun.com/debian/' bash <(wget --no-check-certificate -qO- 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh' ) -u 16.04 -v 64 -a -firmware bash <(wget --no-check-certificate -qO- 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh' ) -u 18.10 -v 64 -a -firmware https://www.ucblog.net/shell/InstallNET.sh
Debian-ARM 甲骨文云 / Oracle Cloud 新配额 ARM DD Debian 10/11
https://github.com/bohanyang/debi
暂不支持 Oracle Linux 作为原系统。创建新机器时请选择 Ubuntu 20.04 或 18.04 系统模板。
1 2 3 4 5 curl -fLO https://raw.githubusercontent.com/bohanyang/debi/master/debi.sh && chmod a+rx debi.sh ./debi.sh --cdn --network-console --bbr --ethx --architecture arm64 --user root --password Kot6qKWr8K3bS7pKno
--bbr 开启 BBR
--ethx 网卡名称使用传统形式,如 eth0 而不是 ens3
--cloud-kernel 安装占用空间较小的 cloud 内核,但可能会导致 UEFI 启动的机器(如 Oracle、Azure 及 Hyper-V、Google Cloud 等)VNC 黑屏。BIOS 启动的普通 VPS 则没有此问题。
默认使用 Debian 官方 CDN 镜像源(deb.debian.org),添加 --china 可使用阿里云镜像源。
如果没有报错可以重启:
约 30 秒后可以尝试 SSH 登录 installer 用户名,密码与之前设置的相同。如果成功连接,可以按 Ctrl-A 然后再按 4 监控安装日志。安装完成后会自动重启进入新系统。
Centos7开启bbr 作者测试成功的方法,供大家参考
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 wget https://elrepo.org/linux/kernel/el7/x86_64/RPMS/kernel-ml-5.18.5-1.el7.elrepo.x86_64.rpm yum install -y ./kernel-ml-5.18.5-1.el7.elrepo.x86_64.rpm grub2-mkconfig -o /boot/grub2/grub.cfg awk -F\\\' \'$1 ==menuentry {print i++ : $2 }\' /boot/grub2/grub.cfg grub2-set-default 0 echo net.core.default_qdisc=fq >> /etc/sysctl.confecho net.ipv4.tcp_congestion_control=bbr >> /etc/sysctl.confvi /etc/sysconfig/selinux SELINUX=disabled reboot lsmod grep bbr sysctl net.ipv4.tcp_available_congestion_control rpm -qa grep kernel yum remove kernel-ml-5.5.7-1.el7.elrepo.x86_64 yum remove kernel-3.10.0-327.el7.x86_64 grub2-mkconfig -o /boot/grub2/grub.cfg echo net.core.default_qdisc=cake >> /etc/sysctl.confecho net.ipv4.tcp_congestion_control=bbr >> /etc/sysctl.confsysctl net.ipv4.tcp_available_congestion_control
error
Error, Not found interfaces config.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 mkdir /etc/network/interfaces.decho source /etc/network/interfaces.d/*auto lo iface lo inet loopback allow-hotplug ens3 iface ens3 inet dhcp > /etc/network/interfaces