LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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: 492

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
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 281Reputation: 281Reputation: 281
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,233

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
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
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:02 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration