Tandberg RDX: how to find out when media is inserted

I have a Tandberg RDX drive attached to USB. When booting, the device /dev/da0 is created. dmesg says:
Code:
da0 at umass-sim0 bus 0 scbus7 target 0 lun 0
da0: <TANDBERG RDX 0044> Removable Direct Access SCSI-3 device
da0: Serial Number TANDBERGRD6520236564          
da0: 40.000MB/s transfers
da0: Attempt to query device size failed: NOT READY, Medium not present
da0: quirks=0x2<NO_6_BYTE>
That "Medum not present" is always in the log, no matter if or if not a meduim is present. Theres also no output to the log when a medium is inserted. "gpart" list" does not show anything da0, even when a medium is inserted. But I can mount/unmount the medium if its present.

When it was installed two years ago (12.1 I think) I was able to force a media detection by issuing "usbconfig reset". Then "gpart" listed da0, too. Now the box is running 12.2-p8 and I cannot find a way to detect the precence of a media.

For reference: running linux on the very same device on the same machine creates events for media inserted/removed. So the hardware is working.
 
Formating the wrong one is kind of bad :)

For now I settled on replacing "usbconfig reset" with "camcontrol inq da0": it does not generate any log entries, so Im happy.

I also tried "camcontrol reprobe da0", but that creates one disturbing line when no media is inserted:
Code:
g_vfs_done():da0[READ(offset=65536, length=8192)]error = 6

What sill bothers me is why there are no "media inserted" events any more.
 
zwieblum said:
... there are no "media inserted" events any more

Just a guess, because a different device gave me similar problems some time ago. That problem was caused by this part in /etc/devd.conf:

Code:
# Rescan SCSI device-names on attach, but not detach.  However, it is
# disabled by default due to reports of problems.
#
attach 0 {
<------>device-name "$scsi-controller-regex";
//<---->action "camcontrol rescan all";
};

The action was made to a comment here, that's what caused my problem. You might want to take a look at that part too, see man devd and man devd.conf for details.
If it is indeed this action that is missing, the proper solution is to create a device specific entry for your Tandberg in /usr/local/etc/devd. And yes, the proper solution is on my to-do list.
 
Almost :) The "attach" event is generated when the RDX drive is attached. That part works. The "attach" event is not generated, when a media is inserted into the already attached RDX drive - that's my problem.
 
zwieblum said:
The "attach" event is not generated

Instead of a USB/ATTACH event you could have a GEOM/CREATE event, as covacat already pointed out. You could also try to create /usr/local/etc/devd/tandberg.conf with only this:
Code:
# Testing a device using vid:pid only.
notify 200 {
    match "vendor"      "0x0001";
    match "product"     "0x0002";
    action "logger 0-$system 1-$subsystem 2-$type 3-$class 4-$devclass 5-$mode 6-$intclass 7-$intprotocol 8-$intsubclass 9-$function a-$notify";
};

Make sure vendor and product are correct, enter service devd restart and see what output you get when you attach it and when you insert a medium. You may need other variables, see man devd.conf for a list.
 
I have added the devd config, now I wait for monday to see what happes. If does not do anything I'll go for kern.geom.debugflags. Thank you all for the suggestions.
 
Ok. watched this over last weeks, but the devd rule never gets triggered. I have to poll the medium - or better, I have to try to mount it. If it's not present, I get
kernel: g_vfs_done():da0[READ(offset=65536, length=8192)]error = 6
Else the mount succeeds.
 
That sheds some light on the case :) I'm using the devd rule from above - adjusted for my setting. Using your command I get every 5 sec:
!system=CAM subsystem=periph type=error device=da0 serial="TANDBERGRD6520236564 " cam_status="0xcc" scsi_status=2 scsi_sense="70 02 3a 00" CDB="00 00 00 00 00 00 "
Whe I inser a medium I get:
!system=DEVFS subsystem=CDEV type=MEDIACHANGE cdev=da0
!system=GEOM subsystem=DEV type=MEDIACHANGE cdev=da0
!system=CAM subsystem=periph type=error device=da0 serial="TANDBERGRD6520236564 " cam_status="0xcc" scsi_status=2 scsi_sense="70 06 28 00" CDB="00 00 00 00 00 00 "
!system=DEVFS subsystem=CDEV type=CREATE cdev=ufsid/60d199d28e5b4e4d
!system=GEOM subsystem=DEV type=CREATE cdev=ufsid/60d199d28e5b4e4d
and no more lines with "type=error". Now I'm going to try to put tis in a devd rule ... will need to do some reading :)
 
For the record: This is the correct udev rule:
# /usr/local/etc/devd/tandberg.conf (Geändert) Row 6 Col 1
# Testing a device using vid:pid only.
notify 200 {
match "system" "GEOM";
match "subsystem" "DEV";
match "type" "CREATE";
action "/do/the/backup/please";
};
.. and that trick with nc is really neat one :)
 
Good. Eject should give a different set of messages. I'm not sure how the devd rules cascade, but there might be a way to match serial="TANDBERGRD6520236564" followed by system=GEOM subsystem=DEV type=CREATE to avoid accidental triggering by other devices.
 
I have to resurrect this thread: After upgrading from 12.X to 13.2 the RDX-drive does not eject the medium any more. I do:
Code:
# camcontrol eject /dev/da0
Unit stopped successfully, Media ejected
But the medim stays inserted. Does anybody have an idea what to do?
 
Back
Top