Here are procedures to mount a iSCSI disk drive. I've tested it on Ubuntu 8.10:
- Install the open-iscsi package via apt-get
- Edit
/etc/iscsi/iscsid.conf, below is my configuration:
(You may read the original/etc/iscsi/iscsid.conffor more details)
node.startup = automatic
# it seems specify to use CHAP exactly will not work!? really strange!
#node.session.auth.authmethod = CHAP
node.session.auth.username = your-username
node.session.auth.password = your-password
discovery.sendtargets.auth.username = your-username
discovery.sendtargets.auth.password = your-password
node.session.timeo.replacement_timeout = 120
node.conn[0].timeo.login_timeout = 15
node.conn[0].timeo.logout_timeout = 15
node.conn[0].timeo.noop_out_interval = 10
node.conn[0].timeo.noop_out_timeout = 15
node.session.initial_login_retry_max = 4
node.session.iscsi.InitialR2T = No
node.session.iscsi.ImmediateData = Yes
node.session.iscsi.FirstBurstLength = 262144
node.session.iscsi.MaxBurstLength = 16776192
node.conn[0].iscsi.MaxRecvDataSegmentLength = 131072
discovery.sendtargets.iscsi.MaxRecvDataSegmentLength = 32768
# allow the targets to control the setting of the digest checking
node.conn[0].iscsi.HeaderDigest = CRC32C,None
node.conn[0].iscsi.DataDigest = CRC32C,None - Restart open-iscsi by:
/etc/init.d/open-iscsi restart - Discover the iscsi host by:
iscsiadm -m discovery -t sendtargets -p ISCSI-SERVER-IP-ADDRESS
It should return the available targets, e.g.,192.168.1.xx:3260,1 iqn.2009-10.Zebra:iscsi1 - Login the target you want to use by:
iscsiadm -m node -T iqn.2009-10.Zebra:iscsi1 -p 192.168.1.33 -l
There should be no error messages if the configuration is correct. - Restart open-iscsi, again. The target you'd like to use should be automatically logged in and you can find its device name by
dmesgor/var/log/messages. - Suppose its device name is /dev/sdb, create a partition:
fdisk /dev/sdb - Format the partition:
mke2fs -j /dev/sdb - Finally, mount it by:
mount -t ext3 /dev/sdb /path/to/your/mount/point