LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 10-20-2011, 03:04 PM   #1
Claxton
LQ Newbie
 
Registered: Sep 2011
Posts: 16

Rep: Reputation: Disabled
SSD vs. HDD


Hello

Any efficient way on knowing whether my PC contains an SSD or an HDD?
Can linux differentiate between the 2?

Thanks
 
Old 10-20-2011, 03:19 PM   #2
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
You can get hardware info from your server with
Code:
$ lshw
command:
then find the hard drives info and google for the string from the output you get:
Code:
*-disk
          product: FUJITSU MPC3064AT   <--- for example this
          vendor: Fujitsu
          physical id: 0
          bus info: ide@0.0
          logical name: /dev/hda
          capacity: 6187MiB (6488MB)
google gives: Hard Drives ATA - IDE 6GB-5400RPM means it's a hard drive with platters at 5400RPM
SSD don't have it.

I hope this helps you.
 
Old 10-20-2011, 03:25 PM   #3
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,962
Blog Entries: 46

Rep: Reputation: 3188Reputation: 3188Reputation: 3188Reputation: 3188Reputation: 3188Reputation: 3188Reputation: 3188Reputation: 3188Reputation: 3188Reputation: 3188Reputation: 3188
Hi,

Welcome to LQ!

Quote:
Originally Posted by Claxton View Post
Hello

Any efficient way on knowing whether my PC contains an SSD or an HDD?
Can linux differentiate between the 2?

Thanks
Quote:
form 'man lsscsi;
lsscsi - list SCSI devices (or hosts) and their attributes

SYNOPSIS
lsscsi [--classic] [--device] [--generic] [--help] [--hosts] [--kname] [--list] [--long] [--pro-
tection] [--transport] [--verbose] [--version] [H:C:T:L]

DESCRIPTION
Uses information in sysfs (linux kernel series 2.6 and later) to list scsi devices (or hosts)
currently attached to the system. Options can be used to control the amount and form of informa-
tion provided for each device.

If a H:C:T:L argument is given then it acts as a filter and only devices that match it are
listed. The colons don't have to be present, and '-', '*', '?' or missing arguments at the end
are interpreted as wildcards. '-' needs to stand alone or else it is taken as the beginning of an
option (e.g. '-:-:-:-' is illegal). '*' needs to be escaped from the shell. A leading '[' and
trailing ']' are permitted (e.g. '[1:0:0]' matches all luns on 1:0:0). May also be used to filter
--hosts in which case only the H is active and may be either a number or in the form "host<n>"
where <n> is a host number.

By default in this utility device node names (e.g. "/dev/sda" or "/dev/root_disk") are obtained
by noting the major and minor numbers for the listed device obtained from sysfs (e.g. the con-
tents of "/sys/block/sda/dev") and then looking for a match in the "/dev" directory. This "match
by major and minor" will allow devices that have been given a different name by udev (for exam-
ple) to be correctly reported by this utility.

In some situations it may be useful to see the device node name that linux would produce by
default, so the --kname option is provided. An example of where this may be useful is kernel
error logs which tend to report disk error messages using the disk's default kernel name.

Information about this utility including examples can also be found at:
http://sg.danny.cz/scsi/lsscsi.html .
My output;
Quote:
~# lsscsi
[0:0:0:0] disk ATA INTEL SSDSA2M040 2CV1 /dev/sda
[4:0:0:0] cd/dvd HL-DT-ST DVD+-RW GSA-T11N A102 /dev/sr0
[6:0:0:0] disk WDC WD50 00BEVT-22A0RT0 /dev/sdb
~# lsscsi -d
[0:0:0:0] disk ATA INTEL SSDSA2M040 2CV1 /dev/sda [8:0]
[4:0:0:0] cd/dvd HL-DT-ST DVD+-RW GSA-T11N A102 /dev/sr0 [11:0]
[6:0:0:0] disk WDC WD50 00BEVT-22A0RT0 /dev/sdb [8:16]
Obviously my SSD is /dev/sda'. Which is a Intel SSD within this laptop.
 
