A quick way to check the type of the drive












4















Is there a quick way to understand a type of the "storage" on Linux? Is it a HDD or SSD (or NVMe)?
It's already known that the host is a physical machine and not a VM.
The first thing I though about was rotational flag under /sys/block/<device>/queue/ directory. But in my experience even for SSD devices it may contain "1" value.
The second way and more realistic and truthful was a latency. It's a bit harder to measure (some work with /proc/diskstats), but looks more preferable.



Is there any other ways? It's important to mention that I don't need to know exact model of the "storage", just its type.










share|improve this question



























    4















    Is there a quick way to understand a type of the "storage" on Linux? Is it a HDD or SSD (or NVMe)?
    It's already known that the host is a physical machine and not a VM.
    The first thing I though about was rotational flag under /sys/block/<device>/queue/ directory. But in my experience even for SSD devices it may contain "1" value.
    The second way and more realistic and truthful was a latency. It's a bit harder to measure (some work with /proc/diskstats), but looks more preferable.



    Is there any other ways? It's important to mention that I don't need to know exact model of the "storage", just its type.










    share|improve this question

























      4












      4








      4








      Is there a quick way to understand a type of the "storage" on Linux? Is it a HDD or SSD (or NVMe)?
      It's already known that the host is a physical machine and not a VM.
      The first thing I though about was rotational flag under /sys/block/<device>/queue/ directory. But in my experience even for SSD devices it may contain "1" value.
      The second way and more realistic and truthful was a latency. It's a bit harder to measure (some work with /proc/diskstats), but looks more preferable.



      Is there any other ways? It's important to mention that I don't need to know exact model of the "storage", just its type.










      share|improve this question














      Is there a quick way to understand a type of the "storage" on Linux? Is it a HDD or SSD (or NVMe)?
      It's already known that the host is a physical machine and not a VM.
      The first thing I though about was rotational flag under /sys/block/<device>/queue/ directory. But in my experience even for SSD devices it may contain "1" value.
      The second way and more realistic and truthful was a latency. It's a bit harder to measure (some work with /proc/diskstats), but looks more preferable.



      Is there any other ways? It's important to mention that I don't need to know exact model of the "storage", just its type.







      linux storage proc






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 2 hours ago









      lesovskylesovsky

      314




      314






















          2 Answers
          2






          active

          oldest

          votes


















          2














          How about something like sudo smartctl -a /dev/<device> | grep Rotation -- if this returns Rotation Rate: Solid State Device, then that's an SSD. Not sure if this bullet-proof method, either.






          share|improve this answer



















          • 1





            Looks good, it works even with drives attached through RAID cards.

            – lesovsky
            42 mins ago



















          1














          A simple command:



          sudo lshw -c disk





          share|improve this answer
























          • Also looks interesting, but output of lshw doesn't show explicit info about "rotational" capability. I can make a conslusion using sector size value but it's indirect sign

            – lesovsky
            36 mins ago











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "2"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f950004%2fa-quick-way-to-check-the-type-of-the-drive%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          How about something like sudo smartctl -a /dev/<device> | grep Rotation -- if this returns Rotation Rate: Solid State Device, then that's an SSD. Not sure if this bullet-proof method, either.






          share|improve this answer



















          • 1





            Looks good, it works even with drives attached through RAID cards.

            – lesovsky
            42 mins ago
















          2














          How about something like sudo smartctl -a /dev/<device> | grep Rotation -- if this returns Rotation Rate: Solid State Device, then that's an SSD. Not sure if this bullet-proof method, either.






          share|improve this answer



















          • 1





            Looks good, it works even with drives attached through RAID cards.

            – lesovsky
            42 mins ago














          2












          2








          2







          How about something like sudo smartctl -a /dev/<device> | grep Rotation -- if this returns Rotation Rate: Solid State Device, then that's an SSD. Not sure if this bullet-proof method, either.






          share|improve this answer













          How about something like sudo smartctl -a /dev/<device> | grep Rotation -- if this returns Rotation Rate: Solid State Device, then that's an SSD. Not sure if this bullet-proof method, either.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 2 hours ago









          Janne PikkarainenJanne Pikkarainen

          28k33966




          28k33966








          • 1





            Looks good, it works even with drives attached through RAID cards.

            – lesovsky
            42 mins ago














          • 1





            Looks good, it works even with drives attached through RAID cards.

            – lesovsky
            42 mins ago








          1




          1





          Looks good, it works even with drives attached through RAID cards.

          – lesovsky
          42 mins ago





          Looks good, it works even with drives attached through RAID cards.

          – lesovsky
          42 mins ago













          1














          A simple command:



          sudo lshw -c disk





          share|improve this answer
























          • Also looks interesting, but output of lshw doesn't show explicit info about "rotational" capability. I can make a conslusion using sector size value but it's indirect sign

            – lesovsky
            36 mins ago
















          1














          A simple command:



          sudo lshw -c disk





          share|improve this answer
























          • Also looks interesting, but output of lshw doesn't show explicit info about "rotational" capability. I can make a conslusion using sector size value but it's indirect sign

            – lesovsky
            36 mins ago














          1












          1








          1







          A simple command:



          sudo lshw -c disk





          share|improve this answer













          A simple command:



          sudo lshw -c disk






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 42 mins ago









          d a i s yd a i s y

          1741214




          1741214













          • Also looks interesting, but output of lshw doesn't show explicit info about "rotational" capability. I can make a conslusion using sector size value but it's indirect sign

            – lesovsky
            36 mins ago



















          • Also looks interesting, but output of lshw doesn't show explicit info about "rotational" capability. I can make a conslusion using sector size value but it's indirect sign

            – lesovsky
            36 mins ago

















          Also looks interesting, but output of lshw doesn't show explicit info about "rotational" capability. I can make a conslusion using sector size value but it's indirect sign

          – lesovsky
          36 mins ago





          Also looks interesting, but output of lshw doesn't show explicit info about "rotational" capability. I can make a conslusion using sector size value but it's indirect sign

          – lesovsky
          36 mins ago


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Server Fault!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f950004%2fa-quick-way-to-check-the-type-of-the-drive%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Fluorita

          Hulsita

          Península de Txukotka