[opensuse] PATA vs. SATA: which port is device on?
Following is output from 3 machines: hwinfo --cdrom: http://fm.no-ip.com/tmp/Linux/hwinfocdrom-big31.txt http://fm.no-ip.com/tmp/Linux/hwinfocdrom-fi965.txt http://fm.no-ip.com/tmp/Linux/hwinfocdrom-gx270.txt /proc/scsi: http://fm.no-ip.com/tmp/Linux/scsi-big31.txt http://fm.no-ip.com/tmp/Linux/scsi-fi965.txt http://fm.no-ip.com/tmp/Linux/scsi-gx270.txt In all 3's hwinfo output, the OM device is reported to be on IDE interface, which for at least one of the three is an outright lie (AD-7200S is SATA). I didn't know all to start with, which is why the question, though I do now know from seeing these particular model numbers. 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? Is there something from cmdline better than hwinfo or /proc/scsi to find this out? Would use of a PATA to SATA or vice versa converter produce an erroneous report? -- "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
Hello, 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) HTH, -dnh -- Now the world has gone to bed, | Now I lay me down to sleep, Darkness won't engulf my head, | Try to count electric sheep, I can see by infrared, | Sweet dream wishes you can keep, How I hate the night. | How I hate the night. -- Marvin -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
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? Any suggestions for something simpler and/or more authoritative? -- "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
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 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. /Per -- Per Jessen, Zürich (6.4°C) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
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
Felix Miata wrote:
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?
I don't know which machine it didn't work on.
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.
Hmm, doesn't work on an 11.0 system here either. I'm not very good with awk, but try this instead: hwinfo --cdrom | \ grep /dev/disk/by-path | \ cut -d- -f3 | cut -d: -f2-5 | \ xargs printf "/sbin/lspci | grep %s;" | sh /Per -- Per Jessen, Zürich (8.6°C) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 2010/02/23 17:00 (GMT+0100) Per Jessen composed:
Felix Miata wrote:
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?
I don't know which machine it didn't work on.
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.
Hmm, doesn't work on an 11.0 system here either. I'm not very good with awk, but try this instead:
hwinfo --cdrom | \ grep /dev/disk/by-path | \ cut -d- -f3 | cut -d: -f2-5 | \ xargs printf "/sbin/lspci | grep %s;" | sh
Only output is errors. Doesn't exit either. -- "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
Felix Miata wrote:
On 2010/02/23 17:00 (GMT+0100) Per Jessen composed:
Hmm, doesn't work on an 11.0 system here either. I'm not very good with awk, but try this instead:
hwinfo --cdrom | \ grep /dev/disk/by-path | \ cut -d- -f3 | cut -d: -f2-5 | \ xargs printf "/sbin/lspci | grep %s;" | sh
Only output is errors. Doesn't exit either.
I tried it on your big31.txt file - it won't output anything as I don't have your lspci output, but otherwise it worked just fine. Ditto for fi965.txt and gx270.txt. Any chance that you didn't get the script copied correctly? http://jessen.ch/files/4felix.sh /Per -- Per Jessen, Zürich (3.8°C) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 2010/02/24 08:19 (GMT+0100) Per Jessen composed:
Felix Miata wrote:
On 2010/02/23 17:00 (GMT+0100) Per Jessen composed:
Hmm, doesn't work on an 11.0 system here either. I'm not very good with awk, but try this instead:
hwinfo --cdrom | \ grep /dev/disk/by-path | \ cut -d- -f3 | cut -d: -f2-5 | \ xargs printf "/sbin/lspci | grep %s;" | sh
Only output is errors. Doesn't exit either.
I tried it on your big31.txt file - it won't output anything as I don't have your lspci output, but otherwise it worked just fine.
http://fm.no-ip.com/tmp/Linux/ now has lspci an lspci -v output for the 3 hosts.
Ditto for fi965.txt and gx270.txt. Any chance that you didn't get the script copied correctly?
Yes and no. I do my email on OS/2. I touched the file on 11.0's filesystem using 11.0, but then pasted the copy using my OS/2 OFM's built in editor, which included carriage returns with the line feeds. After dos2unix on the file it produces output. However, it seems my original question didn't reflect my intent. I have no problem visually extracting the same output from hwinfo --cdrom as your script. It didn't answer my question then, and doesn't answer the question now. 00:1f.5 IDE interface: Intel Corporation 82801H (ICH8 Family) 2 port SATA IDE Controller (rev 02) That tells me what controller the OM is attached to, but AFAICT not whether it's on a PATA or SATA port. I might infer that because it listed the 2 port rather than the 4 port, but the fact is the OM device is on an SATA port on the fi965 host.
From the model numbers I know that big31 and gx270 have PATA OM, and fi965 has SATA OM. How from any kind of cmdline script or utility, without using the OM device's model number, can I find out whether the port the OM device is connected to is PATA or SATA? -- "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
Felix Miata wrote:
However, it seems my original question didn't reflect my intent. I have no problem visually extracting the same output from hwinfo --cdrom as your script. It didn't answer my question then, and doesn't answer the question now.
00:1f.5 IDE interface: Intel Corporation 82801H (ICH8 Family) 2 port SATA IDE Controller (rev 02)
That tells me what controller the OM is attached to, but AFAICT not whether it's on a PATA or SATA port.
Hmm, the ICH8 chip does both SATA and PATA - I'm surprised they don't show up as separate PCI entities, but as they don't, I think you need some ICH8-specific utility to tell you whether a device is connected as PATA or SATA. Wild guess - maybe there is something in the ata_piix driver that'll help you? /Per -- Per Jessen, Zürich (8.5°C) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Hello, On Wed, 24 Feb 2010, Felix Miata wrote:
00:1f.5 IDE interface: Intel Corporation 82801H (ICH8 Family) 2 port SATA IDE Controller (rev 02)
That tells me what controller the OM is attached to, but AFAICT not whether it's on a PATA or SATA port. I might infer that because it listed the 2 port rather than the 4 port, but the fact is the OM device is on an SATA port on the fi965 host.
From the model numbers I know that big31 and gx270 have PATA OM, and fi965 has SATA OM. How from any kind of cmdline script or utility, without using the OM device's model number, can I find out whether the port the OM device is connected to is PATA or SATA?
Try 'lspci -v'. Does that show subdevices or some such? Otherwise, you could try to rummage about in /sys/ (and/or /proc), if there is any stuff by which you can discern ICH8 PATA from ICH8 SATA... BTW: what's the lcpci line for the SATA stuff, is it 'IDE interface' after the PCI-ID too? With an AMD 770 Chipset you get: # lspci -v 00:11.0 SATA controller: ATI Technologies Inc SB700/SB800 SATA Controller [AHCI mode] (prog-if 01 [AHCI 1.0]) Subsystem: Giga-byte Technology Device b002 Flags: bus master, 66MHz, medium devsel, latency 32, IRQ 22 I/O ports at ff00 [size=8] I/O ports at fe00 [size=4] I/O ports at fd00 [size=8] I/O ports at fc00 [size=4] I/O ports at fb00 [size=16] Memory at fe02f000 (32-bit, non-prefetchable) [size=1K] Capabilities: [60] Power Management version 2 Capabilities: [70] SATA HBA <?> Kernel driver in use: ahci 00:14.1 IDE interface: ATI Technologies Inc SB700/SB800 IDE Controller (prog-if 8a [Master SecP PriP]) Subsystem: Giga-byte Technology Device 5002 Flags: bus master, 66MHz, medium devsel, latency 32, IRQ 16 I/O ports at 01f0 [size=8] I/O ports at 03f4 [size=1] I/O ports at 0170 [size=8] I/O ports at 0374 [size=1] I/O ports at fa00 [size=16] Capabilities: [70] MSI: Enable- Count=1/1 Maskable- 64bit- Kernel driver in use: pata_atiixp both are "onboard" in the ATI/AMD SB700 (SB710?) "Southbridge" (like the ICH). With IDE-mode instead of ahci, IIRC the module would be some sata_* module. So, have a look at what shows up as "Kernel driver" with your ICH8. Oh, and you could also have a look at the 'lspci [-v] -n' output if (sub-) IDs differ. AFAIR, they should. # lspci -v -n ### annotated [..] 00:11.0 0106: 1002:4391 (prog-if 01 [AHCI 1.0]) ^^^^^^^^^ Subsystem: 1458:b002 ^^^^^^^^^ Flags: bus master, 66MHz, medium devsel, latency 32, IRQ 22 I/O ports at ff00 [size=8] I/O ports at fe00 [size=4] I/O ports at fd00 [size=8] I/O ports at fc00 [size=4] I/O ports at fb00 [size=16] Memory at fe02f000 (32-bit, non-prefetchable) [size=1K] Capabilities: [60] Power Management version 2 Capabilities: [70] SATA HBA <?> Kernel driver in use: ahci [..] 00:14.1 0101: 1002:439c (prog-if 8a [Master SecP PriP]) ^^^^^^^^^ Subsystem: 1458:5002 ^^^^^^^^^ Flags: bus master, 66MHz, medium devsel, latency 32, IRQ 16 I/O ports at 01f0 [size=8] I/O ports at 03f4 [size=1] I/O ports at 0170 [size=8] I/O ports at 0374 [size=1] I/O ports at fa00 [size=16] Capabilities: [70] MSI: Enable- Count=1/1 Maskable- 64bit- Kernel driver in use: pata_atiixp I wonder what the 'prog-if' is ... ;) Once you have those characteristics, you should be able to enhance my awk script accordingly (or ask with the relevant lspci [-v] [-n] output). HTH, -dnh -- I have this sinking feeling that I'm going to be sitting in a corner one day...glazed eyes, drooling and sucking on a 30-pin SIMM. -- Andrew <borehawg@inemy.com> -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Hello, On Mon, 22 Feb 2010, Felix Miata wrote:
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?
IIRC, 11.0 did not yet use libata for IDE/PATA as well. So, you won't get PATA devices with the SCSI-paths in /dev/by-path/. On those machines, you can discern between PATA and SATA easily anyway, just have a look at /proc/ide/hd*/model or with a different pattern under /dev/by-path/. HTH, -dnh -- So Linus, what are we doing tonight? The same thing we do every night Tux. Try to take over the world! -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
David Haller wrote:
Hello,
On Mon, 22 Feb 2010, Felix Miata wrote:
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?
IIRC, 11.0 did not yet use libata for IDE/PATA as well. So, you won't get PATA devices with the SCSI-paths in /dev/by-path/.
From my sons machine:
# cat /etc/SuSE-release openSUSE 11.0 (i586) VERSION = 11.0 # ls -1 /dev/disk/by-path/ pci-0000:00:1f.1-scsi-0:0:0:0 pci-0000:00:1f.1-scsi-0:0:0:0-part1 pci-0000:00:1f.1-scsi-0:0:0:0-part2 pci-0000:00:1f.1-scsi-0:0:0:0-part3 pci-0000:00:1f.1-scsi-1:0:0:0 /Per -- Per Jessen, Zürich (6.9°C) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 2010/02/23 11:35 (GMT+0100) David Haller composed:
Felix Miata wrote:
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?
IIRC, 11.0 did not yet use libata for IDE/PATA as well.
You're not RC. Legacy is/was an option, but not applicable for this machine.
So, you won't get PATA devices with the SCSI-paths in /dev/by-path/.
When would OM devices be in /dev/disk/by-path? I don't seen any there.
On those machines, you can discern between PATA and SATA easily anyway, just have a look at /proc/ide/hd*/model
/proc/ide/hd* does not exist
or with a different pattern under /dev/by-path/.
No OM devices I can see there. -- "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
participants (3)
-
David Haller
-
Felix Miata
-
Per Jessen