ISCSI实现ZFS共享(Server端及Client端)

iSCSI

Server

Create Volume

zfs create [-ps] [-b blocksize] [-o property=value] … -V size volume

Creates a volume of the given size.
The volume is exported as a block device in /dev/zvol/{dsk,rdsk}/path,
where path is the name of the volume in the ZFS namespace

$ zfs create -ps -b 4096 -V 8192 sdd/template

Create Target

scstadmin -add_target -driver

Add a target to a target driver.

$ scstadmin -add_target tamplate -driver iscsi

Open Disk

scstadmin -open_dev -handler -attributes <p=v,…>

Create a new SCST device using the specified device handler and attributes.

$ scstadmin -open_dev tamplate -handler vdisk_blockio -attributes filename=/dev/zvol/sdd/tamplate

Create Group

scstadmin -add_group -driver -target

Add an initiator group to the specified target.

scstadmin -add_group tamplate -driver iscsi -target tamplate

Create LUN

scstadmin -add_lun -driver -target [-group ]
-device -attributes <p=v,…>

Add a LUN to a target or initiator group.

scstiadmin -add_lun 0 -driver iscsi -target tamplate -group template -device tamplate

Add Init

scstadmin -add_init -driver -target -group

Add an initiator to an initiator group. is either an explicit initiatorname or an initiator name pattern. The wildcard characters ‘*’, ‘?’ and '!'are supported.

scstadmin -add_init **iqn.1991-05.com.microsoft:ftp** -driver iscsi -target tamplate -group template

Enable Target

scstadmin -enable_target -driver

Enable a target.

scstadmin -enable_target template -driver iscsi

Set Enable

-set_drv_attr -attributes <p=v,…>

Set the value of one or more target driver attributes.

-noprompt

Do not prompt for confirmation before modifying the SCST state.

scstadmin -set_drv_attr template -driver iscsi -attributes enabled=1 -noprompt

Save Config

scstadmin -write_config

Save the current configuration to the specified file.

scstadmin -write_config /etc/scst.conf

Client-Windows

Start Service

sc config MSiSCSI start= auto
net start MSiSCSI

Add Target Portal

iscsicli AddTarget

iscsicli AddTargetPortal 192.168.2.120 3260

Login target

iscsicli QLoginTarget template

Reference

scstadmin

zfs(8) - Linux man page

iscsictl(8)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值