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

 

Leave a Reply