I see OpenWRT and iSCSI and OpenSAN mentioned. I'd like to do this to one of my external drives so I don't have to listen to the noise at my computer. Also one of my programs refuses to use net shares for storage, only connected drives.
Does anyone have any documentation on how to do this with LEDE? If it's a basic Linux thing, forgive me, I'm a Windows guy. I see the GitHub page for OpenSAN and other than building it and tftp'ing it to the router for install, is there a better way, or package, or directions...?
May someone with more experience with this correct me if I'm wrong, but I do not think OpenWRT has any of the kernel modules or packages required to make an OpenWRT device an iSCSI target (aka the machine holding the disks).
Keep in mind that iSCSI is SUPER SENSITIVE to latency. A timeout of as much as a few miliseconds will cause a Windows client box to just lock up and just stop working. So do not expect to be able to use it with anything other than wired network, preferably fiber.
In theory it should be possible if you copy those bits over.
The main reason is I have a NAS with iSCSI holding my backups and recently got a new security camera that does not have self recording ability so I have to run a program on my little server box in my living room. The stupid program won't let you record to network shares as I have a dedicated video drive shared by the NAS. It would be so convenient if I could plug it into the router next to it and attach it via iSCSI.
Are there any alternative protocols that accomplish a network link to a computer and have it think it's a local drive?
Porting a software package designed for x86 to embedded is far from trivial.
It would be easier by far to connect a router to the camera, and capture video / images using Linux, which can save to a network share or whatever. That being said, it might depend on the brand of the camera, if there is a video capture driver. Check this for more info: https://openwrt.org/docs/guide-user/hardware/video/usb.video
At least in this case though, you would be doing things the conventional way, as self-recording cameras really are just cameras with embedded Linux computers attached to them.
You mean on Windows? Ask on a Windows forum.
Although perhaps you could save to C: and have a script to copy the recordings to a NAS.
tgt is a userspace program, so no need for injecting. The kernel modules supposedly part of the kernel for a long time now.
I'm uncertain why the package isn't available for download anywhere, it's possible it's just one of those things so few people need, that you have to build it yourself. I'm going to give it a shot and let you know.
EDIT: It can be done but you need to compile your own kernel with the KERNEL_AIO option enabled (for the option to select "tgt" to even show up in menuconfig). See here: https://wiki.openwrt.org/doc/howto/build
And get up to speed with compiling OpenWRT from source. You will need a 64-bit system running Linux. In Menuconfig, select KERNEL_AIO and then the "tgt" package under Network. Also select other packages you intend to use, as public package repositories cannot be used with a custom kernel. Make and enjoy.
All OpenWRT code is cross-compiled because you are not running the same architecture on the PC as on the router. Also no need to throw around buzzwords, just follow the instructions on the page, follow them and you are the most likely to end up with a non-bricked device.
I found an interesting package while digging just now called "USBIP" which shares a USB device over the network and it has a Windows client. This might be simpler to implement so I'll take a look when I get home tonight.
Honestly this is a pretty amazing project if it works. It could be used for any USB device!
I got tgt to show up. I didn't know what AIO meant and was looking for a package. You have to add the "Compile the kernel with asynchronous IO support" under "global build options" > "kernel build options". Then tgt will show up under network.
Building now... Didn't expect it to take so long to build. Still going after 2 hours lol.
After much struggle and many hours of failed builds I finally have a working firmware. It seems the usbip package has an issue and there was an unknown issue possibly another bad package there as well. But I can confirm the tgt package is responding to commands. Going to have to figure out how to set this up but I'm happy for now. Just bought a new router, a Turris Omnia so I'll probably be at square one if it's not included in their package by default LOL!