LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 07-22-2011, 03:24 PM   #1
MikeyCarter
Member
 
Registered: Feb 2003
Location: Orangeville
Distribution: Fedora
Posts: 443

Rep: Reputation: 31
Question 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
 
Old 07-22-2011, 03:38 PM   #2
pljvaldez
Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Squeeze (x86)
Posts: 6,092

Rep: Reputation: 269Reputation: 269Reputation: 269
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.

Last edited by pljvaldez; 07-22-2011 at 03:39 PM.
 
Old 07-22-2011, 03:41 PM   #3
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,062

Rep: Reputation: 362Reputation: 362Reputation: 362Reputation: 362
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.
 
Old 07-22-2011, 03:48 PM   #4
tredegar
Guru
 
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 6,007

Rep: Reputation: 366Reputation: 366Reputation: 366Reputation: 366
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?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Move a Windows XP system from IDE (PATA) to SATA pnellesen General 1 12-20-2009 05:22 AM
SATA and PATA keep switching drive alias Scruff Linux - Hardware 9 04-07-2009 12:34 PM
kernel accessing pata cd rom drive instead of sata OS hard drive for filesystem elaps2007 Linux - Kernel 0 03-19-2008 09:39 AM
sr_mod for dvd drive to use ide-cd of old pata driver set-howto deepclutch Linux - Hardware 5 11-16-2007 04:33 AM
SATA + PATA IDE Drives Not Playing Nice Together Mahonri Linux - Hardware 5 05-22-2007 04:40 PM


All times are GMT -5. The time now is 08:18 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration