Connect RBS to a server

This article explains how to connect a Remote Block Storage (RBS) volume to a Linux or Windows server over Internet Small Computer Systems Interface (iSCSI).

Before you begin

Before connecting an RBS volume to a server:

  • Create an RBS volume, see Getting started.
  • Make sure the server can access the RBS volume over the Global Private Network (GPN).

Linux

Note: run all commands as root (or with sudo).

Install the iSCSI package (if not done already)

Debian-based systems (Ubuntu, Debian)

apt install open-iscsi

The target configuration path is: /etc/iscsi/nodes

Red Hat-based systems (Rocky Linux, AlmaLinux, CentOS)

yum install iscsi-initiator-utils

or

dnf install iscsi-initiator-utils

The target configuration path is: /var/lib/iscsi/nodes

Register the target volume

Take the target name and the volume IP address from the volume details page: Customer Portal → Remote Block Storage → Your volume. You will need two fields:

  • Target name - the iSCSI Qualified Name (IQN) that uniquely identifies the volume, for example: iqn.2024-10.com.servers:59809d6c-6ec7-4220-b334-9c93ed8f52b4
  • IP address - the iSCSI volume IP address

Create a node record for the target:

iscsiadm -m node --targetname <TARGET_NAME> -p <VOLUME_IP>:3260 -o new

Replace <TARGET_NAME> and <VOLUME_IP> with the values from the Target name and IP address fields on the volume details page.

Configure authentication

Configure Challenge-Handshake Authentication Protocol (CHAP) authentication by setting a username and password:

iscsiadm -m node --targetname <TARGET_NAME> -p <VOLUME_IP>:3260 -o update -n node.session.auth.username -v <USERNAME>
iscsiadm -m node --targetname <TARGET_NAME> -p <VOLUME_IP>:3260 -o update -n node.session.auth.password -v <PASSWORD>

Replace <USERNAME> and <PASSWORD> with the credentials from Remote Block Storage → Your volume → Credentials → Show.

Enable auto-start for this connection (optional):

iscsiadm -m node --targetname <TARGET_NAME> -p <VOLUME_IP>:3260 -o update -n node.startup -v automatic

Configure queue depth

By default, the Linux iSCSI initiator exposes a low queue depth on the Small Computer System Interface (SCSI) device, which can limit performance for volumes with high input/output operations per second (IOPS) limits.

To increase the queue depth, update the node session parameters before you log in:

iscsiadm -m node --targetname <TARGET_NAME> -p <VOLUME_IP>:3260 -o update -n node.session.cmds_max -v 256
iscsiadm -m node --targetname <TARGET_NAME> -p <VOLUME_IP>:3260 -o update -n node.session.queue_depth -v 128

node.session.cmds_max must be a power of two and must be at least twice the target node.session.queue_depth. For example, to set a queue depth of 128 on the SCSI device, set cmds_max to 256.

If the session is already active, log out and log back in for the changes to take effect.

Log in to the target volume

iscsiadm -m node --targetname <TARGET_NAME> -p <VOLUME_IP>:3260 --login

After completing the login, a new block storage device will appear in the /dev directory, typically named in the sdX format (e.g., sdc). To identify <DEVICE_NAME>, use the lsblk command.

Prepare the storage device

What you do next depends on whether the volume already contains data.

New volume

Creating a file system erases all data on the device. Run mkfs only on a new, empty volume.

Create a file system (ext4 in this example) and mount it to a local directory such as /mnt/iscsi:

mkfs.ext4 -E lazy_itable_init=1 -E lazy_journal_init=1 /dev/<DEVICE_NAME>
mkdir /mnt/iscsi
mount /dev/<DEVICE_NAME> /mnt/iscsi

Existing volume with a file system

Do not format the volume. Mount it:

mkdir /mnt/iscsi
mount /dev/<DEVICE_NAME> /mnt/iscsi

Replace <DEVICE_NAME> with the actual device name from the previous step.

Set up auto-mounting after reboot (optional)

  1. Get the universally unique identifier (UUID) of the file system:
lsblk -f
  1. Set up automatic mounting:
echo "UUID=<UUID> /mnt/iscsi ext4 _netdev 0 0" | tee --append /etc/fstab

<UUID> is the UUID of the file system from the previous command.

If you change the file system type, replace ext4 in the line above with the actual type.