Old 10-20-2011, 03:26 PM   #4
Claxton
LQ Newbie
 
Registered: Sep 2011
Posts: 16

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by lithos View Post
You can get hardware info from your server with
Code:
$ lshw
command:
then find the hard drives info and google for the string from the output you get:
Code:
*-disk
          product: FUJITSU MPC3064AT   <--- for example this
          vendor: Fujitsu
          physical id: 0
          bus info: ide@0.0
          logical name: /dev/hda
          capacity: 6187MiB (6488MB)
google gives: Hard Drives ATA - IDE 6GB-5400RPM means it's a hard drive with platters at 5400RPM
SSD don't have it.

I hope this helps you.
yes that is a way, but I need to do this within a shell script a it needs to determine the drive type without google, no internet connection. Can linux do it by itself using any other command hdparm or sdparm ?
 
Old 10-20-2011, 03:28 PM   #5
Claxton
LQ Newbie
 
Registered: Sep 2011
Posts: 16

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by onebuck View Post
Hi,

Welcome to LQ!



My output;Obviously my SSD is /dev/sda'. Which is a Intel SSD within this laptop.
Thank you this lssci command is probably what I need, will look into it!
 
Old 10-20-2011, 10:09 PM   #6
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,183

Rep: Reputation: 3647Reputation: 3647Reputation: 3647Reputation: 3647Reputation: 3647Reputation: 3647Reputation: 3647Reputation: 3647Reputation: 3647Reputation: 3647Reputation: 3647
Bios may contain info.
 
Old 10-20-2011, 11:21 PM   #7
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 193Reputation: 193
Quote:
Originally Posted by Claxton View Post
Thank you this lssci command is probably what I need, will look into it!
As I understand it, lsscsi will only give you the model of the drive.

For example:
Code:
fukawi1 ~ # lsscsi 
[2:0:0:0]    cd/dvd  TSSTcorp CDDVDW SH-S223C  SB02  /dev/sr0 
[2:0:1:0]    disk    ATA      TOSHIBA THNS064G AGTA  /dev/sda 
[3:0:1:0]    disk    ATA      SAMSUNG SP2504C  VT10  /dev/sdb
Doesn't specifiy that /dev/sda is an SSD drive, and /dev/sdb is HDD.

This may be a hacky way of doing it via a script, but, perhaps using hdparm -t:
Code:
fukawi1 ~ # hdparm -t /dev/sda1

/dev/sda1:
 Timing buffered disk reads: 128 MB in  0.69 seconds = 184.36 MB/sec
fukawi1 ~ # hdparm -t /dev/sdb1

/dev/sdb1:
 Timing buffered disk reads: 218 MB in  3.02 seconds =  72.22 MB/sec
combined with grep + awk
Code:
fukawi1 ~ # hdparm -t /dev/sda | grep Timing | awk ' {print $11 }'
140.47
and then an if <= $fastestHDDspeed then its not ssd.

Thats probably not particularly accurate, since there may be a blurred line between HDD speeds, and older/slower SSD speeds, and Im sure there is an easier(better?) way to do it, but I am known for doing things the hard way
 
  


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
Built-in HDD/SSD password for toshiba NB205 jre583 Linux - Newbie 12 02-11-2015 01:31 PM
Do SSD drive create substantially less heat than HDD? rblampain Linux - Hardware 3 08-22-2010 06:45 PM
[SOLVED] What store device is more durable these days - HDD or SSD? Mr. Alex Linux - Hardware 4 06-07-2010 04:46 PM
SSD's a reasonable replacement for HDD on a desktop? drmjh Linux - Hardware 10 01-17-2010 06:25 PM
[SOLVED] Using both SSD/HDD for partitioning or is it better to just get external HDD? Switch7 Linux - Hardware 16 10-26-2009 01:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 04:57 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