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
wpDiscuz

RHCSA7: Task of the day

Allowed time: 5 minutes.
Create a new user account called "bob" with password "redhat" and set expiration in one week.

RHCE7: Task of the day

Allowed time: 10 minutes.
Set up a default secure MariaDB database called maria and create a table named people with two columns respectively name varchar(20) and age int(10) unsigned.

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 ...

Recent Comments