Problems with the command which makes you know if the hard disk is hdd or ssd

I want to have a script which tells me what sort of disk I have on my laptop.

I have found a command used how to know if my disk is a ssd or hdd i.e. :

cat /sys/block/sda/queue/rotational

unfortunately I get:

cat: /sys/block/sda/queue/rotational: No such file or directory

my ubuntu version is 20.10.

EDIT: the command:

lsblk | grep disk

gives

nvme0n1 259:0 0 476,9G 0 disk

Is there another command related to my issue?

1

1 Answer

Your output of lsblk shows that your device is called nvme0n1 instead of sda.

Try:

cat /sys/block/nvme0n1/queue/rotational
  • 0 = not rotational = SSD
  • 1 = rotational = HDD
1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like