Most basic iscsi on linux

We had a machine at work that needed to connect to a Dell Equallogic box via iscsi. I set this up, but since I was only using it about once a month, I did it manually (this was to take a backup of the snapshot, so the Dell mount point would vanish after a while, so we set this up manually). So, this is how to attach to it from linux.

First on the linux machine as root install the iscsi-initiator-utils. Under RHEL/CentOS this would be:

 

yum install iscsi-initiator-utils

 

That is all you need to install on the linux box. Since we are doing this manually, we do not need to edit /etc/iscsi/iscsid.conf or anything like that. We simply need to discover the client so we can get the target name and then mount that. Fuse should be installed by default on RHEL/CentOS so this should work out of the box. Lets assume that the Dell is at 10.1.1.1 on your network. Let us discover it and mount it, after we start the iscsi daemon:

 

/etc/init.d/iscsid start

/etc/init.d/iscsi start

iscsiadm -m discovery -t sendtargets -p 10.1.85.63

iscsiadm –mode node –targetname <that name from the previous command> –login

 

dmesg <check for new drives>

Lets mount it at /mnt/iscsi, so first make the directory, then mount it:

mkdir /mnt/iscsi

vmfs-fuse /dev/<new drive> /mnt/iscsi

 

Now, the Dell should  be mounted at /mnt/iscsi and you should be able to use it just as you would any other filesystem.

This entry was posted in Servers. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *