Creating a loopback device in lio scsi target

1.6k views Asked by At

I am using the Linux LIO package to create a loopback device for a backstore. I am using "targetcli" utility to issue the following commands mentioned at site - http://linux-iscsi.org/wiki/Loopback :

/backstores/fileio> create  dev_file_disk file_disk 10mb
/loopback> create
Created target naa.5001405f29525ad4.

However, I see the fileio backstore created in "deactivated" state:

| o- fileio .......................... [Storage Objects: 1]
| | o- dev_file_disk ................. [file_disk (10.0MiB)
                                        write-back deactivated]

How can I activate the fileio backstore (dev_file_disk)? My understanding, if all is setup right (fileio backstore is active), a new entry /dev/sdx will be created. Is that right?

I have a related question. If I create multiple fileio and/or block backstore. Is there a way I can control which of the fileio/blockio are created as loopback, rather than all of them.

Thank you, Ahmed.

1

There are 1 answers

1
Ahmed A On

I figured it out. I had to go into the loopback target / lun ("cd naa.500140582a838aa2/luns/") and then manually issue a "create" command for each backstore for which I wanted to created a loopback device. It would be nice/helpful if this critical step was mentioned in the wiki.