LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
 
Search this Thread
Old 02-18-2014, 03:28 PM   #1
Mahonri
Member
 
Registered: May 2007
Location: Austin, Texas, USA
Distribution: Debian Etch
Posts: 34

Rep: Reputation: 15
How do I map ATA devices to /dev/sd* block devices when using a port multiplier?


Hi All,

I have a couple e-SATA enclosures that each contain multiple disks. I'd like to be able to determine which ATA device corresponds with which /dev/sd* device. Is there any way to do this?

When I list the ATA devices I see 15 in each of my e-SATA enclosures (dev9 and dev10). Only 3 disks are actually populated in each of these enclosures.

# ls -l /sys/class/ata_device | grep external

lrwxrwxrwx 1 root root 0 Feb 17 20:41 dev9.0 -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata9/link9/dev9.0/ata_device/dev9.0
lrwxrwxrwx 1 root root 0 Feb 17 20:41 dev9.0.0 -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata9/link9.0/dev9.0.0/ata_device/dev9.0.0
lrwxrwxrwx 1 root root 0 Feb 17 20:41 dev9.1.0 -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata9/link9.1/dev9.1.0/ata_device/dev9.1.0
lrwxrwxrwx 1 root root 0 Feb 17 20:41 dev9.2.0 -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata9/link9.2/dev9.2.0/ata_device/dev9.2.0
lrwxrwxrwx 1 root root 0 Feb 17 20:41 dev9.3.0 -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata9/link9.3/dev9.3.0/ata_device/dev9.3.0
lrwxrwxrwx 1 root root 0 Feb 17 20:41 dev9.4.0 -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata9/link9.4/dev9.4.0/ata_device/dev9.4.0
lrwxrwxrwx 1 root root 0 Feb 17 20:41 dev9.5.0 -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata9/link9.5/dev9.5.0/ata_device/dev9.5.0
lrwxrwxrwx 1 root root 0 Feb 17 20:41 dev9.6.0 -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata9/link9.6/dev9.6.0/ata_device/dev9.6.0
lrwxrwxrwx 1 root root 0 Feb 17 20:41 dev9.7.0 -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata9/link9.7/dev9.7.0/ata_device/dev9.7.0
lrwxrwxrwx 1 root root 0 Feb 17 20:41 dev9.8.0 -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata9/link9.8/dev9.8.0/ata_device/dev9.8.0
lrwxrwxrwx 1 root root 0 Feb 17 20:41 dev9.9.0 -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata9/link9.9/dev9.9.0/ata_device/dev9.9.0
lrwxrwxrwx 1 root root 0 Feb 17 20:41 dev9.10.0 -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata9/link9.10/dev9.10.0/ata_device/dev9.10.
lrwxrwxrwx 1 root root 0 Feb 17 20:41 dev9.11.0 -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata9/link9.11/dev9.11.0/ata_device/dev9.11.
lrwxrwxrwx 1 root root 0 Feb 17 20:41 dev9.12.0 -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata9/link9.12/dev9.12.0/ata_device/dev9.12.
lrwxrwxrwx 1 root root 0 Feb 17 20:41 dev9.13.0 -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata9/link9.13/dev9.13.0/ata_device/dev9.13.
lrwxrwxrwx 1 root root 0 Feb 17 20:41 dev9.14.0 -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata9/link9.14/dev9.14.0/ata_device/dev9.14.

