This topic describes how to connect to and use the iSCSI volumes of a Cloud Storage
Gateway (CSG) agent on a Linux Elastic Compute Service (ECS) instance.
Connect to the iSCSI volume
- Log on to the ECS console.
Note If your on-premises server is connected to a virtual private cloud (VPC) over an Express
Connect circuit, you can also perform the following steps on your server.
- Connect to your Linux ECS instance. For more information, see Connect to an instance.
- Run the following command to install the iscsi-initiator-utils package:
You need the iscsi-initiator-utils package to connect to the iSCSI volume. If you
have already installed the iscsi-initiator-utils package, skip this step.
sudo yum install iscsi-initiator-utils
- Run the following command to check whether the iSCSI daemon is running.
If the proceeding commands do not return running, run the sudo /etc/init.d/iscsi start
command to start the iSCSI daemon.
- Optional. Configure Challenge-Handshake Authentication Protocol (CHAP) authentication.
Note If you enabled CHAP when you created the iSCSI volume, you must configure CHAP settings
in the Advanced Settings dialog box before you can use the iSCSI volume.
- Run the following command to open the iscsid.conf configuration file:
vi /etc/iscsi/iscsid.conf
- Find CHAP Settings and delete the hash character (#) before the relevant comments, and set the CHAP username and password.
- Enter the CHAP username that you set when you created the iSCSI volume.
- Enter the CHAP password that you set when you created the iSCSI volume.

- Discover the iSCSI volume.
You can query the IPv4 address or IPv6 address of a block gateway in the CSG console.
Navigate to the Volume Information page to query the IPv4 address of a block gateway. In the Service IP column of the gateway list, you can query the IPv6 address of a block gateway.
In the preceding commands, 3260 is the port number, IPv4 address the IPv4 address of a block gateway, and IPv6 address the IPv6 address of a block gateway.
Note
- File gateways version 1.6.0 and later support IPv6.
- You can mount iSCSI volumes over IPv6 only in the China (Hohhot) region. Make sure
that the VPC and vSwitch of the gateway support IPv6.
- If you mount iSCSI volumes over IPv6, make sure that an IPv6 address is configured
for your CSG agent.
- If the VPC and vSwitch of an existing gateway support IPv6, you can obtain an IPv6
mount target after you enable IPv6 for the gateway. By default, gateways created in
this VPC support IPv6.
- Run the following command to mount the iSCSI volume:
target name is the iSCSI volume. You can obtain the volume name in Step 6.
Note Due to the limits of the iSCSI protocol, do not mount one iSCSI volume on multiple
Linux clients.
View the iSCSI volume
- Run the fdisk -l or lsblk command to view the iSCSI volume.
- If the following information appears, the mounted iSCSI volume is an available raw
disk. You can read data from and write data to the iSCSI volume from an on-premises
host.

Unmount the iSCSI volume
To unmount the iSCSI volume, run the following command: