


With the rapid development of big data, cloud computing, artificial intelligence and other applications, the demand for storage performance is getting higher and higher. The early SATA interface and AHCI protocol can no longer meet this demand. In recent years, NVMe technology based on the PCIe bus has gradually become the new favorite in the storage industry, with advantages such as high speed, low latency, and high concurrency. This article will explore how to use NVMe technology to improve storage performance in Linux systems.
My laptop has an NVMe drive and so does my desktop. And they're fast. I love how quickly my computers boot up and how quickly they read and write data. There is almost no lag.
It didn’t take long for me to become curious about the technology driving this ultra-fast storage, so I did some research. I learned that NVMe drives consume less power while providing much faster data access than even SATA SSD drives. This is interesting, but I'd like to know more about my specific NVMe drives, and I'd like to know how they differ from other drives. Can I safely erase a drive? How can I check its integrity?
With these questions I searched on the Internet and found an open source project with a series of tools for managing NVMe drives. It's called nvme-cli.
Install nvme-cli
You can install it from your distribution’s package manager
nvme-cli
. For example, on Fedora, CentOS or similar systems:
$ sudo dnf install nvme-cli
On Debian, Mint, Elementary and similar systems:
$ sudo apt install nvme-cli
Exploring NVMe Drives
After installing nvme-cli, I want to explore my drives. nvme-cli does not have a man page, but you can get a lot of help by typing nvme help:
$ nvme help nvme-1.14 usage: nvme [] [] The '' may be either an NVMe character device (ex: /dev/nvme0) or an nvme block device (ex: /dev/nvme0n1). The following are all implemented sub-commands: list List all NVMe devices and namespaces on machine list-subsys List nvme subsystems id-ctrl Send NVMe Identify Controller id-ns Send NVMe Identify Namespace, display structure id-ns-granularity Send NVMe Identify Namespace Granularity List, display structure list-ns Send NVMe Identify List, display structure list-ctrl Send NVMe Identify Controller List, display structure nvm-id-ctrl Send NVMe Identify Controller NVM Command Set, display structure primary-ctrl-caps Send NVMe Identify Primary Controller Capabilities [...]
List all NVMe drives
sudo nvme list command lists all NVMe devices and namespaces on your machine. I used it to find an NVMe drive at /dev/nvme0n1. The following is the command output:
$ sudo nvme list Node SN Model Namespace Usage Format FW Rev --------------------- -------------------- ---------------------------------------- ------- -- -------------------------- ---------------- -------- /dev/nvme0n1 S42GMY9M141281 SAMSUNG MZVLB256HAHQ-000L7 1 214.68 GB / 256.06 GB 512 B + 0 B 0L2QEXD7
I have a drive named nvme0n1. It lists the serial number, brand, capacity, firmware version, and more.
You can get more information about the drive and the features it supports by using the id-ctrl subcommand:
$ sudo nvme id-ctrl /dev/nvme0n1 NVME Identify Controller: vid : 0x144d ssvid : 0x144d sn : S42GMY9M141281 mn : SAMSUNG MZVLB256HAHQ-000L7 fr : 0L2QEXD7 rab : 2 ieee : 002538 cmic : 0 mdts : 9 cntlid : 0x4 ver : 0x10200 rtd3r : 0x186a0 rtd3e : 0x7a1200 [...]
Drive Health
You can understand the overall health of the hard drive through the smart-log subcommand:
$ sudo nvme smart-log /dev/nvme0n1 Smart Log for NVME device:nvme0n1 namespace-id:ffffffff critical_warning : 0 temperature : 21 C available_spare : 100% available_spare_threshold : 10% percentage_used : 2% endurance group critical warning summary: 0 data_units_read : 5,749,452 data_units_written : 10,602,948 host_read_commands : 77,809,121 host_write_commands : 153,405,213 controller_busy_time : 756 power_cycles : 1,719 power_on_hours : 1,311 unsafe_shutdowns : 129 media_errors : 0 num_err_log_entries : 1,243 Warning Temperature Time : 0 Critical Composite Temperature Time : 0 Temperature Sensor 1 : 21 C Temperature Sensor 2 : 22 C Thermal Management T1 Trans Count : 0 Thermal Management T2 Trans Count : 0 Thermal Management T1 Total Time : 0 Thermal Management T2 Total Time : 0
This gives you the current temperature of the drive, usage time to date, number of unsafe shutdowns, and more.
Format an NVMe drive
You can format an NVMe drive with nvme-cli, but be careful. This will delete all data on the drive! If you have important data on your hard drive, you must back it up before doing so, otherwise you will lose your data. The subcommand is format:
$ sudo nvme format /dev/nvme0nX
(Just to be safe, I replaced the actual location of the drive with X to prevent copy-paste errors. Change the X to 1 or the actual location listed in the nvme list results.)
Securely Erase NVMe Drives
When you're preparing to sell or dispose of your NVMe computer, you may want to securely erase the drive. The warnings here are the same as during the formatting process. You must back up important data first, because this command will delete this data!
$ sudo nvme sanitize /dev/nvme0nX
Try nvme-cli
nvme-cli commands are released under the GPLv2 license. It is a powerful command with many useful options for controlling and managing data efficiently.
This article introduces solutions and methods for using NVMe technology to improve storage performance in Linux systems, including using the nvme-cli tool for performance testing, configuration and management operations. Through detailed experimental analysis, it was verified that NVMe technology has a significant effect on improving the storage performance of Linux systems. In the future, driven by the rapid development of NVMe technology, we can see that Linux system storage performance will be improved in more and more application scenarios, providing better performance guarantees for applications such as big data and artificial intelligence.
The above is the detailed content of Looking at the way to improve Linux system storage performance from the rapidly developing NVMe technology. For more information, please follow other related articles on the PHP Chinese website!

linux设备节点是应用程序和设备驱动程序沟通的一个桥梁;设备节点被创建在“/dev”,是连接内核与用户层的枢纽,相当于硬盘的inode一样的东西,记录了硬件设备的位置和信息。设备节点使用户可以与内核进行硬件的沟通,读写设备以及其他的操作。

区别:1、open是UNIX系统调用函数,而fopen是ANSIC标准中的C语言库函数;2、open的移植性没fopen好;3、fopen只能操纵普通正规文件,而open可以操作普通文件、网络套接字等;4、open无缓冲,fopen有缓冲。

端口映射又称端口转发,是指将外部主机的IP地址的端口映射到Intranet中的一台计算机,当用户访问外网IP的这个端口时,服务器自动将请求映射到对应局域网内部的机器上;可以通过使用动态或固定的公共网络IP路由ADSL宽带路由器来实现。

在linux中,eof是自定义终止符,是“END Of File”的缩写;因为是自定义的终止符,所以eof就不是固定的,可以随意的设置别名,linux中按“ctrl+d”就代表eof,eof一般会配合cat命令用于多行文本输出,指文件末尾。

在linux中,可以利用“rpm -qa pcre”命令判断pcre是否安装;rpm命令专门用于管理各项套件,使用该命令后,若结果中出现pcre的版本信息,则表示pcre已经安装,若没有出现版本信息,则表示没有安装pcre。

linux查询mac地址的方法:1、打开系统,在桌面中点击鼠标右键,选择“打开终端”;2、在终端中,执行“ifconfig”命令,查看输出结果,在输出信息第四行中紧跟“ether”单词后的字符串就是mac地址。

在linux中,rpc是远程过程调用的意思,是Reomote Procedure Call的缩写,特指一种隐藏了过程调用时实际通信细节的IPC方法;linux中通过RPC可以充分利用非共享内存的多处理器环境,提高系统资源的利用率。

手机远程linux工具有:1、JuiceSSH,是一款功能强大的安卓SSH客户端应用,可直接对linux服务进行管理;2、Termius,可以利用手机来连接Linux服务器;3、Termux,一个强大的远程终端工具;4、向日葵远程控制等等。


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.