2/1/10

Add ISCSI FileSystem

iSCSI Configuration

  1. iSCSI startup using the init script or manual start-up. You need to edit and configure iSCSI via /etc/iscsi/iscsid.conf file
  2. Discover targets.
  3. Automate target logins for future system reboots.
  4. You also need to obtain iSCSI username, password and storage server IP address target host)

Step  1: Configure iSCSI

Open /etc/iscsi/iscsid.conf with vi text editor:
# vi /etc/iscsi/iscsid.conf
Setup username and password:
node.session.auth.username = My_ISCSI_USR_NAME
node.session.auth.password = MyPassword
discovery.sendtargets.auth.username = My_ISCSI_USR_NAME
discovery.sendtargets.auth.password = MyPassword
Where,
• node.session.* is used to set a CHAP username and password for initiator authentication by the target(s).
• discovery.sendtargets.* is used to set a discovery session CHAP username and password for the initiator authentication by the target(s)
You may also need to tweak and set other options. Refer to man page for more information. Now start the iscsi service:
# /etc/init.d/iscsi start



Step 2: Discover targets


Now use iscsiadm command, which is a command-line tool allowing discovery and login to iSCSI targets, as well as access and management of the open-iscsi database. If your storage server IP address is 192.168.1.5, enter:
# iscsiadm -m discovery -t sendtargets -p 192.168.129.1
# /etc/init.d/iscsi restart
Now there should be a block device under /dev directory. To obtain new device name, type:
# fdisk -l
or
# tail -f /var/log/messages
/dev/sdb is my new block device.


Step 3: Format and Mount iSCSI Volume


You can now partition and create a filesystem on the target using usual fdisk and mkfs.ext3 commands:
# fdisk /dev/sdb
# mkfs.ext3 /dev/sdb1
Tip: If your volume is large size like 1TB, run mkfs.ext3 in background using nohup:
# nohup mkfs.ext3 /dev/sdb1 &

Mount new partition:
# mkdir /mnt/iscsi
# mount /dev/sdb1 /mnt/iscsi



Step 4: Mount iSCSI drive automatically at boot time


First make sure iscsi service turned on at boot time:

# chkconfig iscsi on
Open /etc/fstab file and append config directive:
/dev/sdb1 /mnt/iscsi ext3 _netdev 0 0

Save and close the file.

No comments:

Quick HTTP to HTTPS - Apache2

There are several methods for redirecting your Apache-based website visitors who might type your servers URL using the plain (non-secure) HT...