標籤:style http color 使用 os strong 檔案 io
注意:本文使用的為公網源 所以重裝的機器需要能連公網,如果不能串連公網你需要搭建私人源
登入到需要重裝系統的centos上 下載開機檔案
本文安裝的為centos6.5 根據不同版本下載不同的檔案
wget http://mirrors.aliyun.com/centos/6.5/os/x86_64/images/pxeboot/vmlinuzwget http://mirrors.aliyun.com/centos/6.5/os/x86_64/images/pxeboot/initrd.img
將下載的檔案複製到/boot 目錄
cp vmlinuz /boot/vmlinuz.centos.pxecp initrd.img /boot/initrd.img.centos.pxe
安裝grub
yum install grub -y
添加安裝啟動項
編輯啟動菜單
vim /boot/grub/menu.lst
添加
title CentOS 6.5 VNC Installationroot (hd0,0)kernel /vmlinuz.centos.pxe vnc vncpassword=PASS headless ip=127.0.0.1 netmask=255.255.255.0 gateway=127.0.0.1 dns=114.114.114.114 ksdevice=eth0 method=http://mirrors.aliyun.com/centos/6.5/os/x86_64/ keymap=usinitrd /initrd.img.centos.pxe
更改PASS為你的vnc密碼
更改127.0.0.1 為重裝系統主機的IP
更改網關127.0.0.1為重裝系統主機的網關
編輯啟動順序
找到
default=0
若剛才添加的title 為第二個title 則將0改為1
若剛才添加的title 為第三個title 則將0改為2
以此類推
附上我的配置
# Note that you do not have to rerun grub after making changes to this file# NOTICE: You have a /boot partition. This means that# all kernel and initrd paths are relative to /boot/, eg.# root (hd0,0)# kernel /vmlinuz-version ro root=/dev/mapper/vg_openstack-lv_root# initrd /initrd-[generic-]version.img#boot=/dev/sdadefault=1timeout=5splashimage=(hd0,0)/grub/splash.xpm.gzhiddenmenutitle CentOS (2.6.32-431.el6.x86_64) root (hd0,0) kernel /vmlinuz-2.6.32-431.el6.x86_64 ro root=/dev/mapper/vg_openstack-lv_root rd_LVM_LV=vg_openstack/lv_root rd_NO_LUKS.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_LVM_LV=vg_openstack/lv_swap rd_NO_DM rhgb quiet initrd /initramfs-2.6.32-431.el6.x86_64.imgtitle CentOS 6.5 VNC Installationroot (hd0,0)kernel /vmlinuz.centos.pxe vnc vncpassword=PASS headless ip=192.168.2.254 netmask=255.255.255.0 gateway=192.168.2.1 dns=114.114.114.114 ksdevice=eth0 method=http://mirrors.aliyun.com/centos/6.5/os/x86_64/ keymap=us initrd /initrd.img.centos.pxe
最後仔細檢查是否有錯誤
重啟
reboot
通過vnc用戶端訪問 IP:1
開始安裝
參考:http://www.centosx.com/install-centos-remotely-through-vnc/