•  Home
  •  Dashboard
  •  Company
    • About Us
    • Blog
    • Careers
    • Contact Us
    • Data Centers
    • Looking Glass
    • Network
    • Reseller
  •  Hosting Services
    • Infrastructure
      • iColocation
    • Compute
      • cMetal
      • cVirtual
    • Storage
      • sObject
      • sBlock
    • Networking
      • nCDN
      • nIP Transit
      • nWavelength
    • Protection
      • pBackup
      • pDDoS
  •  Solutions
    • Ecommerce
    • Finance
    • Gaming
    • Hosting
    • Management
    • Security
    • System Integrator
  •  Support
    • Community
    • Knowledge Base
    • Open A Ticket
  •  USA & Canada: 800-933-1517
  •  International: 626-549-2801
  •  Email: sales@psychz.net
  • Services
    • new-colocation-header-img
      Infrastructure
      • iColocation
    • new-compute-header-img
      Compute
      • cMetal
      • cVirtual
    • new-storage-header-img
      Storage
      • sObject
      • sBlock
    • new-networking-header-img
      Networking
      • nCDN
      • nIP Transit
      • nWavelength
    • new-protection-header-img
      Protection
      • pBackup
      • pDDoS
  • Solutions
    • Ecommerce
    • Security
    • Gaming
    • Hosting
    • Management
    • Finance
    • System Integrator
  • Dashboard

sBlock - iSCSI Linux Guide

  • Home
  • Client
  • Knowledgebase
  • Storage
  • sBlock
  • sBlock - iSCSI Linux Guide

Table Of Content

Related Articles

  • sBlock - Backup on Debian, Ubuntu and Related OS
  • sBlock - Backup on RHEL, CentOS, AlmaLinux & Rocky Linux
  • sBlock - Snapshot Restore
  • sBlock - Snapshots Create
  • sBlock - Snapshots Intro
  • sBlock - iSCSI Windows Guide
  • sBlock - Delete
  • sBlock - Intro
  • sBlock - Create
  • Views: (1121)
  • Votes: (0)
Was this article helpful?
VOTE

sBlock - iSCSI Linux Guide

Publisher: Psychz Networks,  May 09,2024

  • Prerequisites
  • Install Initiator
  • Verify Daemon
  • Discover Target
  • Mount Volume
  • View Volume
  • Format Volume
  • Unmount Volume

This guide will delve into the steps required to connect to and utilize an iSCSI volume from the Linux operating system. iSCSI (Internet Small Computer System Interface) provides access to storage devices over an IP network, allowing for flexible and efficient storage solutions in various computing environments.

Prerequisites

Before proceeding, ensure you have the following details readily available, as they were provided during the creation of the Block Storage:

Dummy data for representation purpose only.

- iSCSI Target Address: sblock.iscsi.uswest1.xxxxxx.com
- Initiator IQN: iqn.2024-04.com.xxxxxxxx:mj6rs9x7ok664207ce360c6-testdevice
- Target IQN: iqn.2024-04.com.xxxxxxx:us-west-1.stor.01

- Port: 3260
- CHAP Username: 1234567d258c84
- CHAP Password: xxxxxxxxxxxxx
- Mutual CHAP Username: THIS_is_DUMMY_UNAME
- Mutual CHAP Password: xxxxxxxxxxxxxxx

Install the iSCSI Initiator Utilities

Log in to your Linux host system and install the necessary iSCSI initiator utility package on your Linux system. This package is vital for establishing connections to iSCSI volumes.

For Ubuntu/Debian

# apt update
# apt install open-iscsi

After installation, start the iSCSI service and enable it to start automatically on system boot.

# systemctl start iscsid
# systemctl enable iscsid

For RHEL 7/8/CentOS

# yum install iscsi-initiator-utils

After installation, start the iscsid service and enable it to start automatically on system boot.

# systemctl start iscsid
# systemctl enable iscsid

Verify iSCSI Daemon Status

Check if the iSCSI daemon is running on your system using the appropriate command based on your Linux distribution.

For Ubuntu/Debian

# iscsiadm --mode session

For CentOS/RHEL 7/8

# systemctl status iscsi.service

Discover the iSCSI Target

Use the `iscsiadm` command to discover the iSCSI volume on your network.

