对/dev的处理,我以为这样就可以了,结果基于这个dev是打包过来的模板建立的系统,启动正常,但是进入(vzctl enter
veid)的时候提示cannot open
pty。反正肯定是dev出了问题,但是怎么处理我不知道。我采用了最笨的方法,将一个基于asianux2.0sp1最小安装的模板(openvz网站
有下)里面的dev下所有内容拷到我做的asianux2.0sp2模板里面,这才算可以进入。 接下来创建boot、home、initrd、media、misc、opt、proc、selinux、srv、sys、tmp,并且创建mnt软连接,给tmp加t权限。 然后做如下一系列操作
# cat vecreate.sh
#!/bin/bash
#2007-07-17 by fan3838 if[ $# -lt 4 ];then echo"Usage: $0 " echo"Eg: $0 192 172.16.81.192 172.16.80.11 lvs192" echo"The ipaddress must be not exist in the local network"
exit 1
fi
#create a VE with asianux-2.0-SP2-ok-x86 template echo"-----------------------------"
vzctl create $1 --ostemplate asianux-2.0-SP2-ok-x86 if[ $?= 0 ]
then echo"-----------------------------" echo"-- create ok --" echo"-----------------------------" else echo"-----------------------------" echo"-- create failed --" echo"-- why ? --" echo"-- look the infomations --" echo"-----------------------------"
exit 2
fi
#set the ipaddr nameserver and hostname
vzctl set $1 --ipadd $2 --nameserver $3 --hostname $4 --onboot yes --save
# cat vestart.sh
#!/bin/bash
#2007-07-17 by fan3838 if[ $# -lt 1 ];then echo"Usage: $0 " echo"eg: $0 192" echo"-----------------------------------------------------------"
vzlist -a echo"-----------------------------------------------------------"
exit 1
fi
#start a VE echo"-----------------------------"
vzctl start $1 if[ $?= 0 ]
then echo"-----------------------------" echo"-- start ok --" echo"-----------------------------" else echo"-----------------------------" echo"-- start failed --" echo"-- why ? --" echo"-- look the infomations --" echo"-----------------------------"
exit 2
fi
# cat vestop.sh
#!/bin/bash
#2007-07-17 by fan3838 if[ $# -lt 1 ];then echo"Usage: $0 " echo"eg: $0 192" echo"-----------------------------------------------------------"
vzlist -a echo"-----------------------------------------------------------"
exit 1
fi
#stop a VE echo"-----------------------------"
vzctl stop $1 if[ $?= 0 ]
then echo"-----------------------------" echo"-- stop ok --" echo"-----------------------------" else echo"-----------------------------" echo"-- stop failed --" echo"-- why ? --" echo"-- look the infomations --" echo"-----------------------------"
exit 2
fi