 |
|
| Linux Forum Index » Linux Development - System » Determine bus device is on?... |
|
Page 1 of 1 |
|
| Author |
Message |
| David... |
Posted: Thu Oct 29, 2009 12:04 am |
|
|
|
Guest
|
Hello,
So say I have /dev/sdf and I want to know if it's on iScsi, PATA, SATA, USB,
etc ... how does one go about doing that in Linux.
TIA!! |
|
|
| Back to top |
|
|
|
| Josef Moellers... |
Posted: Thu Oct 29, 2009 2:00 am |
|
|
|
Guest
|
David wrote:
Quote: Hello,
So say I have /dev/sdf and I want to know if it's on iScsi, PATA, SATA,
USB, etc ... how does one go about doing that in Linux.
BTDT
Check /sys/block/sdX/device. It is a symbolic link which points to an
entry <relativepath>/<bus>:<channel>:<id>:<lun>
HTH,
Josef
--
These are my personal views and not those of Fujitsu Technology Solutions!
Josef Möllers (Pinguinpfleger bei FTS)
If failure had no penalty success would not be a prize (T. Pratchett)
Company Details: http://de.ts.fujitsu.com/imprint.html |
|
|
| Back to top |
|
|
|
| Josef Moellers... |
Posted: Thu Oct 29, 2009 2:02 am |
|
|
|
Guest
|
David wrote:
Quote: Hello,
So say I have /dev/sdf and I want to know if it's on iScsi, PATA, SATA,
USB, etc ... how does one go about doing that in Linux.
For a start: Check /sys/block/sdX/device. It is a symbolic link which
points to an entry <relativepath>/<bus>:<channel>:<id>:<lun>
HTH,
Josef
--
These are my personal views and not those of Fujitsu Technology Solutions!
Josef Möllers (Pinguinpfleger bei FTS)
If failure had no penalty success would not be a prize (T. Pratchett)
Company Details: http://de.ts.fujitsu.com/imprint.html |
|
|
| Back to top |
|
|
|
| David... |
Posted: Thu Oct 29, 2009 9:29 am |
|
|
|
Guest
|
"Josef Moellers" <josef.moellers at (no spam) ts.fujitsu.com> wrote in message
news:hcbi6f$27g$3 at (no spam) nntp.fujitsu-siemens.com...
Quote: David wrote:
Hello,
So say I have /dev/sdf and I want to know if it's on iScsi, PATA, SATA,
USB, etc ... how does one go about doing that in Linux.
For a start: Check /sys/block/sdX/device. It is a symbolic link which
points to an entry <relativepath>/<bus>:<channel>:<id>:<lun
HTH,
Thanks, I see the symbolic link now and that helps. However it's a little
hard to get the actual information and have confidence of good results. For
example on this system there is /dev/sda (HD on SLI RAID controller in JBOD
mode), /dev/hda (standard PATA), /dev/sdf (usb drive). The results are:
.../devices/pci0000:00/0000:00:08.0/0000:01:0a.0/host1/target1:0:0/1:0:0:0/block/sda
.../devices/pci0000:00/0000:00:09.0/ide0/0.0/block/hda
.../devices/pci0000:00/0000:00:02.2/usb1/1-2/1-2:1.0/host6/target6:0:0/6:0:0:0/block/sdf
So first .. is it safe to assume linux will aways have the sym link with the
same number of components (slashes to bus)? ../x/x/x/BUS ?
Next, that RAID controller just has some weird number, how would one convert
that to know it's on a RAID bus (really PATA in RAID mode)?
Is there a list of bus names ... is it "ide", "usb", "scsi", "iscsi",
"fibre", "sata", "1394"?
or is there a much better way to do it like some file "bus" in
/sys/block/sda/bus that would have "RAID" in it ? Well wishful thinking
anyway? |
|
|
| Back to top |
|
|
|
|
|
All times are GMT - 5 Hours
The time now is Wed Dec 09, 2009 8:17 pm
|
|