On 2010/02/23 08:23 (GMT+0100) Per Jessen composed:
Felix Miata wrote:
On 2010/02/22 15:08 (GMT+0100) David Haller composed:
On Mon, 22 Feb 2010, Felix Miata wrote:
Ignoring whatever information can be discovered or inferred from device model numbers or names, how can one determine whether a device is connected to a PATA port or an SATA port?
$ hwinfo --cdrom | awk ' /Device Files/ { pci = gensub(".*/by-path/pci-[0-9]+:([0-9:.]+)-scsi.*", "\\1", 1); cmd = "/sbin/lspci"; while ( cmd | getline ) { if( $1 == pci ) { print; }; }; }'
prints the controller the device "hangs on", e.g. one of:
00:14.1 IDE interface: ATI Technologies Inc SB700/SB800 IDE Controller 00:11.0 SATA controller: ATI Technologies Inc SB700/SB800 SATA Controller [AHCI mode] 03:07.0 RAID bus controller: Silicon Image, Inc. SiI 3114 [SATALink/SATARaid] Serial ATA Controller (rev 02)
Thanks for your reply.
First I put it in a script.
Then I tried it on a fresh M2 install on a system with no attached SATA devices, and got: "00:09.0 IDE interface: nVidia Corporation nForce2 IDE (rev a2)". That seems reasonable.
I also tried it on an 11.0 install on a i965/ICH8 system with no attached PATA devices, and got no output. Any ideas why?
It's difficult to tell without the output from 'hwinfo --cdrom' and 'lspci'.
Any particular reason that info in the thread starter wasn't good enough for you?
Any suggestions for something simpler and/or more authoritative?
AFAICT, Davids awk-script does it just fine - it picks the PCI identifier from /dev/disk/by-path and looks up the PCI device.
But it didn't on my 11.0 server running the HDs on software RAID1 and the DVD on a 3rd SATA port. I wouldn't expect the OM device to show up in /dev/disk*, or any script that depends on it, to work. -- "Our Constitution was made only for a moral and religious people. It is wholly inadequate to the government of any other." John Adams, 2nd US President Team OS/2 ** Reg. Linux User #211409 Felix Miata *** http://fm.no-ip.com/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org