find out if disk is IDE or SATA

Interesting question. dmesg should have something like this if it's a SATA drive:

 dmesg | grep -i SATA
 [    3.972803] ata3: SATA max UDMA/133 cmd 0xe800 ctl 0xe400 bmdma 0xd800 irq 18
 [    3.972807] ata4: SATA max UDMA/133 cmd 0xe000 ctl 0xdc00 bmdma 0xd808 irq 18

I then grep'ed the dmesg output for "ata3" and found the serial number:

dmesg | grep -in ata3
397:[    3.972803] ata3: SATA max UDMA/133 cmd 0xe800 ctl 0xe400 bmdma 0xd800 irq 18
409:[    4.183701] ata3.00: ATA-7: ST3160812AS, 3.ADH, max UDMA/133
410:[    4.183706] ata3.00: 312500000 sectors, multi 16: LBA48 NCQ (depth 0/32)
411:[    4.267004] ata3.00: configured for UDMA/133

which could then be looked up smartctl or hdparm -i /dev/<your disk(s)> to match serial with device.

I'm sure someone with l33t shell scripting skillz could do this all up on one line, but this should be pretty solid. If any doubts, I'd check the serial number against the manufacturer's Website as Madhatter suggested.

I ran the same dmesg | grep -i SATA on Ubuntu running on a VMware virtual machine (which treats the virtual drives as SCSI) and a server with SCSI disks; both returned nothing.


One pretty reliable method is to use lshw to lookup the model number and then to lookup the model number on Google to see what type of device it is. This method doesn't work if the drive is in a USB enclosure, some USB controllers hide the HD info from you.

So for this system you would do a search on ST31500341AS. and find that it is a 1.5TB SATA drive.

root@pabil:# lshw -class disk
  *-disk:0                
       description: ATA Disk
       product: ST31500341AS
       vendor: Seagate
       physical id: 0
       bus info: scsi@0:0.0.0
       logical name: /dev/sda
       version: CC1H
       serial: 9VS0R1WB
       size: 1397GiB (1500GB)
       capabilities: partitioned partitioned:dos
       configuration: ansiversion=5 signature=000473f5

If it were IDE, it would very likely show up as /dev/hda. You could try smartctl -a /dev/sda which will produce a lot of information including manufacturer and model number; cross-referencing that on the manufacturer's website is usually fairly simple.