SYS: Configure an iSCSI target.

Share this link

To create an iSCSI target, you need to follow several steps on a dedicated server.

Install the following package:

# yum install -y scsi-target-utils

Activate the tgtd service at boot:

# chkconfig tgtd on

Start the tgtd service:

# service tgtd start

Create a dedicated directory:

# mkdir -p /var/lib/tgtd/kvmguests

Create a specific file (here 512MB):

# dd if=/dev/zero of=/var/lib/tgtd/kvmguests/shareddata.img bs=1M count=512

Set up SELinux configuration:

# restorecon -R /var/lib/tgtd

Edit the /etc/tgt/targets.conf file and add the following lines at the end:

<target iqn.2008-09.com.example:iscsi.kvmguests>
backing-store /var/lib/tgtd/kvmguests/shareddata.img
</target>

Update the configuration:

# tgt-admin --execute

Check the configuration:

# tgt-admin --show

Add a new rule to the firewall:

# iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 3260 -j ACCEPT

Save the firewall configuration:

# service iptables save

Source: https://www.berrange.com/tags/tgtadm/

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

Leave a Reply

Be the First to Comment!

Notify of

RHCSA7: Task of the day

Allowed time: 5 minutes.
Create two users "tom" and "engine". "tom" has the UID/GID 3000 and "engine" the UID/GID 4000. "engine" doesn't have an interactive shell.

RHCE7: Task of the day

Allowed time: 5 minutes.
Set up time synchronization with default configuration.

Follow me on Twitter

Poll for favorite RHEL 7 book

What is your favorite RHEL 7 book to prepare RHCSA & RHCE exams?

View Results

Loading ... Loading ...

Poll for most difficult RHCSA 7 topic

What do you think is the most difficult RHCSA 7 topic?

View Results

Loading ... Loading ...

Poll for most difficult RHCE 7 topic

What do you think is the most difficult RHCE 7 topic?

View Results

Loading ... Loading ...