How to use

To use an Open-Channel SSD, support in the operating system kernel is required. The Linux kernel has support since the LightNVM subsystem was introduced in version 4.4. As the project is under development, it is preferred to use the latest available kernel. You'll need the the following to get going:

Linux kernel 4.12+

Latest nvme-cli

qemu with Open-Channel support (optional)

Install Linux Kernel 4.12+

Pblk, which is used in this guide, is available from version 4.12+. Make sure to install and boot the kernel before continuing.

Install nvme-cli tool

nvme-cli is the tool used to administrate nvme devices. It can be installed using

- lver=<int> : version of the LightNVM standard to use, Default:1
- lbbtable=<file> : Load bad block table from file destination (Provide path to file. If no file is provided a bad block table will be generation. Look at lbbfrequency. Default: Null (no file).
- lnum_lun=<X> : Number of LUNs to expose. Minimum 2 for if using pblk.
- lnum_pln=<X> : Number of planes to expose.

The list of LightNVM parameters in QEMU can be found in $QUEMU_DIR/hw/block/nvme.c at the Advanced optional options comment.

Inside the virtual machine, you can now see the drive as it was a traditional Open-Channel SSD.

Instantiate pblk

When the installation is finished and the kernel have been booted. Devices can be enumerated by:

Assuming nvme0n1 was shown during "nvme lnvm list", it will then expose /dev/mydevice as a block device using it as the backend. Please note that pblk is only available at the Linux kernel Github repository, and it yet to be upstream.

Source install

Compile latest kernel

The latest LightNVM kernel can be found at:

git clone https://github.com/OpenChannelSSD/linux.git

in the "for-next" branch.

Make sure that the .config file at least includes:

CONFIG_NVM=y
# Expose the /sys/module/lnvm/parameters/configure_debug interface
CONFIG_NVM_DEBUG=y
# Target support (required to expose the open-channel SSD as a block device)
CONFIG_NVM_PBLK=y
# For NVMe support
CONFIG_BLK_DEV_NVME=y

Compile the kernel and install using the guide for your distribution.

QEMU Installation

QEMU support for Open-Channel SSDs is based on top of Keith Busch's qemu-nvme
branch, which implements an NVMe compatible device.