Unable to create target drives in non-root directory in CentOS 6.5

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SCSI]     [Linux RAID]     [Linux Clusters]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]

  Powered by Linux