Difference between revisions of "ISCSI target"
Jump to navigation
Jump to search
(Created page with "=Installation= <source lang="sh"> emerge tgt </source>") |
|||
Line 1: | Line 1: | ||
− | = | + | =Setup= |
+ | Install: | ||
<source lang="sh"> | <source lang="sh"> | ||
emerge tgt | emerge tgt | ||
+ | </source> | ||
+ | |||
+ | Start service: | ||
+ | <source lang="sh"> | ||
+ | /etc/init.d/tgtd start | ||
+ | rc-update add tgtd default | ||
+ | </source> | ||
+ | |||
+ | Create a target: | ||
+ | <source lang="sh"> | ||
+ | tgtadm --lld iscsi --mode target --op new --tid=1 --targetname iqn.2007-01.be.hacks:nexus1 | ||
+ | </source> | ||
+ | |||
+ | List targets: | ||
+ | <source lang="sh"> | ||
+ | tgtadm --lld iscsi --mode target --op show | ||
+ | </source> | ||
+ | |||
+ | Add a LUN to the target: | ||
+ | <source lang="sh"> | ||
+ | tgtadm --lld iscsi --mode logicalunit --op new --tid 1 --lun 1 -b /dev/vg0/iscsi1 | ||
+ | </source> | ||
+ | |||
+ | Grant public access: | ||
+ | <source lang="sh"> | ||
+ | tgtadm --lld iscsi --mode target --op bind --tid 1 -I ALL | ||
</source> | </source> |
Revision as of 22:56, 26 April 2016
Setup
Install:
emerge tgt
Start service:
/etc/init.d/tgtd start
rc-update add tgtd default
Create a target:
tgtadm --lld iscsi --mode target --op new --tid=1 --targetname iqn.2007-01.be.hacks:nexus1
List targets:
tgtadm --lld iscsi --mode target --op show
Add a LUN to the target:
tgtadm --lld iscsi --mode logicalunit --op new --tid 1 --lun 1 -b /dev/vg0/iscsi1
Grant public access:
tgtadm --lld iscsi --mode target --op bind --tid 1 -I ALL