Sample Header Ad - 728x90

How to figure out primary/secondary IDE channel via sysfs (if possible)

0 votes
1 answer
285 views
Though I've got quite a good basic understanding of sysfs meanwhile, there are still things I cannot solve on my own. For a starter, I'd like to figure out *via sysfs* (later by scripting of course) which channel a block device (HDD, DVD...) is connected to. The funny thing about it is that it is possible for me how to figure out __master or slave__! There is an internal ID deeply rooted in the sysfs tree which gives this away: so 9:0:1 will mean that the device is connected to a (primary OR secondary) __slave__ channel. (master when last digit 0; slave when last digit is 1) OK, but this will still not tell me whether it's the primary or secondary channel. While doing some research about this, I found a __Linux 2.6__-related post in LKML: https://lkml.org/lkml/2006/3/25/20 revealing a sample path like ../../../devices/pci0000:00/0000:00:04.0/ide0/0.0/. Well this is EXACTLY what I need! Unfortunately though, the ideX is nowhere to find in sysfs as of Linux 3.x. Maybe it was removed for good in kernel version 3?
Asked by syntaxerror (2426 rep)
Feb 12, 2015, 09:44 PM
Last activity: Feb 12, 2015, 10:16 PM