[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: check-debian-cd 1.10



Try this one to detect scsi cd drives.

  for i in $(seq 0 `grep CD-ROM /proc/scsi/scsi | wc -l`)
  do
    echo /dev/scd$i
  done

On my system (a new potato system), /dev/scd goes from 0 to 16

  $ ls /dev/scd*
  /dev/scd0  /dev/scd10  /dev/scd12  /dev/scd14  /dev/scd16  /dev/scd3  /dev/scd5  /dev/scd7  /dev/scd9
  /dev/scd1  /dev/scd11  /dev/scd13  /dev/scd15  /dev/scd2   /dev/scd4  /dev/scd6  /dev/scd8

no 0 to f as in the mail below.

To probe device:

  $ md5sum /dev/scd0
  /dev/scd0: No medium found
  $ echo $?
  2

Regards,
/Karl

-----------------------------------------------------------------------
Karl Hammar                    Aspö Data           karl@kalle.csb.ki.se
Lilla Aspö 2340             +46  173 140 57                    Networks
S-742 94 Östhammar         +46  70 511 97 84                  Computers
Sweden                                                       Consulting
-----------------------------------------------------------------------


From: Francesco Potorti` <pot@gnu.org>
Subject: Re: check-debian-cd 1.10
Date: Thu, 05 Oct 2000 18:53:20 +0200

>    > if /dev/cdroms/ exists
>    >    read from all files there
>    > else if /dev/cdrom is readable
>    >    read from there
>    
>    if devfs doesn't exist, you can check /proc for cdrom drives and/or
>    try /dev/hd[a-f] and /dev/scd[0-f].
> 
> I found out that I can find all the ide CD drives:
> 
> for d in all symlinks under /proc/ide
>     if $(cat d/media) = "cdrom"
>        it is a CD
> 
> But I have no similar method  for finding out whether /dev/scd* is there
> or not.  On  my system, I can  read them and get EOF  (same for /dev/hdc
> when there is no CD in the  tray).  Is this a reasonable way of probing?
> If yes, i'd do:
> 
> if /dev/cdroms/ exists
>    read from all files there
> else 
>    for d in all symlinks under /proc/ide
>       if $(cat d/media) = "cdrom"
>          read from d
>    for d in /dev/scd*
>       read from d
> if all previous reads failed and /dev/cdrom is there
>    read from it
> 
> Where `read from' means:
> 
> if Volume ID is not null
>    read the whole disc
> 
> 
> --  
> To UNSUBSCRIBE, email to debian-cd-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: