Categories
Uncategorized

Check Harddrive is SATA or SSD – Shell Script

vim check.sh

 

paste below code

#!/bin/bash

ssdnp=$(cat /sys/block/sda/queue/rotational)
htnm=$(hostname)
if [ "$ssdnp" -eq 0 ]
then
echo "$htnm SSD"

else
echo "$htnm SATA"
fi

then

bash check.sh

 

Categories
Uncategorized

Check hard-drive is SSD or not – Linux

Run below command via CLI
cat /sys/block/sda/queue/rotational
If you get 0 its SSD, if 1 its not.