LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Using command-line to tell if a drive is 3.5/2.5 and ide/sata/pata ? (https://www.linuxquestions.org/questions/linux-software-2/using-command-line-to-tell-if-a-drive-is-3-5-2-5-and-ide-sata-pata-893211/)

MikeyCarter 07-22-2011 03:24 PM

Using command-line to tell if a drive is 3.5/2.5 and ide/sata/pata ?
 
Anyone know if there is a way of detecting if a hard drive is 3.5/2.5 and ide/sata/pata from within a script?

Michael

pljvaldez 07-22-2011 03:38 PM

Maybe try lshw -class disk or dmesg | grep -i SATA followed by dmesg | grep -in ataX where the ataX is ata1, ata2, ata3, etc that you see in the output of the first grep command.

Though that won't show the physical size (2.5/3.5). The lshw command should show model numbers you could google though.

frieza 07-22-2011 03:41 PM

first of all isn't ide/pata the same? you might be able to idenify that by looking in /proc
as for 3.5 2.5? if it's a desktop unit it's more than likely 3.5, if it's a laptop it's more than likely 2.5
as for sata/pata, it depends on how new the machine is, modern machines don't usually ship with pata drives anymore whereas older machines might have pata.

tredegar 07-22-2011 03:48 PM

I don't think drives will report their physical dimensions (as opposed to their storage capacity).

What would be the point of this? You installed it, you should know its physical dimensions. Did it fit into the case?

IDE/SATA/PATA are a bit the same: the OS sees the drive and presents it to you as /dev/whatever so then you can use it.

The nomenclature used to be /dev/hdx but now it seems to be /dev/sdx

IIRC the sd prefix used to designate disks with a SCSI interface but other hardware was eventually presented to the OS as if it was a SCSI disk. With good reason - the SCSI standard was well documented, and worked well.

This is the point of an OS: It presents the hardware you have available in easy to understand and manipulate terms. It might be an ancient ESDI disk, but if the OS puts in enough layers of emulation, it'll behave (mostly) as if it was a SCSI disk.

Why are you asking this question and what is your exact problem?


All times are GMT -5. The time now is 08:47 PM.