Home/Blog/iSCSI NFS CIFS Storage Protocols | Master Enterprise Connectivity
Storage

iSCSI NFS CIFS Storage Protocols | Master Enterprise Connectivity

Master storage connectivity protocols with our comprehensive guide. Learn iSCSI, NFS, and SMB/CIFS configuration for Windows and Linux environments to optimize your enterprise storage infrastructure.

iSCSI NFS CIFS Storage Protocols | Master Enterprise Connectivity

For the purpose of this article we are going to focus on two methods of connecting to storage: LUNs and File Shares. In our examples we will be using Open Filer as the storage device, then various Linux and Windows editions to connect to the storage system.

📘 Note: This article covers only the client side of things. You can see our article on Configuring Open Filer if you wish to quickly setup the server side of any of the protocols outlined in this article.

Logical Unit Numbers (LUN) Explained

When considering the use of LUNs there are two main protocols used: Fiber Channel and iSCSI. Understanding the differences between these protocols is crucial for enterprise storage planning.

Fiber Channel Requirements

In order to use Fiber Channel you will need a Fiber Channel Host Bus Adapter (HBA) in your Server, and fiber optic cables running to your storage device which must speak the fiber channel protocol.

iSCSI Advantages

With iSCSI an HBA is optional and runs over normal Ethernet. In most cases it is advisable to have a dedicated network port for your iSCSI traffic, but it does not necessarily require any additional hardware. The reason why you may want to consider adding an iSCSI HBA to the mix is to offload that processing from your servers CPU.

At this point you may ask yourself which will give me better performance, iSCSI or Fiber Channel? The answer is, I have heard good arguments for each protocol; so it is really up to you. I usually use iSCSI because it does not require specialized hardware and I get sufficient performance for what I usually use.

When considering Server Virtualization, both of these protocols are supported on all the server class products, Example: Xenserver, VMWare, and Hyper-V.

Network Shares Explained

There are quite a few protocols for sharing files. In this article I will focus on Network File Systems (NFS) and Server Message Block (SMB) shares.

SMB/CIFS Shares

SMB Shares are also referred to as Common Internet File System (CIFS) shares or Windows Shares. With SMB Shares you specify a resource you want to share on a given server, then the client connects to that resource using something called a Universal Naming Convention (UNC) path.

A UNC path may look something like \\MyServer\ShareName or \\MyServer\Sharename\myfile where MyServer is the name of your server, and Sharename is the name of the resource that has been shared and myfile is the name of the file you wish to access off the network share.

NFS Shares

NFS Shares are primarily used in Unix and Linux based operating systems. When working with NFS you mount a remote folder to a local path. For example: if you want to share a folder containing a set of documents with the users are your network, you create something called an NFS Export. Your client machines then mount this exported share to a path such as /home/username/documents. Then the user can access those documents as if the documents were stored on their machine.

In the context of virtualization, your Virtualization Host server can mount these NFS exports and run virtual machines stored on these NFS Exports. VMWare ESX and Xenserver support NFS Datastores.

Attaching to an iSCSI LUN

A server hosting an iSCSI LUN is known as an iSCSI Target. For a client to connect to the iSCSI Target you need an iSCSI initiator. An iSCSI initiator may be a HBA or some sort of software. Most operating systems do not come with iSCSI initiator software installed. If you are running Windows Vista/Server 2008 or newer this software is already installed.

Windows Vista/7/Server 2008/R2

  • Click on the Start menu, Select Control Panel
  • Click on Administrative Options
  • Click on iSCSI Initiator
  • You may be prompted to start the iSCSI Initiator Service, Click Yes to start the Service

Linux

Most Linux distributions do not come with iSCSI initiator software. One piece of software which will allow you to connect is the Open-iSCSI Project.

Installing iSCSI Initiator on Red Hat based Distributions:

yum install iscsi-initiator-utils

Installing iSCSI Initiator on Debian based Distributions:

sudo apt-get install open-iscsi

Authentication

After you have installed your iSCSI initiator, we have to configure it. The first step is to enter your authentication information. If you are not using iSCSI authentication, you can skip this part. This is stored in the /etc/iscsi/iscsid.conf file.

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

💡 Tip: In your configuration file you may see a “#” at the beginning of the line. The lines that start with a “#” are considered comments and are not processed as part of the configuration. If your server requires authentication, remove the “#” from the beginning of the line, then enter the appropriate information on each line.

Connecting your LUN

Now that your iSCSI authentication is configured, you can start the service:

/etc/init.d/open-iscsi start

