elastocloud / istgt

Other
9 stars 6 forks source link

How to provide an existing storage file as iSCSI target #2

Open computersalat opened 1 year ago

computersalat commented 1 year ago

Hi,

having 3 disks of 4 (RAID5) of a NAS device that provided an iSCSI LUN as raw disk. The NAS wasn't able to bring up the RAID so I put the 3 disks into my Linux box (openSUSE Leap 15.4) and recovered the raid.

Now on the raid I found that NAS based iSCSI LUN as a file:

root@tyan:0/mnt/md100/data/iSCSI_n7510>l
insgesamt 1944745696
drwx------+  2   99 users          4096  6. Mär 2014  .
drwxr-xr-x  18 root root           4096  6. Mär 2014  ..
-rw----rw-   1 root root  5368709120000  6. Jul 04:52 xsrv
root@tyan:0/mnt/md100/data/iSCSI_n7510>file xsrv 
xsrv: LVM2 PV (Linux Logical Volume Manager), UUID: f8ysiB-33JB-qj1z-SctU-csHr-aTe2-35rRrp, size: 4294967296512

How can I load this file and provide it as an iSCSI Target ? LUN0 Storage is trying to create its own file, so that is not working. LUN0 Device is also not working as file is not a device.

Any help is really appreciated. Thank you.

ddiss commented 1 year ago

Hi,

So just to confirm, the xsrv file was previously created by your NAS device, and you're now trying to reuse that file as a backing for an iSCSI target on openSUSE Leap 15.4 ?

For iSCSI, I recommend that you use the in-kernel SCSI target (LIO) instead of istgt. You can configure LIO using the python3-targetcli-fb package.