Skip to content

Setting Up iSCSI on Synology DS1621+ and Mounting on Ubuntu 22.04

On the Synology DS1621+

1. Enable iSCSI Target Service

  1. Log in to DSM.

  2. Navigate to SAN Manager > iSCSI.

  3. Enable iSCSI Target Service.

2. Create an iSCSI Target

  1. Go to SAN Manager > iSCSI Targets > Create.

  2. Enter a name for the target (e.g., ubuntu_remote).

  3. Configure CHAP authentication if desired (optional).

  4. Save the target.

3. Create an iSCSI LUN

  1. Go to SAN Manager > iSCSI LUN > Create.

  2. Select Advanced LUN (File Level).

  3. Specify /volume1/docker_remote/ as the directory for the LUN file.

  4. Set the desired size (e.g., 100GB or more).

  5. Map the LUN to the previously created iSCSI Target.

  6. Save the configuration.

4. Note the Target IQN

  1. Navigate to iSCSI Targets.

  2. Record the IQN for later use.


On the Ubuntu 22.04 Server

1. Install iSCSI Initiator

Install the necessary package to interact with iSCSI targets.

sudo apt update

sudo apt install open-iscsi

2. Discover iSCSI Targets

Discover available iSCSI targets on the Synology NAS. Replace <Synology_IP> with the IP address of your Synology.

sudo iscsiadm -m discovery -t sendtargets -p <Synology_IP>

3. Log In to the Target

Log in to the iSCSI target using the IQN and IP of the Synology NAS.

sudo iscsiadm -m node --targetname <Target_IQN> --portal <Synology_IP> --login

4. Verify iSCSI Session

Ensure the iSCSI session is active.

sudo iscsiadm -m session

Partition, Format, and Mount the iSCSI Disk

1. Identify the Disk

List all disks to identify the iSCSI disk (likely /dev/sdb).

sudo fdisk -l

2. Partition the Disk

Run fdisk to create a new partition:

sudo fdisk /dev/sdb

At the fdisk prompt:

  • Press n to create a new partition.

  • Accept the defaults for partition type, start, and end sectors.

  • Press w to write changes and exit.

3. Format the Partition

Format the partition with the ext4 filesystem.

sudo mkfs.ext4 /dev/sdb1

4. Create the Mount Point

Create the directory where the iSCSI disk will be mounted.

sudo mkdir -p /docker/ubuntu_remote/

5. Mount the Partition

Mount the partition to the directory.

sudo mount /dev/sdb1 /docker/ubuntu_remote/

6. Verify the Mount

Check if the disk is successfully mounted.

df -h

Make the Mount Persistent

1. Add to /etc/fstab

Open /etc/fstab for editing:

sudo vi /etc/fstab

Add the following line to the end of the file:

/dev/sdb1 /docker/ubuntu_remote/ ext4 defaults,_netdev 0 0

2. Reload systemd and Test

Reload systemd and remount all filesystems:

sudo systemctl daemon-reload

sudo mount -a

iSCSI Disk Setup Complete

Your iSCSI disk should now be mounted and ready for use at /docker/ubuntu_remote/.