Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • 3
    That utility seems to report the same information as in /sys/block/.../rotational.
    – dma_k
    Commented Oct 20, 2015 at 10:45
  • @dma_k Little wonder, considering it appears to use that one. Try it yourself: strace lsblk -d -o name,rota /dev/sda 2>&1 | grep --context=3 --color rotational
    – user
    Commented May 13, 2016 at 16:30
  • 5
    Actually I was looking into various ways because some USB controllers don't tell that drive is actually non-rotational (for example, USB flash) and there is no way in Linux to tell the truth. At the end of the day I have fixed that by creating the explicit rule in /etc/udev/rules.d/90-non-rotational.rules: ACTION=="add|change", SUBSYSTEMS=="usb", ENV{ID_SERIAL}=="SanDisk_Ultra_Fit_*-0:0", ATTR{queue/rotational}="0", ATTR{queue/scheduler}="deadline"
    – dma_k
    Commented Jun 8, 2016 at 18:01
  • 1
    lsblk reports "0" for all my good old SATA spinning HDDs here (ASROCK mobo). « some USB controllers don't tell that drive is actually non-rotational (for example, USB flash) » @dma_k this is so true --and better this way than the other way for USB wired external spinning HDDs IMHA.
    – tuk0z
    Commented Sep 14, 2016 at 20:45
  • 4
    This works best for me, but it includes redundant/unwanted loop devices (e.g. due to Ubuntu snaps). A slight improvement is: lsblk -d -e 7 -o NAME,ROTA,DISC-MAX,MODEL which excludes loop devices + adds the model name (manufacturer) and disk capacity.
    – arielf
    Commented Jan 28, 2020 at 16:01