...
| It depends on your ubuntu-version. On newer systems (since Maverick) you have to install some additional packets: sudo aptitude install iscsitarget iscsitarget-source iscsitarget-dkms
This compiles the required module automagically. On Lucid you have to compile yourself (and maybe again after every kernel-update): sudo aptitude install iscsitarget iscsitarget-source
# compile with module-assitant
sudo m-a a-i iscsitarget
|
forrás
Egy másik lehetőség az iscsi target létrehozására
Creating a Target
An iSCSI target is a host running a daemon that answers iSCSI calles coming in over the IP network. The disk(s) that are provided to the network are plain and simple block devices, so it has nothing to do with LVM, ext2 or ext3, or anything else related to file systems.
In this section we will show you how to quickly setup an iSCSI target using the iSCSI Enterprise Target Project, also known as the iscsitarget. On a Debian based system use:
apt-get install iscsitarget
The configuration file for the iSCSI target is /etc/ietd.conf. For testing purposes I created a 5M disk:
dd if=/dev/zero of=iSCSI-disk bs=1 count=5M
parted iSCSI-disk mklabel loop
losetup /dev/loop2 iSCSI-disk
I then added this disk to the ietd.conf file as:
Target iqn.2001-04.com.example:storage.disk1.sys1.42
Lun 0 Path=/dev/loop2,Type=fileio,ScsiId=42,ScsiSN=42424242
I then started or restarted, depending if the system is already running, the system. That's it! To admire your work one can do:
[prompt]# cat /proc/net/iet/volume
tid:1 name:iqn.2001-04.com.example:storage.disk1.sys1.42
lun:0 state:0 iotype:fileio iomode:wt path:/dev/loop2
and also have a look at:
[prompt]# cat /proc/net/iet/session
tid:1 name:iqn.2001-04.com.example:storage.disk1.sys1.42
This last one changes when an initiator connects to our drives.
The rest of the options used per Target are well described in the manual pages to come along the iSCSI Enterprise Target. This section is written to give you a quick and cheap solution to use for the next section.
forrás