Monday, 21 May 2012
 Home arrow Blog arrow using camcontrol to find information and dynamically add/remove SCSI devices
   
Main Menu
Home
News
Blog
Links
Search
FAQs
Spider
Articles
@intrenet
Free Softwares
Break for fun
Friends VIdeos
Techno videos
Contact Us
Disclaimer
Guest Book
Speed test
V.E.C. Calculator
IPv4 Subnet Calc
IPv6 Subnet Calc
Byte Converter
Converter
GMT/UTC Time
Bandwidth Calc
Allinone Calc
IANA Port Numbers
Country Call Codes
Pk Postal Codes
Surf Anonumously
Visitors Counter
mod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_countermod_vvisit_counter
mod_vvisit_counterToday104
mod_vvisit_counterYesterday203
mod_vvisit_counterThis week104
mod_vvisit_counterThis month4653
mod_vvisit_counterAll125329
 
 
 
 


using camcontrol to find information and dynamically add/remove SCSI devices PDF Print E-mail
User Rating: / 0
PoorBest 
Written by Amanatullah khalil   
Sunday, 24 May 2009

using camcontrol to find information and dynamically add/remove SCSI devices

 

camcontrol is a very useful command for finding information and for adding and removing SCSI devices.


Find what CAM SCSI busses exist and what devices are connected to them:



# camcontrol devlist
at scbus0 target 0 lun 0 (pass0,da0)
at scbus1 target 3 lun 0 (pass1,sa0)
at scbus1 target 6 lun 0 (pass2,cd0)
#

Notice that the USB bus on my system is considered a CAM SCSI bus.
I have two busses here. Bus 0 (USB) has a compact flash reader on it at target 0.
Bus 1 (SCSI) has a tape drive (sequential access device: sa0) at target 3 and a
cdrom drive (cd0) at target 6.

Let’s say that we want to temporarily take the tape drive off without rebooting the
system and go backup another system. Since we only have a tape drive and
a cdrom drive this is pretty safe (disk drives with mounted filesystems would be
a different story). What we can do is shut off the power to the tape drive and
the cdrom drive and then run a “camcontrol rescan [busnumber]” to rescan the bus.
In this case the bus I want to rescan is bus 1:



# camcontrol rescan 1
Re-scan of bus 1 was successful
#

In the messages file you should see some entries like the following logging the
removal of the devices (the ahc0 denotes an Adaptec 2940):



Jan 19 18:23:02 moonpalace /kernel: (sa0:ahc0:0:3:0): lost device
Jan 19 18:23:02 moonpalace /kernel: (sa0:ahc0:0:3:0): removing device entry
Jan 19 18:23:02 moonpalace /kernel: (cd0:ahc0:0:6:0): lost device
Jan 19 18:23:02 moonpalace /kernel: (cd0:ahc0:0:6:0): removing device entry

Also notice if we do a devlist again we only see the USB bus:



# camcontrol devlist
at scbus0 target 0 lun 0 (pass0,da0)
#

Since I am not adding them to a different system I will turn the power back on to the
devices and run “camcontrol rescan [busnumber]” again:



# camcontrol rescan 1
Re-scan of bus 1 was successful
#

In the messages file again we show that the devices are back:



Jan 19 18:31:52 moonpalace /kernel: cd0 at ahc0 bus 0 target 6 lun 0
Jan 19 18:31:52 moonpalace /kernel: cd0: Removable CD-ROM SCSI-2 device
Jan 19 18:31:52 moonpalace /kernel: cd0: 5.000MB/s transfers (5.000MHz, offset 15)
Jan 19 18:31:52 moonpalace /kernel: cd0: Attempt to query device size failed: NOT READY, Medium not present
Jan 19 18:31:52 moonpalace /kernel: sa0 at ahc0 bus 0 target 3 lun 0
Jan 19 18:31:52 moonpalace /kernel: sa0: Removable Sequential Access SCSI-2 device
Jan 19 18:31:52 moonpalace /kernel: sa0: 5.000MB/s transfers (5.000MHz, offset 11)

A devlist also shows that everything is back:



# camcontrol devlist
at scbus0 target 0 lun 0 (pass0,da0)
at scbus1 target 3 lun 0 (pass1,sa0)
at scbus1 target 6 lun 0 (pass2,cd0)
#

courtesy http://www.tech-recipes.com/rx/344/using-camcontrol-to-find-information-and-dynamically-addremove-scsi-devices/

 
< Prev   Next >
 
 
 
csatpk Newsflash
Statistics
OS: Linux h
PHP: 5.2.17
MySQL: 5.1.63-community-log
Time: 20:24
Caching: Disabled
GZIP: Disabled
Members: 3
News: 368
Web Links: 5
Visitors: 265566
Popular