LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 07-26-2021, 01:39 AM   #1
peterdin
LQ Newbie
 
Registered: Oct 2013
Posts: 21

Rep: Reputation: Disabled
Question How to check if disk attached to Linux OS is SSD or SATA?


Dear All,

Good Day!

OS Version is Red Hat Enterprise Linux Server release 7.1

1.How to check if disk attached to Linux OS is SSD or SATA?

2.How to check , how many Local disks are available excluding LUN mapped from storage end.

Thanks
 
Old 07-26-2021, 02:32 AM   #2
obobskivich
Member
 
Registered: Jun 2020
Posts: 596

Rep: Reputation: Disabled
1. If you mean 'NVMe' by SSD, they will show up as /dev/nvme as opposed to /dev/sd as block devices, unless they're all hidden behind a RAID controller or somesuch (won't apply to NVMe of course). SSDs can be SATA devices too, however, so there'd be no way (other than to observe its performance or physically check the device or dump its information and then google whatever you get) to verify mechanical drive vs SSD programatically.

2. Does lsblk do what you want?
 
Old 07-26-2021, 02:49 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Quote:
Originally Posted by obobskivich View Post
... so there'd be no way (other than to observe its performance or physically check the device or dump its information and then google whatever you get) to verify mechanical drive vs SSD programatically.
It rarely pays to be so dogmatic with Linux.
Code:
cat /sys/block/sd?/queue/rotational
"1" means yes, "0" no. There are a few edge cases (USB flash e.g.) but there are also other solutions that might need some parsing - SMART e.g.
 
Old 07-26-2021, 08:28 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by peterdin View Post
Dear All, Good Day!
OS Version is Red Hat Enterprise Linux Server release 7.1

1.How to check if disk attached to Linux OS is SSD or SATA?
2.How to check , how many Local disks are available excluding LUN mapped from storage end.
Have you done ANY research at all? Identify HDD vs SSD and get model #
Code:
lsblk -d -e 7 -o NAME,ROTA,DISC-MAX,MODEL
RAID devices will tell you they're LVM's. Using lspci and lshw will let you find more. Feel free to look at the man pages for those commands.
 
Old 07-26-2021, 09:48 AM   #5
obobskivich
Member
 
Registered: Jun 2020
Posts: 596

Rep: Reputation: Disabled
Quote:
Originally Posted by syg00 View Post
It rarely pays to be so dogmatic with Linux.
Code:
cat /sys/block/sd?/queue/rotational
"1" means yes, "0" no. There are a few edge cases (USB flash e.g.) but there are also other solutions that might need some parsing - SMART e.g.

Yeah my reasoning is basically in-line with your answer here - 'other solutions that might need some parsing' - you can get linux (or whatever other OS, or the system BIOS/UEFI) to spit out a full model # on some level and that will be absolutely definitive once resolved back to the manufacturer specs. I wouldn't (personally) trust any system to make a 'guess' as to a drive being 'rotational' or 'not' (to my understanding this is based on a lookup of the device ID, right?) as the absolute final word (even if it works 99% of the time) specifically because of the aforesaid corner cases (including SSHDs and other hybrid solutions, as well as devices being potentially abstracted by controllers (e.g. as here: https://unix.stackexchange.com/quest...ational-should)). I don't see that as 'dogmatic' but whatever blows your hair back I guess...
 
Old 07-28-2021, 12:17 AM   #6
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,809
Blog Entries: 1

Rep: Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066
Another option:
Code:
# inxi -dayz
Drives:
  Local Storage: total: raw: 1.93 TiB usable: 1.03 TiB
  used: 694.97 GiB (66.0%)
  ID-1: /dev/sda maj-min: 8:0 vendor: PNY model: CS900 120GB SSD
  size: 111.79 GiB block-size: physical: 512 B logical: 512 B sata: 3.2
  speed: 6.0 Gb/s rotation: SSD serial: <filter> rev: 0613 temp: 33 C
  scheme: MBR
  SMART: yes state: enabled health: PASSED on: 370d 5h cycles: 43
  written: 242 KiB
  ID-2: /dev/sdb maj-min: 8:16 vendor: Hitachi model: HUA722010CLA331
  family: Ultrastar A7K2000 size: 931.51 GiB block-size: physical: 512 B
  logical: 512 B sata: 2.6 speed: 3.0 Gb/s rotation: 7200 rpm serial: <filter>
  rev: A3NH temp: 32 C scheme: GPT
  SMART: yes state: enabled health: PASSED on: 2y 324d 23h cycles: 93
  Pre-Fail: reallocated sector: 100 threshold: 5
  ID-3: /dev/sdc maj-min: 8:32 vendor: Seagate model: ST1000DM003-1CH162
  family: Barracuda 7200.14 (AF) size: 931.51 GiB block-size: physical: 4096 B
  logical: 512 B sata: 3.1 speed: 3.0 Gb/s rotation: 7200 rpm serial: <filter>
  rev: CC49 temp: 31 C scheme: GPT
  SMART: yes state: enabled health: PASSED on: 112d 23h cycles: 15
  read: 18.06 TiB written: 1.52 TiB Pre-Fail: attribute: Spin_Retry_Count
  value: 100 worst: 100 threshold: 97
  Optical-1: /dev/sr0 vendor: ASUS model: DRW-24B1ST j rev: 1.11
  dev-links: cdrom,cdrw,dvd,dvdrw
  Features: speed: 48 multisession: yes audio: yes dvd: yes
  rw: cd-r,cd-rw,dvd-r state: running
 
  


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
Sata 3 SSD vs PCI-E SSD (DELL 5520 laptop) my.forums Linux - Hardware 3 07-08-2016 05:08 PM
Fastest SATA SSD or pair of RAID 0 SSD's under aprox $200 Ulysses_ Linux - Hardware 1 03-26-2016 09:45 AM
Access To Encrypted SSD Partition With Native Password in SSD>SATA Enclosure skidvicious Linux - Hardware 5 12-03-2015 04:40 PM
pl2303 attached to ttyUSB0 but driver attached to device is "serial" sheeluh Linux - Software 4 03-12-2007 04:27 AM
How can I say mouse is attached or not attached at the serial port ? lovelylinux Linux - Hardware 1 02-07-2007 09:44 AM

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

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