Re: /proc/scsi/scsi and /dev mapping ?

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

 





Tom Sanders wrote:

>Is there a way to map entries in /proc/scsi/scsi with
>their corresponding mapping with /dev/sda, /dev/sdb
>etc ?
>
>During system boot, entries in /proce/scsi/scsi and
>/dev are initialized in serial order, and there is a
>one to one mapping. However, this mapping is NOT
>guaranteed if devices are selectively removed and
>added using "scsi remove-single-device" and "scsi
>add-single-device" commands.
>
>Any idea of how to work around it ?
>

If you go to the scsi-generic page, there is a page about sg-utils.
On it are several programs for maping scsi devices to consistent names
in /dev based on HBA and model info.
Look here <http://www.torque.net/sg/u_index.html#others>
at scsidev, mapscsi, and scsimap.

Filesystem labels help here too. There is alao a unique filed for
each filesystem that can be used, called UUID.

As for connection between /proc/scsi/scsi and /dev/sdx.
/proc/scsi/scsi is in order by channel then ID then lun.
only hard disck are assigned /dev/sdx names.

'scsi_info /dev/<node>' will give you most of the info in /proc
for a device. Mu USB CDRW shows host,ID,LUB, model, and FW_rev.

If you add/remove devices while the system is running,
the mapping doesn't change. So you save the initial mapping.
when you remove a device, you skip it's sdx entry. when
you add a device, you append it to the sdx list.

But you really shouldn't need to map the /proc and /dev
entries normaly.

    -Thomas



_______________________________________________
Redhat-devel-list mailing list
Redhat-devel-list@redhat.com
https://listman.redhat.com/mailman/listinfo/redhat-devel-list

[Index of Archives]     [Kernel Newbies]     [Red Hat General]     [Fedora]     [Red Hat Install]     [Linux Kernel Development]     [Yosemite News]

  Powered by Linux