Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Apr 2006 22:10:46 +0000 (GMT)
From:      fbsd@globalmegahost.com
To:        freebsd-questions@freebsd.org
Subject:   How do I swap tape drives (sa0) without rebooting?
Message-ID:  <Pine.BSF.4.58.0604262107090.15956@soulgamer.com>

next in thread | raw e-mail | index | archive | help
Hello list.

I have a freebsd 6.1-RC1 machine that I am using to test bacula and
various tape drives.  If the machine boots up while the tape drive is
attached and powered up, the tape drive is recognized.  If I turn off the
tape drive and attach a different drive, I cannot seem to convince the OS
that a tape drive is present.  What am I doing wrong?

machine:

- supermicro super server 6013P-8 with zero channel raid controller
- SMP hardware, UP kernel with ASR_COMPAT
- FreeBSD name 6.1-RC FreeBSD 6.1-RC #1: Fri Apr 21 16:09:23 MDT 2006

relevant dmesg data:

asr0: <Adaptec Caching SCSI RAID> mem 0xf8300000-0xf83fffff,0xfb000000-0xfbffffff,0xfc000000-0xfdffffff irq 30 at device 3.0 on pci3
asr0: [GIANT-LOCKED]
asr0: ADAPTEC 2015S FW Rev. 3B0A, 2 channel, 256 CCBs, Protocol I2O

sa0 at asr0 bus 1 target 6 lun 0
sa0: <HP Ultrium 2-SCSI S24D> Removable Sequential Access SCSI-3 device
ses0 at asr0 bus 0 target 6 lun 0
ses0: <SUPER GEM318 0> Fixed Processor SCSI-2 device
ses0: SAF-TE Compliant Device
da0 at asr0 bus 0 target 0 lun 0
da0: <ADAPTEC RAID-5 3B0A> Fixed Direct Access SCSI-2 device
da0: Tagged Queueing Enabled
da0: 70006MB (143372288 512 byte sectors: 255H 63S/T 8924C)

The drive vendor documentation states that the drive's auto-termination
is only in effect when the drive's power is on.  When I power down and
disconnect the drive /var/log/messages receives the following.

Apr 26 13:57:20 name kernel: (sa0:asr0:1:0:0): lost device
Apr 26 13:57:20 name kernel: (sa0:asr0:1:0:0): removing device entry

So I reboot, and try a different disconnect method.

# camcontrol stop sa0
Unit stopped successfully
# camcontrol devlist
<ADAPTEC RAID-5 3B0A>              at scbus0 target 0 lun 0 (da0,pass0)
<SUPER GEM318 0>                   at scbus0 target 6 lun 0 (ses0,pass1)
<HP Ultrium 2-SCSI S24D>           at scbus1 target 6 lun 0 (sa0,pass2)

Then I power off the tape unit and attach a new unit (attach scsi cable,
power cable, then power on the unit).

# camcontrol tur sa0 -E -C 4 -v
error sending test unit ready: Device not configured
(pass2:asr0:1:6:0): TEST UNIT READY. CDB: 0 0 0 0 0 0
(pass2:asr0:1:6:0): CAM Status: CCB request is in progress

/var/log/messages got the following 2 lines as soon as I launched
camcontrol:

Apr 26 15:32:27 name kernel: (sa0:asr0:1:6:0): lost device
Apr 26 15:32:27 name kernel: (sa0:asr0:1:6:0): removing device entry

# camcontrol rescan pass2
Re-scan of bus 0 was successful

This is a problem as the tape drive (pass2) was on bus 1.  Granted, pass2
was pointing to sa0:asr0:1:6:0 and the device that is now attached is
connected via asr0:1:0:0.

adamu010# camcontrol rescan all
Re-scan of bus 0 was successful
Re-scan of bus 1 was successful
# camcontrol devlist
<ADAPTEC RAID-5 3B0A>              at scbus0 target 0 lun 0 (da0,pass0)
<SUPER GEM318 0>                   at scbus0 target 6 lun 0 (ses0,pass1)
# camcontrol rescan 1:0:0
Re-scan of 1:0:0 was successful
# camcontrol devlist
<ADAPTEC RAID-5 3B0A>              at scbus0 target 0 lun 0 (da0,pass0)
<SUPER GEM318 0>                   at scbus0 target 6 lun 0 (ses0,pass1)
# camcontrol reset 1
Reset of bus 1 was successful
# camcontrol rescan 1
Re-scan of bus 1 was successful
# camcontrol devlist 1
<ADAPTEC RAID-5 3B0A>              at scbus0 target 0 lun 0 (da0,pass0)
<SUPER GEM318 0>                   at scbus0 target 6 lun 0 (ses0,pass1)

The tape drive is not detected without a reboot.  Despite the fine man
page for camcontrol and several examples provided by google of other users
using camcontrol to successfully reattach devices, I cannot do it.  I
assume I have done something wrong, like misunderstanding how scsi devices
and/or termination function.  Can anyone point out what I am doing wrong
and/or tell me how to change tape drives without rebooting my box?

Thank you for any help!

Adam

ps:  Please CC me as I am not subscribed to this list.  TIA!



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.58.0604262107090.15956>