Tape device temporarily unavailable

Hi All,

After (by accident) closing a session that ran a restore command I can not access the tape drive anymore.

I get the following error:

# tctl -f /dev/rmt0 rewind
/dev/rmt0: Resource temporarily unavailable

But I cannot find any processes associated with the tape device:

# ps -ef | egrep "restore|rmt"
    root 4595872 4321502   0 09:59:54 pts/71  0:00 egrep restore|rmt
# fuser /dev/rmt0
/dev/rmt0:

Although AIX says that the device is available:

# lsdev -Cc tape
rmt0 Available 06-08-01-0,0 LVD SCSI 4mm Tape Drive

I cannot remove the device and then add it:

# rmdev -dl rmt0
Method error (/etc/methods/ucfgdevice):
        0514-062 Cannot perform the requested function because the
                 specified device is busy.

Still I can access the attributes of the device:

# lsattr -El rmt0
block_size    1024  BLOCK size (0=variable length)       True
compress      yes   Use data COMPRESSION                 True
density_set_1 71    DENSITY setting #1                   True
density_set_2 38    DENSITY setting #2                   True
extfm         yes   Use EXTENDED file marks              True
mode          yes   Use DEVICE BUFFERS during writes     True
ret           no    RETENSION on tape change or reset    True
ret_error     no    RETURN error on tape change or reset True
size_in_mb    36000 Size in Megabytes                    False

Which procedure should I follow to get access to the tape device again?

There is a reset option for tctl you could try:

       reset
            Sends a bus device reset (BDR) to the tape device. The BDR will only be sent if the device cannot be opened and
            is not busy.

Even though you wrote it is busy, I'd try it.

If it doesn't help, can you turn it's power off and on or do a "reset" at it's panel?

zaxxons suggestion is sound and i'd go for it. If it still doesn't help you could try to identify the process holding the device (maybe there is one, not named "restore" or "rmt"?) by using the "fuser" command (or "strace").

I hope this helps.

bakunin