server side (Centos)
修改 /etc/init.d/tgtd
start 結尾加入
------------------------------------------------------------------------------------------------------------------------
sleep 1s
tgtadm --mod target --op new --tid=1 --targetname=pcname
tgtadm --mod logicalunit --op new --tid=1 --lun=1 --backing-store=/dev/
i2o/hdx
tgtadm --mode target --op bind --tid=1 --initiator-address=192.168.0.1
------------------------------------------------------------------------------------------------------------------------
stop 開頭加入
------------------------------------------------------------------------------------------------------------------------
tgtadm --mode target --op delete --tid=1
sleep 1s
-----------------------------------------------------------------------------------------------------------------------
client side (Ubuntu)
修改/etc/iscsi/iscsid.conf ==> node.startup = automatic
修改/etc/init.d/open-iscsi
starttargets 結尾加入
------------------------------------------------------------------------------------------------------------------------
sleep 1s
mount /mnt/iscsi_folder
------------------------------------------------------------------------------------------------------------------------
stoptargets 開頭加入
------------------------------------------------------------------------------------------------------------------------
umount /mnt/iscsi_folder
iscsiadm --mode node --target pcname --logout
-----------------------------------------------------------------------------------------------------------------------
2013/10/4補充
較新的系統可以在/etc/fstab的iscsi設備設為 auto,_netdev ,automount會自動將這個device排在網路啟動後才掛載。
沒有留言:
張貼留言