To get the IQN of your server, you can run:

cat /etc/iscsi/initiatorname.iscsi

The iscsiadm utility is used to tell the initiator where to discover the iSCSI LUN:

iscsiadm -m discovery -t sendtargets -p MyServer

You may need to re-start the iSCSI service before the LUN will show up:

/etc/init.d/open-iscsi restart

⚠️ Note: I have had problems where occasionally the LUN does not show up. You can attach the LUN by issuing: iscsiadm -m node --portal "MyServer:3260" -l

Mounting NFS Exports

Windows

Before you can connect to an NFS Share you will need to download the latest Subsystem for UNIX-based applications (SUA) from the Microsoft website.

After you have installed the SUA, mounting the NFS Share via Command Prompt:

mount //MyServer/MyShare <Drive Letter>

Linux

Most Linux Distributions will come with the necessary software to mount an NFS Share. If not, install with:

Debian based:

apt-get install nfs-common

Red Hat based:

yum install nfs-common

Mount the NFS share:

mount -t nfs MyServer:/MyShare /mnt/mymountpoint

To ensure automatic mounting after restart, edit /etc/fstab and add:

MyServer:/MyShare /mnt/mymountpoint nfs

Connecting to SMB/CIFS Shares

Windows

To map a drive from Command Prompt:

net use K: \\myserver\myshare

To map via GUI:

  • Click on the Start menu
  • Right click on Computer, select Map network Drive
  • Select drive letter and enter UNC path
  • Check “Reconnect at login” if desired

Linux

Linux does not natively support SMB Shares, you will need to install SMB Client software.

Debian based:

apt-get install smbfs smbclient

Red Hat based:

yum install samba-client

Mount the SMB Share:

mount -t cifs //myserver/myshare -o username=<user>,password=<pass> /mnt/mymountpoint

To automatically mount on restart, add to /etc/fstab:

//myserver/myshare /mnt/mymountpoint cifs auto,user,username=<yourusername>,workgroup=<yourworkgroup>,password=<yourpassword>,uid=500,gid=500,file_mode=0777,dir_mode=0777,rw 0 0

Frequently Asked Questions

Find answers to common questions

To configure an iSCSI initiator on a Linux system, you will typically follow these steps: 1. **Install the iSCSI Initiator**: For Red Hat-based distributions, use the command: ```bash yum install iscsi-initiator-utils ``` For Debian-based distributions, use: ```bash apt-get install open-iscsi ``` Ensure that the installation completes without errors. 2. **Configure Authentication**: Open the configuration file located at `/etc/iscsi/iscsid.conf`. If your iSCSI target requires CHAP authentication, find the relevant lines (starting with `#`) and uncomment them by removing the `#`. Fill in the necessary username and password details. Here is an example: ```bash node.session.auth.username = your_username node.session.auth.password = your_password ``` Save and close the file. 3. **Start the iSCSI Service**: Start the iSCSI service using the command: ```bash systemctl start iscsid ``` You can also enable it to start on boot: ```bash systemctl enable iscsid ``` 4. **Discover iSCSI Targets**: Use the `iscsiadm` utility to discover available iSCSI targets on your storage server: ```bash iscsiadm -m discovery -t sendtargets -p <IP_of_iSCSI_Target> ``` Replace `<IP_of_iSCSI_Target>` with the actual IP address of your iSCSI target. This command should return a list of available LUNs. 5. **Login to the iSCSI Target**: Once you have discovered the targets, log in to the desired LUN: ```bash iscsiadm -m node --login ``` You may need to specify the target if you have multiple. 6. **Check Connectivity**: Verify that the LUN is visible to the OS: ```bash lsblk ``` Look for the new device (e.g., `/dev/sdb`). **Common Issues and Solutions**: - If you do not see the LUN after logging in, check the firewall settings on your iSCSI target and client. Make sure ports 3260 (default iSCSI port) are open. - If the LUN still does not appear, consider restarting the iSCSI service and re-running the login command. Sometimes, stale sessions can prevent visibility. - Ensure that the network configuration allows for proper communication between the initiator and target. A dedicated network port for iSCSI traffic is recommended for performance and reliability. **Best Practices**: - Regularly monitor your iSCSI connections to ensure they remain stable. Use tools like `iscsiadm -m session` to review active sessions. - Implement CHAP authentication if possible to enhance security. - Consider using multipath I/O for redundancy and improved performance in environments with high availability needs.

Need Expert IT & Security Guidance?

Our team is ready to help protect and optimize your business technology infrastructure.