Re: How to find which disk a LUN is mapped to
On Thu, 2009-04-30 at 10:16 +0100, Bryn M. Reeves wrote: On Thu, 2009-04-30 at 13:25 +1200, Paul Ward wrote: Hi all, I need to find out which disk LUN6 points to on my RH3 box. Hmm. I just noticed that version. If you mean RHEL3 rather than Fedora Core 3 then you're unfortunately out of luck. The 2.4 kernel in RHEL3 doesn't have sysfs. You can still match this up but you might find it easier to just look in dmesg - when the SCSI devices are registered (at boot or when they are added to the system) you should see the device name as well as the bus address logged. Regards, Bryn. -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: How to find which disk a LUN is mapped to
On Thu, 2009-04-30 at 11:21 +0100, Bryn M. Reeves wrote: On Thu, 2009-04-30 at 10:16 +0100, Bryn M. Reeves wrote: On Thu, 2009-04-30 at 13:25 +1200, Paul Ward wrote: Hi all, I need to find out which disk LUN6 points to on my RH3 box. Hmm. I just noticed that version. If you mean RHEL3 rather than Fedora Core 3 then you're unfortunately out of luck. The 2.4 kernel in RHEL3 doesn't have sysfs. You can still match this up but you might find it easier to just look in dmesg - when the SCSI devices are registered (at boot or when they are added to the system) you should see the device name as well as the bus address logged. You can also install the sg3_utils package (should be available on RHEL3 iirc) which can query the mappings and print them in a pretty format. E.g.: # sg_map -x /dev/sg0 0 0 0 0 0 /dev/sda /dev/sg1 0 0 1 0 0 /dev/sdb /dev/sg2 3 0 0 0 0 /dev/sdc /dev/sg3 3 0 0 1 0 /dev/sdd [...] # sginfo -l /dev/scd0 /dev/sda /dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf /dev/sdg /dev/sdh /dev/sdi /dev/sdj /dev/sdk /dev/sdl /dev/sdm /dev/sdn /dev/sdo /dev/sdp /dev/sdq /dev/sdr /dev/sds /dev/sdt /dev/sdu /dev/sdv /dev/sdw /dev/sdx /dev/sdy /dev/sdz /dev/sdaa /dev/sdab /dev/sdac /dev/sdad /dev/sdae /dev/sdaf /dev/sdag /dev/sdah /dev/sdai /dev/sdak /dev/sdal /dev/sdam /dev/sdan /dev/sdao /dev/sdap /dev/sdaq /dev/sdar /dev/sdas /dev/sdat /dev/sdau /dev/sdaj /dev/sg0 [=/dev/sda scsi0 ch=0 id=0 lun=0] /dev/sg1 [=/dev/sdb scsi0 ch=0 id=1 lun=0] /dev/sg2 [=/dev/sdc scsi3 ch=0 id=0 lun=0] /dev/sg3 [=/dev/sdd scsi3 ch=0 id=0 lun=1] [...] The sg_map command needs the sg module loaded to work. Regards, Bryn. -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: How to find which disk a LUN is mapped to
Bryn M. Reeves wrote: On Thu, 2009-04-30 at 10:16 +0100, Bryn M. Reeves wrote: On Thu, 2009-04-30 at 13:25 +1200, Paul Ward wrote: Hi all, I need to find out which disk LUN6 points to on my RH3 box. Hmm. I just noticed that version. If you mean RHEL3 rather than Fedora Core 3 then you're unfortunately out of luck. If you've got RHEL3, you need scsi_info : [r...@machine root]# scsi_info /dev/sda SCSI_ID=0,0,0,1:VENDOR=COMPAQ:MODEL=HSV110 (C)COMPAQ:FW_REV=3110:SN=P5849E1AAQ601B:WWN=50001fe15002f9d0:LUN=600508b4001009aa-f00010e4: It comes from the kernel-pcmcia-cs package (don't ask me why!): [r...@machine root]# rpm -qif `which scsi_info` Name: kernel-pcmcia-cs Relocations: (not relocatable) Version : 3.1.31Vendor: Red Hat, Inc. As you can see from above, it should give you the WWID of the LUN for each of your /dev/sd* devices - you can just go through them all looking for the LUN= and matching that to the WWID on your storage. The above example is an HP machine connected to an HP EVA 5000, so your results might vary. -- Sam -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: How to find which disk a LUN is mapped to
On Thu, 2009-04-30 at 13:25 +1200, Paul Ward wrote: Hi all, I need to find out which disk LUN6 points to on my RH3 box. I have looked at /proc/scsi/scsi This gives me LUNS from 00 to 05 Does this mean 05 is infact LUN06? These days it's easiest to find this information from sysfs. Under /sys/bus/scsi/devices you'll find sub-directories that list all SCSI devices by their bus address (in host:bus:target:lun format). E.g. if I want to find out what device 3:0:0:1 on my system is I can look at: # ls /sys/bus/scsi/devices/3\:0\:0\:1/ block:sdd delete dh_state genericiodone_cnt iorequest_cnt powerqueue_type rev scsi_disk:3:0:0:1 scsi_level subsystem typevendor busdevice_blocked driveriocounterbits ioerr_cnt model queue_depth rescan scsi_device:3:0:0:1 scsi_generic:sg3 state timeoutuevent The first entry is a symlink that points back to the corresponding block device, in this case /dev/sdd: # ls -l /sys/bus/scsi/devices/3\:0\:0\:1/block\:sdd lrwxrwxrwx 1 root root 0 Apr 30 10:06 /sys/bus/scsi/devices/3:0:0:1/block:sdd - ../../../../../../../../../block/sdd All the symlinks can make navigating sysfs a bit daunting at first but there's a wealth of useful information and knobs to tweak in there. Tools like systool and udevinfo can also help to make it a bit easier to digest. Regards, Bryn. -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
How to find which disk a LUN is mapped to
Hi all, I need to find out which disk LUN6 points to on my RH3 box. I have looked at /proc/scsi/scsi This gives me LUNS from 00 to 05 Does this mean 05 is infact LUN06? If so where can I see where that device is then mapped to? Thanks -- -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: How to find which disk a LUN is mapped to
Paul Ward wrote: Hi all, I need to find out which disk LUN6 points to on my RH3 box. I have looked at /proc/scsi/scsi This gives me LUNS from 00 to 05 Does this mean 05 is infact LUN06? If so where can I see where that device is then mapped to? Thanks -- /etc/fstab would have any filesystems you have mounted. SCSI disks are usually labeled /dev/sda?. In this case, if your primary disk is also SCSI, any additional SCSI devices on another controller would be sdb?. If you have 6 LUNs on your storage device, that LUN06 could actually be /dev/sdg?. The question mark is a number pertaining to the filesystem on the specific disk in question.. -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: How to find which disk a LUN is mapped to
Paul Ward wrote: Hi all, I need to find out which disk LUN6 points to on my RH3 box. I have looked at /proc/scsi/scsi This gives me LUNS from 00 to 05 Does this mean 05 is infact LUN06? If I remember correctly, it does. If so where can I see where that device is then mapped to? LUNs are usually all on the same piece of hardware. For example, a tape drive with a tape changer could have the tape drive as one LUN, and the changer as another LUN, but they both use the same SCSI device number. Another possibility is a LUN controller with multiple IDE CD/DVD ROM drives attached. Each drive would be a separate LUN on the same SCSI device number. Sometimes you will run into a CD changer CD drive with each disk having its own LUN. (I had a 5 disk changer that worked that way.) Without knowing you hardware, we can not tell you what device you are looking at. But there should be a group of lines in /proc/scsi/scsi with the first line listing the controller card, the channel, the SCSI ID, and the LUN. There should be a description of the device below that. All the listings that have the same controller, channel, and ID, but differing LUNs should be the same hardware device. Look at the descriptions. Mikkel -- Do not meddle in the affairs of dragons, for thou art crunchy and taste good with Ketchup! signature.asc Description: OpenPGP digital signature -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines