From: Michael Grover <michaelgrover@gmail.com>
To: stgt@vger.kernel.org
Subject: Unable to create target drives in non-root directory in CentOS 6.5
Date: Mon, 7 Dec 2015 14:59:29 -0500 [thread overview]
Message-ID: <CAAGs95CfsBMRTMjgH=sg=Z+bZMwr460CHOZ+ArzDQi=4uMb51g@mail.gmail.com> (raw)
I'm trying to create target drive files on CentOS 6.5 using stgt. I am
not able to create the drives on a non-root directory. Here's what I
do:
I create two drive files, one on the root directory and one on a
directory owned by a user called "iscsi_target":
dd if=/dev/zero of=/iscsi_drives/temp
dd if=/dev/zero of=/home/iscsi_target/iscsi_drives/temp
I do a little SELinux management:
semanage fcontext -a -t tgtd_var_lib_t /iscsi_drives/temp
semanage fcontext -a -t tgtd_var_lib_t /home/iscsi_target/iscsi_drives/temp
restorecon -Rv /iscsi_drives/temp
restorecon -Rv /home/iscsi_target/iscsi_drives/temp
Here is what the pertinent lines in my targets.conf file look like:
<target iqn.2015.12.com.mysite:temp_target>
#backing-store /home/iscsi_target/iscsi_drives/temp
backing-store /iscsi_drives/temp
</target>
If I start the tgtd service, I get no errors. However, if I toggle the
comments on the two backing-store lines, switching which drive my
target uses, I get the following error:
Command:
tgtadm -C 0 --lld iscsi --op new --mode logicalunit --tid 1 --lun
1 -b /home/iscsi_target/iscsi_drives/temp
exited with code: 22.
Do you know what might be going on here?
Thanks for any help.
reply other threads:[~2015-12-07 19:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAAGs95CfsBMRTMjgH=sg=Z+bZMwr460CHOZ+ArzDQi=4uMb51g@mail.gmail.com' \
--to=michaelgrover@gmail.com \
--cc=stgt@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).