NVMe

From Gentoo Wiki
Jump to:navigation Jump to:search
This article is a stub. You can help by expanding it.

NVM Express (NVMe) devices are flash memory chips connected to a system via the PCI-E bus. They are among the fastest memory chips available on the market, faster than Solid State Drives (SSD) connected over the SATA bus.

Installation

Kernel

NVM Express block device (CONFIG_BLK_DEV_NVME) must be activated to gain NVMe device support:

KERNEL Linux 4.4.x
Device Drivers  --->
  <*> NVM Express block device
KERNEL Linux 5.x.x
Device Drivers →
  NVME Support →
    <*> NVM Express block device

Devices will show up under /dev/nvme*.

These are the defaults on other GNU/Linux distributions.

KERNEL
<*> NVM Express block device
[*] NVMe multipath support
[*] NVMe hardware monitoring
<M> NVM Express over Fabrics FC host driver
<M> NVM Express over Fabrics TCP host driver
<M> NVMe Target support
  [*]   NVMe Target Passthrough support
  <M>   NVMe loopback device support
  <M>   NVMe over Fabrics FC target driver
  < >     NVMe over Fabrics FC Transport Loopback Test driver (NEW)
  <M>   NVMe over Fabrics TCP target support

Configuration

Partition tables and formatting can be performed the same as any other block device. User space tools are available from sys-apps/nvme-cli.

Identifying the device

There are minor differences in the naming scheme for devices and partitions when compared to SATA devices.

NVMe partitions generally show a p before the partition number. NVMe devices also include namespace support, using a n before listing the namespace. Therefore the first device in the first namespace with one partition will be at the following location: /dev/nvme0n1p1. The device name is nvme0, in namespace 1, and partition 1.

Usage

I/O testing

Hdparm can be used to get the raw read/write speed of a NVMe device. Passing the -t option instructs hdparm to perform timings of device reads, -T performs timings of cache reads, and --direct bypasses the page cache and causes reads to go directly from the drive into hdparm's buffers in raw mode:

root #hdparm -tT --direct /dev/nvme0n1

Performance and maintenance

Since NVMe devices share the flash memory technology basis with common SSDs, the same performance and longevity considerations apply. For details consult the SSD article.

See also

  • SSD — provides guidelines for basic maintenance, such as enabling discard/trim support, for SSDs (Solid State Drives) on Linux.

External resources