lrwxrwxrwx 1 root root 0 Feb 17 20:41 dev10.0 -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata10/link10/dev10.0/ata_device/dev10.0
lrwxrwxrwx 1 root root 0 Feb 17 20:41 dev10.0.0 -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata10/link10.0/dev10.0.0/ata_device/dev10.0.0
lrwxrwxrwx 1 root root 0 Feb 17 20:41 dev10.1.0 -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata10/link10.1/dev10.1.0/ata_device/dev10.1.0
lrwxrwxrwx 1 root root 0 Feb 17 20:41 dev10.2.0 -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata10/link10.2/dev10.2.0/ata_device/dev10.2.0
lrwxrwxrwx 1 root root 0 Feb 17 20:41 dev10.3.0 -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata10/link10.3/dev10.3.0/ata_device/dev10.3.0
lrwxrwxrwx 1 root root 0 Feb 17 20:41 dev10.4.0 -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata10/link10.4/dev10.4.0/ata_device/dev10.4.0
lrwxrwxrwx 1 root root 0 Feb 17 20:41 dev10.5.0 -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata10/link10.5/dev10.5.0/ata_device/dev10.5.0
lrwxrwxrwx 1 root root 0 Feb 17 20:41 dev10.6.0 -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata10/link10.6/dev10.6.0/ata_device/dev10.6.0
lrwxrwxrwx 1 root root 0 Feb 17 20:41 dev10.7.0 -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata10/link10.7/dev10.7.0/ata_device/dev10.7.0
lrwxrwxrwx 1 root root 0 Feb 17 20:41 dev10.8.0 -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata10/link10.8/dev10.8.0/ata_device/dev10.8.0
lrwxrwxrwx 1 root root 0 Feb 17 20:41 dev10.9.0 -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata10/link10.9/dev10.9.0/ata_device/dev10.9.0
lrwxrwxrwx 1 root root 0 Feb 17 20:41 dev10.10.0 -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata10/link10.10/dev10.10.0/ata_device/dev10.10.0
lrwxrwxrwx 1 root root 0 Feb 17 20:41 dev10.11.0 -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata10/link10.11/dev10.11.0/ata_device/dev10.11.0
lrwxrwxrwx 1 root root 0 Feb 17 20:41 dev10.12.0 -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata10/link10.12/dev10.12.0/ata_device/dev10.12.0
lrwxrwxrwx 1 root root 0 Feb 17 20:41 dev10.13.0 -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata10/link10.13/dev10.13.0/ata_device/dev10.13.0
lrwxrwxrwx 1 root root 0 Feb 17 20:41 dev10.14.0 -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata10/link10.14/dev10.14.0/ata_device/dev10.14.0

These are the block devices which correspond to the disks which have been inserted in these two enclosures:

# ls -l /sys/class/block | grep external

lrwxrwxrwx 1 root root 0 Feb 17 20:41 sde -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata9/host8/target8:0:0/8:0:0:0/block/sde
lrwxrwxrwx 1 root root 0 Feb 17 20:41 sdf -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata9/host8/target8:1:0/8:1:0:0/block/sdf
lrwxrwxrwx 1 root root 0 Feb 17 20:41 sdg -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata9/host8/target8:2:0/8:2:0:0/block/sdg

lrwxrwxrwx 1 root root 0 Feb 17 20:41 sdh -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata10/host9/target9:0:0/9:0:0:0/block/sdh
lrwxrwxrwx 1 root root 0 Feb 17 20:41 sdi -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata10/host9/target9:1:0/9:1:0:0/block/sdi
lrwxrwxrwx 1 root root 0 Feb 17 20:41 sdj -> ../../devices/soc.0/fd800000.pcie-external0/pci0001:00/0001:00:00.0/0001:01:00.0/ata10/host9/target9:2:0/9:2:0:0/block/sdj

What I really want to know is which physical slot in my e-SATA enclosure corresponds to a given block device. I was hoping that by knowing the ATA device I could figure this out, assuming that the ATA device will be fixed to a given slot.

Thanks for your help.

Last edited by Mahonri; 02-18-2014 at 04:40 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What creates /dev/pts, /dev/loopx, and other /dev devices - Fedora Core 2 rickpo12 Linux - General 5 02-11-2012 08:50 PM
Re-Map SCSI Devices w/o Reboot pheasand Linux - Hardware 0 03-09-2007 12:36 PM
what is the different btw raw devices and block devices yenonn Linux - General 2 02-10-2006 09:34 PM
How to add block devices in the /dev path dvs Linux - Hardware 2 01-21-2004 04:23 PM
How to map two joysticks on a y-cable to separate devices? BeauMN Linux - Hardware 0 08-04-2003 08:12 PM


All times are GMT -5. The time now is 02:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration