旧系统是centos5.3,想要重装新的系统为centos6.3

远程重装系统,是通过ssh+vnc

【安装vnc】

1、yum -y install vnc-server

2、修改配置文件

/etc/sysconfig/vncservers

VNCSERVERS="1:root"

VNCSERVERARGS[1]="-geometry 1024x768"

3、为root用户设置vnc的密码

vncserver

4、启动vnc  /etc/init.d/vncserver restart


【客户端连接】

然后在windows下通过UltraVNC Viewer这款软件连接即可

填写模板,ip:1,然后输入刚刚设置的密码就可以登录了


【重装系统】

1、下载引导文件

cd /boot

wget http://mirror.centos.org/centos/6/os/x86_64/p_w_picpaths/pxeboot/initrd.img

wget http://mirror.centos.org/centos/6/os/x86_64/p_w_picpaths/pxeboot/vmlinuz

6是所有centos6.x版本系统的引导文件


2、修改Grub配置文件

vi /boot/grub/grub.conf

添加默认启动项

title CentOS Remote Install

root (hd0,0)  

kernel /vmlinuz vnc vncpassword=123456 headless ip=192.168.1.18 netmask=255.255.255.0

gateway=192.168.1.1 dns=192.168.1.1 hostname=remoteinstall.rashost.com ksdevice=eth0

#method=http://mirror.centos.org/centos-5/5/os/x86_64/ lang=en_US keymap=us

method=http://192.168.1.19/1 lang=en_US keymap=us

initrd /initrd.img

【http://192.168.1.19/1 是内网的一台web机器,1目录下有centos6.3版本的系统,把6.3的iso挂载到19上,然后把iso里面的文件拷贝出来】

保存重启机器即可

145459560.png

【选择URL,里面输入http://192.168.1.19/1】然后linux就会自动找到需要的文件


145500940.png

vnc服务并不需要添加到开机启动



145500595.png