# access to remote removable USB drive



## danbi (Jan 24, 2012)

I am trying to set up environment where an USB flash drive plugged in one FreeBSD machine will be accessible in another machine. Low maintenance solution is better (not having to execute scripts on both).

My initial idea was to use istgt on the machine where the USB drives plug and the bundled iscsi initiator on the other. But I cannot figure out how to define on-demand device handling with istgt -- it will refuse to start if a device described in its configuration does not exist.

Is there a solution? Perhaps better documentation of what exactly istgt does?

Failing such dynamic support built in istgt I am considering running a script off devd notifications, when new device node is created on one of the machines, it would rewrite the istgt configuration file and restart the daemon, but it doesn't seem suited for that either. Might work in one daemon per device setup though.

What really would solve my problem is a "remote cam" implementation..


----------



## kpa (Jan 24, 2012)

There is "remote GEOM", haven't really looked into myself but it looks suitable for your situation:

ggated(8)


----------



## danbi (Jan 25, 2012)

For some reason, ggate does not work for me.

First, on the server side it randomly reports that the USB drive disconnects and indeed the kernel seems to disconnect/reconnect the drive for some reason. This has never happened with istgt and the same drive.
Then, when this happens there is no more connection to the remote end until it is manually re-established (daemon restarted, ggatec reconnected). This makes the whole setup very inappropriate for removable devices.

Perhaps about the only way is to work with wrappers around istgt but there I have another problem: how does one restart the iscontrol process?


----------

