Setting Up iSCSI on Synology DS1621+ and Mounting on Ubuntu 22.04
On the Synology DS1621+
1. Enable iSCSI Target Service
-
Log in to DSM.
-
Navigate to SAN Manager > iSCSI.
-
Enable iSCSI Target Service.
2. Create an iSCSI Target
-
Go to SAN Manager > iSCSI Targets > Create.
-
Enter a name for the target (e.g.,
ubuntu_remote
). -
Configure CHAP authentication if desired (optional).
-
Save the target.
3. Create an iSCSI LUN
-
Go to SAN Manager > iSCSI LUN > Create.
-
Select Advanced LUN (File Level).
-
Specify
/volume1/docker_remote/
as the directory for the LUN file. -
Set the desired size (e.g., 100GB or more).
-
Map the LUN to the previously created iSCSI Target.
-
Save the configuration.
4. Note the Target IQN
-
Navigate to iSCSI Targets.
-
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.
2. Discover iSCSI Targets
Discover available iSCSI targets on the Synology NAS. Replace <Synology_IP>
with the IP address of your Synology.
3. Log In to the Target
Log in to the iSCSI target using the IQN and IP of the Synology NAS.
4. Verify iSCSI Session
Ensure the iSCSI session is active.
Partition, Format, and Mount the iSCSI Disk
1. Identify the Disk
List all disks to identify the iSCSI disk (likely /dev/sdb
).
2. Partition the Disk
Run fdisk
to create a new partition:
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.
4. Create the Mount Point
Create the directory where the iSCSI disk will be mounted.
5. Mount the Partition
Mount the partition to the directory.
6. Verify the Mount
Check if the disk is successfully mounted.
Make the Mount Persistent
1. Add to /etc/fstab
Open /etc/fstab
for editing:
Add the following line to the end of the file:
2. Reload systemd
and Test
Reload systemd
and remount all filesystems:
iSCSI Disk Setup Complete
Your iSCSI disk should now be mounted and ready for use at /docker/ubuntu_remote/
.