Verify the volume

  1. Navigate to the mount point: cd /mnt/iscsi

  2. Create a test file: echo "Remote Block Storage test" > /mnt/iscsi/test.txt

  3. Verify the created file and its content: cat /mnt/iscsi/test.txt

How to disconnect the volume

To safely disconnect and avoid data loss:

Identify mount points: lsblk

Example output:

NAME                     MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
sdc                        8:32   0    10G  0 disk  /mnt/storage
                                                        /mnth

Unmount all mount points

sudo umount /mnt/storage
sudo umount /mnth

If the device is busy, check which processes are using it:

lsof /mnt/storage

End those processes or wait for any write operations to complete, then try unmounting again.

Disconnect from the iSCSI target

  • Check the current iSCSI session: iscsiadm -m session
  • Log out from the target: sudo iscsiadm -m node --targetname <TARGET_NAME> -p <VOLUME_IP>:3260 --logout
  • Remove the target record (optional): iscsiadm -m node --targetname <TARGET_NAME> -p <VOLUME_IP>:3260 -o delete

Windows

Run all PowerShell commands in an elevated session.

Configure the iSCSI service

  1. Set the Microsoft iSCSI Initiator Service to start automatically and start it:
Set-Service -Name MSiSCSI -StartupType Automatic
Start-Service -Name MSiSCSI
  1. Add the target portal, binding it to your Global Private Network interface:
New-IscsiTargetPortal -TargetPortalAddress <VOLUME_IP> -InitiatorPortalAddress <GPN_INTERFACE_IP>

<VOLUME_IP> is the volume's IP address from the volume details page: Customer Portal → Remote Block Storage → Your volume → IP address. <GPN_INTERFACE_IP> is a Global Private Network IP address assigned to an interface of your server, found on your server's detail page (Private IP).

  1. Confirm the target was discovered and note its NodeAddress (the target IQN), which you need in Step 2: Get-IscsiTarget

Connect to the volume

Connect to the target with CHAP authentication, binding it to your Global Private Network interface and keeping the connection persistent across reboots.

Connect-IscsiTarget -NodeAddress <TARGET_NAME> -TargetPortalAddress <VOLUME_IP> -InitiatorPortalAddress <GPN_INTERFACE_IP> -AuthenticationType ONEWAYCHAP -ChapUsername <USERNAME> -ChapSecret <PASSWORD> -IsPersistent $true

Replace <TARGET_NAME> with the target IQN (the NodeAddress returned by Get-IscsiTarget, or the Target name field on the volume details page). Find <USERNAME> and <PASSWORD> on the volume details page: Remote Block Storage → Your volume → Credentials → Show.

Initialize the disk

$RBSDisk = Get-Disk | Where-Object PartitionStyle -eq 'RAW'
$RBSDisk | Set-Disk -IsOffline:$false
$RBSDisk | Initialize-Disk -PartitionStyle GPT -PassThru | New-Partition -AssignDriveLetter -UseMaximumSize | Format-Volume -FileSystem NTFS -Confirm:$false

Verify the volume

  1. Confirm the volume is available and note its drive letter: Get-Volume

  2. Write a test file to the volume and read it back (replace <DRIVE_LETTER> with the letter assigned to the volume, for example D):

Set-Content -Path <DRIVE_LETTER>:\test.txt -Value "Remote Block Storage test"
Get-Content -Path <DRIVE_LETTER>:\test.txt

Get-Content returns Remote Block Storage test, confirming the volume is writable and readable.

How to disconnect the volume

To disconnect a volume from a Windows server, follow the steps below.

Take the volume offline in Disk Management

  1. Open Disk Management (search for diskmgmt.msc in the Start menu)
  2. Locate the disk associated with the iSCSI volume
  3. Right-click on the volume or partition → select Change Drive Letter and Paths...
  4. If a drive letter is assigned, remove it
  5. In the left-hand panel (e.g., Disk 2), right-click the disk → choose Offline

Disconnect from the iSCSI target in iSCSI Initiator

  1. Open iSCSI Initiator (search for iscsicpl in the Start menu)
  2. In the Targets tab, locate the target with Status: Connected
  3. Select it and click Disconnect
  4. Confirm the action when prompted

Remove the target from the configuration (optional)

  1. Navigate to the Favorite Targets tab in iSCSI Initiator
  2. Select the disconnected target and click Remove

This prevents Windows from automatically reconnecting to the target on startup.

Next steps

To increase the volume size or reset the password, see Volume management.

On this page