Oracle VPS 重装系统方法(centos7)

Oracle VPS重装系统

Oracle免费VPS官方并没有提供重装系统的功能,所以想要换系统要么是删除重建VPS主机,要么就是使用DD安装系统的方法,目前适用于centos 7重装系统命令代码如下实测该方法不怎么好用):

  1. yum -y install wget vim lsof net-tools
  2. cat << EOF >/boot/Reinstall.sh
  3. #!/bin/bash
  4. rm -rf /boot/initrd77.img /boot/vmlinuz77
  5. wget -P /boot/ http://vault.centos.org/7.0.1406/os/x86_64/images/pxeboot/initrd.img -O /boot/initrd77.img
  6. wget -P /boot/ http://vault.centos.org/7.0.1406/os/x86_64/images/pxeboot/vmlinuz -O /boot/vmlinuz77
  7. cat << EOFEOF>/etc/grub.d/40_custom
  8. #!/bin/sh
  9. exec tail -n +3 \\\$0
  10. # This file provides an easy way to add custom menu entries. Simply type the
  11. # menu entries you want to add after this comment. Be careful not to change
  12. # the ‘exec tail’ line above.
  13. menuentry “VNCInstallCentos7” {
  14. set root=‘(hd0,gpt3)’
  15. linuxefi /boot/vmlinuz77 inst.vnc inst.vncpassword=12345678 inst.headless ip=dhcp nameserver=114.114.114.114 inst.repo=http://vault.centos.org/7.0.1406/os/x86_64/ inst.lang=en_US inst.keymap=us
  16. initrdefi /boot/initrd77.img
  17. }
  18. EOFEOF
  19. #sed -i ‘s/GRUB_DEFAULT=saved/g’ /etc/default/grub
  20. grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg
  21. grub2-reboot VNCInstallCentos7
  22. reboot
  23. EOF
  24. bash /boot/Reinstall.sh

复制以上代码到S-S-H,然后执行并回车。

赞(0) 打赏
未经允许不得转载:复活岛福利 » Oracle VPS 重装系统方法(centos7)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

觉得文章有用就打赏一下吧,非常感谢啊

支付宝扫一扫打赏

微信扫一扫打赏