写得比较简略,也是综合网络上的文章,总结一下实操的经验
获取启动内核
wget -P /boot/ http://mirrors.163.com/centos/6.8/os/x86_64/images/pxeboot/initrd.img wget -P /boot/ http://mirrors.163.com/centos/6.8/os/x86_64/images/pxeboot/vmlinuz
源地址
163源 http://mirrors.163.com/centos/6.8/os/x86_64/ 阿里源 http://mirrors.aliyun.com/centos/6.8/os/x86_64/
如需要安装特殊版本,即非最新版本centos,需要自己搭建相关web服务
如果需要特殊版本请自行搭建镜像源 yum install nginx location / { autoindex on; } 挂载镜像 mount -o loop /root/CentOS-6.5-x86_64-minimal.iso /usr/share/nginx/html 解压镜像 笔者使用的openvz vps 无法使用loop设备挂载镜像 yum install p7zip p7zip-plugins 7z x /root/CentOS-6.5-x86_64-minimal.iso
grub 相关设置
default xx 表明xx是缺省的启动项目 timeout yy 表明在yy秒后缺省启动项目将启动 fallback zz 在第一个启动项目失败后,过了timeout时间后,就将启动zz项目 grub 添加启动项 vim /boot/grub/grub.conf #在"hiddenmenu" 和 "title CentOS..." 增加一项: #method中的url为安装centos的源 title CentOS reinstall root (hd0,0) kernel /vmlinuz vnc vncpassword=123456 headless ks=file:/dev/null hostname=localhost ip=192.168.0.2 noipv6 netmask=255.255.255.248 gateway=192.168.0.1 dns=8.8.8.8 ksdevice=eth1 method=http://mirrors.aliyun.com/centos/6.8/os/x86_64/ lang=en_US keymap=us initrd /initrd.img
重启后,等待服务器通过web源开始安装,ping 服务器ip,有相应就可以使用vnc软件 tigervnc 连接服务器 ip:1 ,并输入刚刚设置的vnc密码即可进行centos的重装
vnc软件 tigervnc 与 tightvnc 应该都是 vnc 标准实现,但有个小差别 tigervnc 连接格式为 ip:(port - 5900),所以 ip:1 实则为连接服务器5901端口,tightvnc 连接就是实际端口 ip:port 。 这个小细节也曾困扰笔者,故特此标出。