在更新grub操作的时候一定要注意,不要覆盖了系统的vmlinuz和initrd.img。
需要在Debian下做如下的配置。
wget -c
http://mirrors.sohu.com/centos/5.6/os/i386/images/pxeboot/initrd.img
-P /boot/initrd.img0
wget -c
http://mirrors.sohu.com/centos/5.6/os/i386/images/pxeboot/vmlinuz
-P /boot/vmlinuz0
ln -s /boot/initrd.img0 /boot/vmlinuz0 /
编译/etc/grub.d/40_custom
shift+g跳到最后一行
menuentry 'CentOS Remote Installation' {
set root='(hd0,1)'
linux /vmlinuz0 vnc vncpassword=123456 headless
ip=10.0.2.18 netmask=255.255.255.0 gateway=10.0.2.1 dns=8.8.4.4
hostname=hosta.foo.cc ksdevice=eth0
method=http://mirrors.sohu.com/centos/5.6/os/i386/ lang=en_US
keymap=us
initrd /initrd.img0
}
要让grub启动的时候启动centos远程安装,需要修改
/etc/default/grub
GRUB_DEFAULT=2
(0代表第一个menuentry,1代表第二个menuentry,依次类推)
然后执行命令更新grub,在操作的时候一定要注意,不要覆盖了系统的vmlinuz和initrd.img,本次完全是为了测试。
root@debian:~# update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.32-5-686
Found initrd image: /boot/initrd.img-2.6.32-5-686
done
reboot系统,测试远程安装