标题:
[原创]万能开机连接iscsi,自创,网吧用
[打印本页]
作者:
iamqiuhui
时间:
2009-2-15 19:31
标题:
[原创]万能开机连接iscsi,自创,网吧用
::要先下载cmdow.exe,其作用为禁止关闭当前窗口
www.commandline.co.uk
cd c:\windows
cmdow.exe @ /dis /hid
@echo off
echo *****************正在加载游戏,请勿关闭,谢谢*************************
net start /W MSISCSI >nul 2>nul
hostname >%temp%\hostname.txt
for /f %%h in (%temp%\hostname.txt) do iscsicli nodename %%h
iscsicli addtargetportal 192.168.0.228 3260
iscsicli qaddtarget
www.hintsoft.net:
192.168.0.228&&echo 强制刷新并且目标添加成功
iscsicli logintarget
www.hintsoft.net:
T * * * * * * * * * * * * * * * 0 >nul 2>nul
if exist e:\ goto end
::名称重复,重命名
if not exist e:\ for /f %%h in (%temp%hostname.txt) do set m=%%h
set nodename=%m:~2%
iscsicli nodename %nodename%
echo 名称设成功!
iscsicli qaddtarget
www.hintsoft.net:
192.168.0.228&&echo 强制刷新并且目标添加成功
iscsicli logintarget
www.hintsoft.net:
T * * * * * * * * * * * * * * * 0
if exist e:\ goto end
del %temp%hostname.txt
diskpart /s c:\disk.txt >nul 2>nul
:end
exit
这个脚本适合于iscsi initiator2.0
1。主要功能可以避免因为结点重名的问题,利用hostname做为结点名
2。针对无盘系统,防止添加persisttarget后,不能出盘的问题,因为服务端保留了客户机信息,而客户机重启sessioninfo丢失,不能连接target
3。上面的IP与targetname根据需要手动修改
4。cmdow.exe防止客人关闭此命令窗口.
5。万能连接网吧游戏盘。
如果是iscsi initiator1.0
要手动刷新target,
iscsicli listtargets
这个脚本还不够完善:
1。如何合并版本1。和版本2
2。里面一些术语不明白:
如target flag tunel datadigist persist target lun 等等,
希望有高手指教一下:
问题就是
我想实现手动添加target
iscsicli addtarget
版本2,
可以iscsicli qaddtarget实现
版本的参数未知不能实现
还有 T * * * * * * * * * * * * * * * 0什么意思?
QQ:695589248 有问题大家讨论,给我发邮件
[
Last edited by iamqiuhui on 2009-2-15 at 20:48
]
作者:
HAT
时间:
2009-2-15 19:45
Quote:
::要先下载
cmd.exe
,其作用为禁止关闭当前窗口
www.commandline.co.uk
笔误?
作者:
iamqiuhui
时间:
2009-2-15 20:49
谢谢版主提醒!