Drobo command line in MacOS 10.5

328 views
Skip to first unread message

mikeh

unread,
Apr 21, 2009, 6:41:32 AM4/21/09
to drobo-talk
I realize that the great work done in drobo-utils has been designed
for linux and accept what i`m asking may not be possible.

I have a pair of headless mac-mini`s attached to drobo`s as cheap
quiet servers in remote sites.
As the official drobo app is a graphical utility my only option seemed
to be ARD or VNC, both of which have been temperamental in the past
due to nasty ADSL lines/routers. I use ssh to get onto these boxes.

I`ve tried downloading the source of drobo-utils with the intention of
getting the cmd line side working so that i can interrogate and script
reports from these 2 servers.

When i attempt to run drobom from the source python script i get the
following which doesn`t look like it`s a response from the script,
rather the drobo replying an incompatibility. ie. it gets past the
point of identifying at least 1 LUN.

Apollo:drobo-utils-0_5_0 mike$ ./drobom status
Traceback (most recent call last):
File "./drobom", line 202, in <module>
l=Drobo.DiscoverLUNs(debug)
File "/Users/mike/build/drobo-utils-0_5_0/Drobo.py", line 1269, in
DiscoverLUNs
for potential in DroboIOctl.drobolunlist(DEBUG):
File "/Users/mike/build/drobo-utils-0_5_0/DroboIOctl.py", line 310,
in drobolunlist
pdio.closefd()
File "/Users/mike/build/drobo-utils-0_5_0/DroboIOctl.py", line 100,
in closefd
self.sg_fd.close()
IOError: [Errno 19] Operation not supported by device

I`d add the firmware i`m running except that i`ll need to talk someone
through ARD locally to take a look. But in the meantime has anyone
seen this before? A search of the forum seemed to indicate no.

Thanks in advance for any advice you can offer.

Cheers
Michael.

philobyte

unread,
Apr 21, 2009, 7:11:42 AM4/21/09
to drobo-talk

Do not have a Mac, but a mac port would be very cool!
The GUI layer is entirely portable to Mac, as is python. So the only
thing left is how we talk to the Drobo itself. Drobo-utils uses the
linux generic SCSI layer to talk to locally attached (USB or firewire)
Drobos. It sends specific SCSI commands defined by Data Robotics
through a kind of virtual SCSI layer (using ioctl SG_IO system call,
provided by Linux) which handles the communications over both firewire
and USB. If anyone knows about scsi command blocks over arbitrary
buses on Macs, help would be appreciated.

mikeh

unread,
Apr 21, 2009, 9:02:20 AM4/21/09
to drobo-talk
Aah, this is probably where the problem lies.

I incorrectly assumed it was python script directly connecting to the
drobo and not calling a linux native lib.

I`ll look into this further.

Peter Silva

unread,
Apr 21, 2009, 6:27:59 PM4/21/09
to drobo...@googlegroups.com
there's no library, ioctl is a system call (API serviced directly by the kernel)
MacOS uses Darwin (BSD-like) kernel)

similar to this question:
http://lists.apple.com/archives/darwin-drivers/2009/Jan/msg00012.html

and this:
http://newsgroups.derkeiler.com/Archive/Comp/comp.sys.next.sysadmin/2005-11/msg00013.html

the breadcrumbs would start here....
http://developer.apple.com/DOCUMENTATION/DeviceDrivers/Conceptual/WorkingWithSAM/WWS_SAMDevInt/WWS_SAM_DevInt.html

Which seems to say that Apple wants you to write an in-kernel driver to do what Linux let's you do with an application running some ordinary system calls.   Maybe I'm wrong, need a darwin/machead expert to validate.

philobyte

unread,
Apr 22, 2009, 6:47:05 PM4/22/09
to drobo-talk

Buzz Lightyear

unread,
May 29, 2009, 5:01:51 PM5/29/09
to drobo-talk
Except with the Mac you wouldn't have to write the driver. If all you
want is the command line, installing the Dashboard will give you the
driver already built. It's already there as /Library/System/
Extensions/TrustedDataSCSIDriver.kext. This one links to the also
already existing Apple driver.

I don't know Python so don't know where the Python to device bridge
comes in (where the call to ioctl would have to be re-worked to port
this to the Mac). The gain for me would be in having command line
tools that I can call from scripts to control behavior of Drobo.

If no one else does it I might look at it as a "learning experience".
Not sure when though.


On Apr 22, 12:27 am, Peter Silva <informa...@gmail.com> wrote:
> there's no library, ioctl is a system call (API serviced directly by the
> kernel)
> MacOS uses Darwin (BSD-like) kernel)
>
> similar to this question:http://lists.apple.com/archives/darwin-drivers/2009/Jan/msg00012.html
>
> and this:http://newsgroups.derkeiler.com/Archive/Comp/comp.sys.next.sysadmin/2...
>
> the breadcrumbs would start here....http://developer.apple.com/DOCUMENTATION/DeviceDrivers/Conceptual/Wor...
>
> Which seems to say that Apple wants you to write an in-kernel driver to do
> what Linux let's you do with an application running some ordinary system
> calls. Maybe I'm wrong, need a darwin/machead expert to validate.
>

Peter Silva

unread,
May 29, 2009, 8:10:07 PM5/29/09
to drobo...@googlegroups.com
OK, there is likely a relevant code sample here:

http://developer.apple.com/samplecode/SimpleUserClient/index.html#//apple_ref/doc/uid/DTS10000450

my guess is that you want to build the simple user client as a first step.
At the same time, ask DRI, pretty please, if they can produce the file:

TrustedDataSCSIDriver.h

for you to use in your modified version of SimpleClient, and thus interrogate the Drobo. 

Step 3... hopefully, the.h file reveals to you how to send SCSI command blocks.   Build one (say to blink the lights.) by hand...

Step 4... Learn python ctypes, which allows python to access any C function.

Step 5.. create a mac version of DroboIOctl.py ... I dunno.. DroboMacIO.py
             that uses ctypes to access TrustedDataSCSIDriver...

Buzz Lightyear

unread,
May 31, 2009, 12:01:31 PM5/31/09
to drobo-talk
Peter,

Thanks for the tips! I'll see what I can turn up.

On May 30, 2:10 am, Peter Silva <informa...@gmail.com> wrote:
> OK, there is likely a relevant code sample here:
>
> http://developer.apple.com/samplecode/SimpleUserClient/index.html#//a...
>
> my guess is that you want to build the simple user client as a first step.
> At the same time, ask DRI, pretty please, if they can produce the file:
>
> TrustedDataSCSIDriver.h
>
> for you to use in your modified version of SimpleClient, and thus
> interrogate the Drobo.
>
> Step 3... hopefully, the.h file reveals to you how to send SCSI command
> blocks.   Build one (say to blink the lights.) by hand...
>
> Step 4... Learn python ctypes, which allows python to access any C function.
>
> Step 5.. create a mac version of DroboIOctl.py ... I dunno.. DroboMacIO.py
>              that uses ctypes to access TrustedDataSCSIDriver...
>
Reply all
Reply to author
Forward
0 new messages