Mounting iSCSI LUNs: Difference between revisions
DrEdWilliams (talk | contribs) (Created page with "As much as it would be nice to have it the same across the different OS distributions, it seems there are differences -- some of which are rather annoying. == Pre-requisites...") |
(No difference)
|
Revision as of 21:21, 14 August 2021
As much as it would be nice to have it the same across the different OS distributions, it seems there are differences -- some of which are rather annoying.
Pre-requisites
It is assumed that you already have your storage server configured with LUNs (Volumes in the Dell EquaLogic vocabulary) as desired for the application. These instructions assume that no passwords are needed to access the LUNs, but the ID/password stuff is straightforward enough in the config files that it shouldn't be an issue.
You will need to install the client software (it's not installed by default, though it is in the basic distributions):
- Debian/Ubuntu: open-iscsi
- RHEL/CentOS/Fedora: iscsi-initiator-utils
There is one change that needs to be made to the iscsi config file /etc/iscsi/iscsi.conf: the node startup must be set to automatic (if it isn't already set that way). Search for the node.startup parameter in the file and set it to 'automatic':
node.startup = automatic
Restart the service for this to take effect:
sudo systemctl restart iscsid
Establishing Sessions
Mounting the LUN on the storage server to the client system is a two-part process. First, you have to establish a session between the client (initiator in iSCSI vocabulary) and the target (server). The first step is to connect to the server to see what LUNs it has available:
iscsiadm -m discovery -t st -p <SERVER-IP>
This will produce output similar to:
10.2.0.201:3260,1 iqn.2001-05.com.equallogic:0-8a0906-52b816708-021a01fa52261173-shared 10.2.0.201:3260,1 iqn.2001-05.com.equallogic:0-8a0906-85f816708-38832e635165c2b0-files
The first part is the server IP and port (should be the same as specified in the command), but the last part of each line is the iqn for the LUN being advertised. The last part of the iqn should be the name of the LUN/volume ... if there is a problem identifying which one, look back at the storage server. Establishing a session for a LUN should be as simple as:
iscsiadm -m node -T <iqn from above> -p <SERVER-IP> -l
Once this is done (and if you set the node startup to 'automatic' above), it will persist across reboots and you should not have to do this again.
Mounting the LUN
This is where things diverge for different Linux distributions.