无KVM的linux服务器如何自己重装操作系统?看下文,可以用VNC去安装系统
How to re-install Centos yourself remotely
Assuming you currently have a Centos 5 64-bit that was installed by us (if you have or want 32-bit, set/use 32-bit accordingly).
Below will reinstall to Centos 5.6 64-bit, change it accordingly if you want other versions of centos.
1. SSH to your server and login as root
2. Type below:
mkdir /centos_install
cd /centos_install
wget http://vault.centos.org/5.6/os/x86_64/images/pxeboot/initrd.img
wget http://vault.centos.org/5.6/os/x86_64/images/pxeboot/vmlinuz
cp vmlinuz /boot/vmlinuz.cent.pxe
cp initrd.img /boot/initrd.img.cent.pxe
3. Add to/Edit the grub menu.lst entry to load the pxe kernel (note: if you were already using grub you do not need to type again the first 2 lines)
vi /etc/grub.conf
in that file paste this in BETWEEN "hiddenmenu" and "title CentOS..." (IMPORTANT):
title Centos Install (PXE)
root (hd0,0)
kernel /vmlinuz.cent.pxe vnc vncpassword=YOURPSW headless ip=YOURIP netmask=255.255.255.0 gateway=GATEWAYIP dns=8.8.8.8 ksdevice=eth0 method=http://vault.centos.org/5.6/os/x86_64/ lang=en_US keymap=us
initrd /initrd.img.cent.pxe
replace
YOURPSW with the VNC password you want setup ( 如何安装VNC Viewer来远程控制vps?如何远程安装操作系统?)
YOURIP with the ip of the box…
GATEWAYIP with the gateway assigned to your box
Hint: you can see the gateway ip by issuing
route -n | grep UG
once you have done this you need to count the number of times “title” appears in the file, press ctrl +x, and save the file
4. Reboot the server by typing
reboot
5. Assuming above is done correctly, you can then use vncviewer (VNC教程和下载: 如何安装VNC Viewer来远程控制vps?如何远程安装操作系统?) and connect to YOURIPHERE:1,比如 123.4.5.6:1
And vnc password is whatever you set above.
For Centos 6.3 64-bit, you can use this:
===============================================
mkdir /centos_install
cd /centos_install
wget http://mirror.teklinks.com/centos/6.3/os/x86_64/images/pxeboot/initrd.img
wget http://mirror.teklinks.com/centos/6.3/os/x86_64/images/pxeboot/vmlinuz
cp vmlinuz /boot/vmlinuz.cent.pxe
cp initrd.img /boot/initrd.img.cent.pxe
vi /etc/grub.conf 加上下面
title Centos Install (PXE)
root (hd0,0)
kernel /vmlinuz.cent.pxe vnc vncpassword=www.ctohome.com headless ip=YOURIP netmask=255.255.255.0 gateway=YOURGATEWAY dns=8.8.8.8 ksdevice=eth0 method=http://mirror.teklinks.com/centos/6.3/os/x86_64/ lang=en_US keymap=us
initrd /initrd.img.cent.pxe
For Centos 5.8 64-bit, you can use this:
===============================================
mkdir /centos_install
cd /centos_install
wget http://mirrors.kernel.org/centos/5.8/os/x86_64/images/pxeboot/initrd.img
wget http://mirrors.kernel.org/centos/5.8/os/x86_64/images/pxeboot/vmlinuz
cp vmlinuz /boot/vmlinuz.cent.pxe
cp initrd.img /boot/initrd.img.cent.pxe
vi /etc/grub.conf 加上下面
title Centos Install (PXE)
root (hd0,0)
kernel /vmlinuz.cent.pxe vnc vncpassword=www.ctohome.com headless ip=YOURSERVERIP netmask=255.255.255.0 gateway=YOURGATEWAY dns=8.8.8.8 ksdevice=eth0 method=http://mirrors.kernel.org/centos/5.8/os/x86_64/ lang=en_US keymap=us
initrd /initrd.img.cent.pxe
编辑/etc/grub.conf后,从title Centos Install (PXE)启动,如果有KVM的独立服务器,可以从KVM屏幕上看到如下显示:
dedicated-server-install-centos-vis-vnc.png
然后你就可以使用 vncviewer (VNC教程和下载: 如何安装VNC Viewer来远程控制vps?如何远程安装操作系统?) 去链接 YOURIPHERE:1,比如 123.4.5.6:1 来安装centos系统了。当然,安装其他系统也类似。vnc的密码,就是你之前设置的密码。 如www.ctohome.com 使用vnc安装系统比kvm有个好处,就是鼠标定位很准确,反映快速,比起kvm来说,体验好很多。效率高。所以,ctohome建议,即使你有kvm,如果要安装centos系统,也可以用这个方法。