public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* Advice on getting the scsi device name.
@ 2004-06-04  2:48 Danny Leong
  2004-06-04  8:09 ` Christoph Hellwig
  2004-06-04 17:20 ` Bryan Henderson
  0 siblings, 2 replies; 3+ messages in thread
From: Danny Leong @ 2004-06-04  2:48 UTC (permalink / raw)
  To: linux-scsi

Hi, 

 I am writing a program that needs to safely and correctly identify and
mount a dev/sda ... dev/sda1 or dev/sdb etc.As far my knowledge fits me,
i have to manually check the entry on proc/scsi/scsi to determine.
Please advice me on a better method that could be included in a C
program. Any help is greatly appreciated. 

- Thanks :) 
Danny


  




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Advice on getting the scsi device name.
  2004-06-04  2:48 Advice on getting the scsi device name Danny Leong
@ 2004-06-04  8:09 ` Christoph Hellwig
  2004-06-04 17:20 ` Bryan Henderson
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2004-06-04  8:09 UTC (permalink / raw)
  To: Danny Leong; +Cc: linux-scsi

On Fri, Jun 04, 2004 at 10:48:16AM +0800, Danny Leong wrote:
> Hi, 
> 
>  I am writing a program that needs to safely and correctly identify and
> mount a dev/sda ... dev/sda1 or dev/sdb etc.As far my knowledge fits me,
> i have to manually check the entry on proc/scsi/scsi to determine.
> Please advice me on a better method that could be included in a C
> program. Any help is greatly appreciated. 

You can't.  mknod is done from userspace and the kernel can't gurantee
you the name.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Advice on getting the scsi device name.
  2004-06-04  2:48 Advice on getting the scsi device name Danny Leong
  2004-06-04  8:09 ` Christoph Hellwig
@ 2004-06-04 17:20 ` Bryan Henderson
  1 sibling, 0 replies; 3+ messages in thread
From: Bryan Henderson @ 2004-06-04 17:20 UTC (permalink / raw)
  To: Danny Leong; +Cc: linux-scsi, linux-scsi-owner

>I am writing a program that needs to safely and correctly identify and
>mount a dev/sda ... dev/sda1 or dev/sdb etc.As far my knowledge fits me,
>i have to manually check the entry on proc/scsi/scsi to determine.
>Please advice me on a better method that could be included in a C
>program.

That depends a lot on what you consider a correct identification.  I can't 
think of any identification that /proc/scsi/scsi would help with. 

At a minimum, you usually have to do an ioctl to the device to find out 
its host, bus, target, and lu numbers.  Typically, even that isn't enough 
of an identification and you have to read VPD from the lu or read a volume 
label from the disk to really know what entity is behind /dev/sda.

What sort of identification are you looking for?


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-06-04 17:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-04  2:48 Advice on getting the scsi device name Danny Leong
2004-06-04  8:09 ` Christoph Hellwig
2004-06-04 17:20 ` Bryan Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox