A quick way to check the type of the drive
Clash Royale CLAN TAG#URR8PPP
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
add a comment |
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
1
Measuring latency is not a good answer as some rotational disks come with huge caches which may or may not be easy to distinguish from full capacity solid state devices.
– anx
Jan 21 at 11:03
2
Along withsmartctl
mentioned here, other utilities such aslshw
andlsblk
report the same information. See also askubuntu.com/q/792814/295286
– Sergiy Kolodyazhnyy
Jan 21 at 15:47
1
what would you use this info for? In other words, if I give you program called isHDDorSSD what will you do with it
– aaaaaa
Jan 21 at 18:18
Bonnie++ can show SSD vs HDD based on IOPS (as can dd)
– warren
Jan 21 at 18:19
@Sergiy Kolodyazhnyy, I've not found such info inlshw
. Alsolsblk
relies onrotational
flag in sysfs directory hence I can't trust it.smartctl
uses ioctl call and asks inforamtion directly from device.
– lesovsky
Jan 21 at 19:32
add a comment |
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
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
linux storage proc
asked Jan 21 at 5:16
lesovskylesovsky
584
584
1
Measuring latency is not a good answer as some rotational disks come with huge caches which may or may not be easy to distinguish from full capacity solid state devices.
– anx
Jan 21 at 11:03
2
Along withsmartctl
mentioned here, other utilities such aslshw
andlsblk
report the same information. See also askubuntu.com/q/792814/295286
– Sergiy Kolodyazhnyy
Jan 21 at 15:47
1
what would you use this info for? In other words, if I give you program called isHDDorSSD what will you do with it
– aaaaaa
Jan 21 at 18:18
Bonnie++ can show SSD vs HDD based on IOPS (as can dd)
– warren
Jan 21 at 18:19
@Sergiy Kolodyazhnyy, I've not found such info inlshw
. Alsolsblk
relies onrotational
flag in sysfs directory hence I can't trust it.smartctl
uses ioctl call and asks inforamtion directly from device.
– lesovsky
Jan 21 at 19:32
add a comment |
1
Measuring latency is not a good answer as some rotational disks come with huge caches which may or may not be easy to distinguish from full capacity solid state devices.
– anx
Jan 21 at 11:03
2
Along withsmartctl
mentioned here, other utilities such aslshw
andlsblk
report the same information. See also askubuntu.com/q/792814/295286
– Sergiy Kolodyazhnyy
Jan 21 at 15:47
1
what would you use this info for? In other words, if I give you program called isHDDorSSD what will you do with it
– aaaaaa
Jan 21 at 18:18
Bonnie++ can show SSD vs HDD based on IOPS (as can dd)
– warren
Jan 21 at 18:19
@Sergiy Kolodyazhnyy, I've not found such info inlshw
. Alsolsblk
relies onrotational
flag in sysfs directory hence I can't trust it.smartctl
uses ioctl call and asks inforamtion directly from device.
– lesovsky
Jan 21 at 19:32
1
1
Measuring latency is not a good answer as some rotational disks come with huge caches which may or may not be easy to distinguish from full capacity solid state devices.
– anx
Jan 21 at 11:03
Measuring latency is not a good answer as some rotational disks come with huge caches which may or may not be easy to distinguish from full capacity solid state devices.
– anx
Jan 21 at 11:03
2
2
Along with
smartctl
mentioned here, other utilities such as lshw
and lsblk
report the same information. See also askubuntu.com/q/792814/295286– Sergiy Kolodyazhnyy
Jan 21 at 15:47
Along with
smartctl
mentioned here, other utilities such as lshw
and lsblk
report the same information. See also askubuntu.com/q/792814/295286– Sergiy Kolodyazhnyy
Jan 21 at 15:47
1
1
what would you use this info for? In other words, if I give you program called isHDDorSSD what will you do with it
– aaaaaa
Jan 21 at 18:18
what would you use this info for? In other words, if I give you program called isHDDorSSD what will you do with it
– aaaaaa
Jan 21 at 18:18
Bonnie++ can show SSD vs HDD based on IOPS (as can dd)
– warren
Jan 21 at 18:19
Bonnie++ can show SSD vs HDD based on IOPS (as can dd)
– warren
Jan 21 at 18:19
@Sergiy Kolodyazhnyy, I've not found such info in
lshw
. Also lsblk
relies on rotational
flag in sysfs directory hence I can't trust it. smartctl
uses ioctl call and asks inforamtion directly from device.– lesovsky
Jan 21 at 19:32
@Sergiy Kolodyazhnyy, I've not found such info in
lshw
. Also lsblk
relies on rotational
flag in sysfs directory hence I can't trust it. smartctl
uses ioctl call and asks inforamtion directly from device.– lesovsky
Jan 21 at 19:32
add a comment |
1 Answer
1
active
oldest
votes
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.
1
Looks good, it works even with drives attached through RAID cards.
– lesovsky
Jan 21 at 6:56
@lesovsky, I wouldn't count on it working through a RAID card. I don't have any SSDs attached to RAID that I can test with, but it shows incorrect rotational rates for the spinning disks (every disk in the array shows up as 10k, when they're all actually 7.2k).
– Mark
Jan 22 at 0:07
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
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.
1
Looks good, it works even with drives attached through RAID cards.
– lesovsky
Jan 21 at 6:56
@lesovsky, I wouldn't count on it working through a RAID card. I don't have any SSDs attached to RAID that I can test with, but it shows incorrect rotational rates for the spinning disks (every disk in the array shows up as 10k, when they're all actually 7.2k).
– Mark
Jan 22 at 0:07
add a comment |
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.
1
Looks good, it works even with drives attached through RAID cards.
– lesovsky
Jan 21 at 6:56
@lesovsky, I wouldn't count on it working through a RAID card. I don't have any SSDs attached to RAID that I can test with, but it shows incorrect rotational rates for the spinning disks (every disk in the array shows up as 10k, when they're all actually 7.2k).
– Mark
Jan 22 at 0:07
add a comment |
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.
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.
answered Jan 21 at 5:31
Janne PikkarainenJanne Pikkarainen
28.1k34067
28.1k34067
1
Looks good, it works even with drives attached through RAID cards.
– lesovsky
Jan 21 at 6:56
@lesovsky, I wouldn't count on it working through a RAID card. I don't have any SSDs attached to RAID that I can test with, but it shows incorrect rotational rates for the spinning disks (every disk in the array shows up as 10k, when they're all actually 7.2k).
– Mark
Jan 22 at 0:07
add a comment |
1
Looks good, it works even with drives attached through RAID cards.
– lesovsky
Jan 21 at 6:56
@lesovsky, I wouldn't count on it working through a RAID card. I don't have any SSDs attached to RAID that I can test with, but it shows incorrect rotational rates for the spinning disks (every disk in the array shows up as 10k, when they're all actually 7.2k).
– Mark
Jan 22 at 0:07
1
1
Looks good, it works even with drives attached through RAID cards.
– lesovsky
Jan 21 at 6:56
Looks good, it works even with drives attached through RAID cards.
– lesovsky
Jan 21 at 6:56
@lesovsky, I wouldn't count on it working through a RAID card. I don't have any SSDs attached to RAID that I can test with, but it shows incorrect rotational rates for the spinning disks (every disk in the array shows up as 10k, when they're all actually 7.2k).
– Mark
Jan 22 at 0:07
@lesovsky, I wouldn't count on it working through a RAID card. I don't have any SSDs attached to RAID that I can test with, but it shows incorrect rotational rates for the spinning disks (every disk in the array shows up as 10k, when they're all actually 7.2k).
– Mark
Jan 22 at 0:07
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
1
Measuring latency is not a good answer as some rotational disks come with huge caches which may or may not be easy to distinguish from full capacity solid state devices.
– anx
Jan 21 at 11:03
2
Along with
smartctl
mentioned here, other utilities such aslshw
andlsblk
report the same information. See also askubuntu.com/q/792814/295286– Sergiy Kolodyazhnyy
Jan 21 at 15:47
1
what would you use this info for? In other words, if I give you program called isHDDorSSD what will you do with it
– aaaaaa
Jan 21 at 18:18
Bonnie++ can show SSD vs HDD based on IOPS (as can dd)
– warren
Jan 21 at 18:19
@Sergiy Kolodyazhnyy, I've not found such info in
lshw
. Alsolsblk
relies onrotational
flag in sysfs directory hence I can't trust it.smartctl
uses ioctl call and asks inforamtion directly from device.– lesovsky
Jan 21 at 19:32