My VPS is attached to an SSD, but when checking the drive it says Rotational... Will that get fixed?

When I check whether one of my server’s storage device is an HDD or an SSD, I use the following commands:

Step 1. Get device major:minor numbers:

$ stat /path/to/some/file/on/device
Device: fd00h/64768d

Step 2. Use the device numbers to find the device under /sys:

$ ls -l /sys/dev/block/7:26
lrwxrwxrwx 1 root root 0 Apr 15 07:25 /sys/dev/block/7:26 -> ../../devices/virtual/block/loop26

where 7 is the major device number and 26 is the minor. From the above numbers, you can compute these using:

$ expr 64768 / 256              # major
$ expr 64768 % 256              # minor

Step 3. Find the rotational file

Now, if I look at the ../../devices/virtual/block/loop26 folder, I can search and find a rotational file. But first I rebuild the path properly. This means I want a full path rather than a relative path. As we can see, there are two .. which means we go up two directories. The result is:


Lets look inside that folder:

$ ls /sys/devices/virtual/block/loop26

We see a queue sub-directory, let’s look inside:

$ ls /sys/devices/virtual/block/loop26/queue

The rotational file exists, let’s print the content:

$ cat /sys/devices/virtual/block/loop26/queue/rotational

The loop device is considered to be a rotational (HDD) device!

IMPORTANT NOTE: In some cases, the queue sub-directory is one or two directories up. So the first ls command may not show it. Try again after removing one sub-directory in your path. Repeat until you find a queue sub-directory or the path is only 3 segments (/sys/devices/virtual in my example).

So now I have a way to check the rotational file. When I test against my SSD drives on my server at home, I get 0 as expected. The disk is not rotational.

When I check on DigitalOcean, I get a 1 as if the drive in my VPS was a rotational (HDD) file. It should return 0. Just in case, I tested in VirtualBox on my server, and I get the same effect. If I create a disk in my VirtualBox server which is on an SSD, it does not recognize it as an SSD within VirtualBox. So I am thinking that both systems are using the same driver to simulate hard drives within the VPS…

Are there plans to fix this issue at DigitalOcean? I would need to know whether drive A is SSD or HDD and drive B is SSD or HDD and I would prefer not to have to indicate that information manually since this is prone to mistakes over time.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

I received an email suggesting to post a suggestion on the “ideas” website. Here is a link to that post:

Bobby Iliev
Site Moderator
Site Moderator badge
May 10, 2023

Hey there,

You’re correct that the method you’re using to check whether the storage device is an HDD or SSD might not work correctly in virtualized environments such as DigitalOcean or VirtualBox. Virtual machines are provided with virtual disks, which may not accurately report the underlying physical disk’s characteristics.

DigitalOcean uses SSDs for all its droplets, so you can be confident that your droplet is using SSD storage. You can find this information on the DigitalOcean product documentation.

In virtualized environments, it is generally not practical for the virtual machines to directly access information about the underlying hardware. The hypervisor abstracts the hardware, and virtual machines work with the virtualized resources provided by the hypervisor. This abstraction layer is necessary for features like live migration and hardware independence.

If you need to differentiate between SSD and HDD storage for specific application requirements, you can either hardcode this information in your application’s configuration or use environment variables or other configuration methods to provide this information to your application.

My guess would be that there might not be plans to fix this issue at DigitalOcean, but you can safely assume that all storage provided by DigitalOcean droplets is SSD-based.

In case this is a blocker for you, it might be best to reach out to the DigitalOcean support team who will be able to provide you with more information about it:

Hope that this helps!

- Bobby.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

card icon
Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Sign up
card icon
Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We’d like to help.

Learn more
card icon
Become a contributor

You get paid; we donate to tech nonprofits.

Learn more
Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow – whether you’re running one virtual machine or ten thousand.

Learn more ->
DigitalOcean Cloud Control Panel