# iscsiadm -m discovery -t st -p <IP address>:3260

- Replace <IP address> with the Target address of the block gateway provided during creation.

Mount the iSCSI Volume

Initiate the connection to the iSCSI volume using the target address and IP address. This needs to be done in the following steps

Step 1: Update Initiator Name

Before you mount the volume, you need to update the Initiator Name with the one provided by us at the time of sBlock creation. To edit the information, please use the following command

# nano /etc/iscsi/initiatorname.iscsi​

Now, replace the entire string after "InitiatorName=" with the Initiator IQN.

Sample output

## DO NOT EDIT OR REMOVE THIS FILE!
## If you remove this file, the iSCSI daemon will not start.
## If you change the InitiatorName, existing access control lists
## may reject this initiator. The InitiatorName must be unique
## for each iSCSI initiator. Do NOT duplicate iSCSI InitiatorNames.

InitiatorName=iqn.2024-04.com.xxxxxxxx:mj6rs9x7ok664207ce360c6-testdevice

Step 2: Set the authentication method to CHAP

# iscsiadm -m node -T <target address> -p <IP address>:3260 --op update -n node.session.auth.authmethod -v CHAP

- Replace `<target address>` with Target IQN and `<IP address>` with iSCSI Target Adress. This information is shared during the setup.

Step 3: Set the username for CHAP authentication

# iscsiadm -m node -T <target address> -p <IP address>:3260 --op update -n node.session.auth.username -v <username>

Step 4: Set the password for CHAP authentication:

# iscsiadm -m node -T <target address> -p <IP address>:3260 --op update -n node.session.auth.password -v <password>

Step 5: Login to the iSCSI target

# iscsiadm -m node -T <target address> -p <IP address>:3260 --login

Note: iSCSI volumes cannot be mounted simultaneously across multiple Linux clients due to protocol limitations.

View the iSCSI Volume

Confirm the successful connection and view the iSCSI volume on your system.

# fdisk -l
# lsblk

You should see the mounted iSCSI volume listed as an available raw disk, enabling read and write operations from your host.

Format the iSCSI Volume

Now, format the volume with a file system. Common file systems include ext4 (for Linux environments).

# mkfs.ext4 /dev/sdb

Sample Output

mke2fs 1.46.5 (30-Dec-2021)
Discarding device blocks: done
Creating filesystem with 3932160 4k blocks and 983040 inodes
Filesystem UUID: f1660e31-5338-4c97-bb0e-772a539c8aa8
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208

Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done

Unmount the iSCSI Volume

When done with the volume, unmount it using the following command:

# iscsiadm -m node -T <target name> -p <IP address>:3260 -u

- Replace `<target name>` and `<IP address>` with the appropriate details for the volume.

By following these steps, you can effectively connect to and utilize iSCSI volumes within your Linux environment, enhancing storage capabilities for your computing needs.

Related Articles

  • sBlock - Backup on Debian, Ubuntu and Related OS
  • sBlock - Backup on RHEL, CentOS, AlmaLinux & Rocky Linux
  • sBlock - Snapshot Restore
  • sBlock - Snapshots Create
  • sBlock - Snapshots Intro
  • sBlock - iSCSI Windows Guide
  • sBlock - Delete
  • sBlock - Intro
  • sBlock - Create
  • Views: (1121)
  • Votes: (0)
Was this article helpful?
VOTE
Copyright © 2025 Psychz Networks,
A Profuse Solutions Inc Company
Hosting Services
Infrastructure
  • iColocation
Compute
  • cMetal
  • cVirtual
Storage
  • sObject
  • sBlock
Networking
  • nCDN
  • nIP Transit
  • nWavelength
Protection
  • pBackup
  • pDDoS
Company
  • About Us
  • Blog
  • Careers
  • Contact Us
  • Data Centers
  • Looking Glass
  • Network
  • Reseller
Policies
  • Acceptable Usage Policy
  • Privacy Policy
  • Service Level Agreement
  • Terms and Conditions
Support
  • Community
  • Knowledge Base
  • Open A Ticket
Get In Touch
  • Psychz Networks,
    A Profuse Solutions Company
    611 Wilshire Blvd #300
    Los Angeles,California 90017
    USA
  • US/Canada: 800-933-1517
  • International: 626-549-2801