{"id":2741,"date":"2023-12-15T07:33:25","date_gmt":"2023-12-15T12:33:25","guid":{"rendered":"https:\/\/www.both.org\/?p=2741"},"modified":"2023-12-15T07:33:26","modified_gmt":"2023-12-15T12:33:26","slug":"getting-the-most-out-of-your-nvme-drives","status":"publish","type":"post","link":"https:\/\/www.both.org\/?p=2741","title":{"rendered":"Getting the most out of your NVME drives"},"content":{"rendered":"<div class=\"pld-like-dislike-wrap pld-template-1\">\r\n    <div class=\"pld-like-wrap  pld-common-wrap\">\r\n    <a href=\"javascript:void(0)\" class=\"pld-like-trigger pld-like-dislike-trigger  \" title=\"\" data-post-id=\"2741\" data-trigger-type=\"like\" data-restriction=\"cookie\" data-already-liked=\"0\">\r\n                        <i class=\"fas fa-thumbs-up\"><\/i>\r\n                <\/a>\r\n    <span class=\"pld-like-count-wrap pld-count-wrap\">    <\/span>\r\n<\/div><\/div>\n<p>My laptops are equipped with NVMe drives, which impress me with their incredible speed. I&#8217;m delighted by the lightning-fast boot times and seamless data read and write operations without noticeable delays.<\/p>\n\n\n\n<p>As my fascination grew, I explored the technology behind this blazing-fast storage. After a bit of research, I discovered that NVMe drives offer exceptional speed and consume less power than traditional SSD drives using SATA connections. The efficiency intrigued me, but I wanted to delve deeper into the specifics of my NVMe drives and compare them with other options. I had questions about securely erasing the drive and ensuring its integrity.<\/p>\n\n\n\n<p>A quick internet search led me to the perfect solution\u2014an open-source project called &#8220;nvme-cli.&#8221; This collection of tools provides comprehensive management capabilities for NVMe drives, offering me the functionality I sought and more.<\/p>\n\n\n\n<p>You can install &#8216;nvme-cli&#8217; on your Linux system easily from the command line<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"install-nvme-cli\">Install nvme-cli<\/h3>\n\n\n\n<p>You can install&nbsp;<code>nvme-cli<\/code>&nbsp;from your distribution&#8217;s package manager. For instance, on Fedora, CentOS, or similar:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo dnf install nvme-cli<\/code><\/pre>\n\n\n\n<p>On Debian, Mint, Elementary, and similar:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo apt install nvme-cli<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"getting-help\">Getting help<\/h3>\n\n\n\n<p>After installing&nbsp;<code>nvme-cli<\/code>&nbsp;for my distribution, I wanted to explore my drive. There&#8217;s no man page for&nbsp;<code>nvme-cli<\/code>, but you can get lots of help by entering&nbsp;<code>'nvme help'<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>don@pop-os:~$ nvme help\nnvme-1.16\nusage: nvme &lt;command&gt; &#91;&lt;device&gt;] &#91;&lt;args&gt;]\n\nThe '&lt;device&gt;' may be either an NVMe character device (ex: \/dev\/nvme0) or an\nnvme block device (ex: \/dev\/nvme0n1).<\/code><\/pre>\n\n\n\n<p>The&nbsp;<code>sudo nvme list<\/code>&nbsp;command lists all NVMe devices and namespaces on your machine. I used it and found an NVMe drive at&nbsp;<code>\/dev\/nvme0n1<\/code>. Here is the output:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>don@pop-os:~$ sudo nvme list\n&#91;sudo] password for don: \nNode                  SN                   Model                                    Namespace Usage                      Format           FW Rev  \n--------------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- --------\n\/dev\/nvme0n1          ASB3N553810103J14    SK hynix PC711 HFS001TDE9X073N           1           1.02  TB \/   1.02  TB    512   B +  0 B   HPS0    <\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"drive-information\">Drive information<\/h3>\n\n\n\n<p>You can get even more information about the drive and the features it supports by using the&nbsp;<code>id-ctrl<\/code>&nbsp;subcommand:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>don@pop-os:~$ sudo nvme id-ctrl \/dev\/nvme0n1\nNVME Identify Controller:\nvid       : 0x1c5c\nssvid     : 0x1c5c\nsn        : ASB3N553810103J14   \nmn        : SK hynix PC711 HFS001TDE9X073N          \nfr        : HPS0    \nrab       : 3\nieee      : ace42e\ncmic      : 0\nmdts      : 6<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"drive-health\">Drive health<\/h3>\n\n\n\n<p>You can read about the overall health of a drive with the&nbsp;<code>smart-log<\/code>&nbsp;subcommand<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>don@pop-os:~$ sudo nvme smart-log  \/dev\/nvme0n1\nSmart Log for NVME device:nvme0n1 namespace-id:ffffffff\ncritical_warning            : 0\ntemperature                : 29 C (302 Kelvin)\navailable_spare                : 100%\navailable_spare_threshold        : 5%\npercentage_used                : 0%\nendurance group critical warning summary: 0\ndata_units_read                : 8,524,708\ndata_units_written            : 5,777,269<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"format-your-drive\">Format your drive<\/h3>\n\n\n\n<p>Caution must be exercised when using &#8216;nvme-cli format&#8217; an NVMe drive, as this action will result in the complete erasure of all data on the drive. Therefore, it is crucial to back up any essential data before proceeding with the formatting process to avoid permanent data loss<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nvme format \/dev\/nvme0nx<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"securely-erase-your-drive\">Securely erase your drive<\/h3>\n\n\n\n<p>When the time comes to sell or dispose of your NVMe computer, securely erasing the drive becomes a priority. As with the formatting process, it is essential to heed the same warnings here: make sure to back up any crucial data before initiating this command, as it will erase all the data on the drive<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo nvme sanitize \/dev\/nvme0nx<\/code><\/pre>\n\n\n\n<p>Nvme-cli is openly <a href=\"https:\/\/github.com\/linux-nvme\/nvme-cli\/blob\/master\/LICENSE\">licensed<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>My laptops are equipped with NVMe drives, which impress me with their incredible speed. I&rsquo;m delighted by the lightning-fast boot times and seamless data read and write operations without noticeable delays. As my fascination grew, I explored the technology behind this blazing-fast storage. After a bit of research, I discovered that NVMe drives offer exceptional [&hellip;]<\/p>\n","protected":false},"author":32,"featured_media":2746,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[100,5],"tags":[104,91,103,97],"class_list":["post-2741","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-command-line","category-linux","tag-command-line","tag-linux","tag-nvme","tag-sysadmin"],"modified_by":"David Both","_links":{"self":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/2741","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/users\/32"}],"replies":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2741"}],"version-history":[{"count":1,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/2741\/revisions"}],"predecessor-version":[{"id":2742,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/2741\/revisions\/2742"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/media\/2746"}],"wp:attachment":[{"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2741"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2741"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2741"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}