[PLUG] Where'd sg0 go?

Larry Brigman larry.brigman at gmail.com
Tue Jan 15 17:57:53 UTC 2008


On Jan 15, 2008 7:50 AM, Richard C. Steffens <rsteff at comcast.net> wrote:
> At one point yesterday afternoon the wind was picking up enough to cause
> some beeping from my battery backup. Since it appeared that it was just
> getting started and was getting worse, I shut down my various computers.
> As it turned out, that was the worst of the wind, and we never did lose
> power out here.
>
> I have a post-it note that reminds me to change the permissions of
> /dev/sg0 to 666 so I can use my scanner without running as root. When I
> tried to do that I found that there is no /dev/sg0. I realized that when
> I shut down the computer yesterday I also shut off the scanner. I didn't
> power up the scanner this morning. I remember that the instructions for
> the scanner (when I used to use it on Win98) said that the scanner had
> to be powered on before booting or the machine would not be able to find
> it.
>
> Is that true of all SCSI devices? I.e., does the hardware have to be
> powered up for the system to see before /dev/sg0 will be created?
>
> Is there some way to tell the system to expect a SCSI device sometime in
> the future without having it powered up before booting?
>

In the SG utils package there is a script to scan the SCSI bus.  This
will allow you to
see and access devices that were powered up after the bus was scanned.
Actually the devices do show up when you look at the procfs but
getting the device
added requires manual intervention.

Becasue most of the SG driver is now standard in the kernel the script
is in various places
on the net.  My Google search resulted in this one.
http://www.garloff.de/kurt/linux/rescan-scsi-bus.sh-1.25

Adapt it as needed.  The command that is needed is scsi add-device as follows:
        echo "scsi add-single-device $devnr" > /proc/scsi/scsi



More information about the PLUG mailing list