Go to main content

man pages section 8: System Administration Commands

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

nvmeadm (8)

Name

nvmeadm - NVM Express controller command line interface

Synopsis

nvmeadm [-?]
nvmeadm [-V]
nvmeadm list [-v] [ControllerName]...
nvmeadm namespace [-nv] [ControllerName]...
nvmeadm getlog [-he] [ControllerName]...
nvmeadm getfeature [ControllerName]...
nvmeadm format [-abflmn] [ControllerName]...
nvmeadm erase [an] [ControllerName]...
nvmeadm online [-an] [ControllerName]...
nvmeadm offline [-an] [ControllerName]...

Description

The nvmeadm utility is a command line interface that collects and modifies the controller and device configuration on an NVM Express (the controller, an NVM Express flash device and the NVM interface between them) subsystem.

nvmeadm is implemented as a set of subcommands, described below.

Sub Commands

The following subcommands are supported by nvmeadm.


Note -  If no ControllerName is specified, the required information for ALL controllers will be returned.
list

Lists information for the controller referenced by the specified ControllerName.

namespace

Lists information for the namespaces of the controller referenced by the specified ControllerName.

getlog

Lists NVMExpress Log Pages of the controller referenced by the specified ControllerName. There are two log pages. SMART/Health information and Error Information.

SMART/health information is over the life of the controller and is retained across power cycles. It includes critical warnings about the controller and device status, such as temperature threshold, available spare, device life status, and various I/O statistics used for calculating I/O performance.

Error Information is extended error information for commands. If a number is specified, the last number of the error logs will be displayed. Otherwise the last 1 error log is returned.

getfeature

Lists NVMExpress Features of the controller referenced by the specified ControllerName.

format

Low Level format a/all namespace(s) - changes the LBA and metadata size for the controller referenced by the specified ControllerName. All data will be destroyed after a low level format.

This command should be issued after the namespace(s) is(are) offlined.

erase

Security erases the NVM namespace media for the controller referenced by the specified ControllerName. All data will be destroyed after an erase.

This command should be issued after the namespace(s) is(are) offlined.


Note -  The controller may not support format/erase a single namespace. In this case, –a option must be used to confirm format/erase all namespaces.
online

Bring a/all namespce(s), for the controller referenced by the specified ControllerName, online to present block device(s) to the system.

offline

Remove a/all namespace(s) associated with block device(s), for the controller referenced by the specified ControllerName, from the system.

Options

The following options are supported:

–?, –-help

Displays usage information.

–a, –-all

Selects all namespaces on the controller specified by ControllerName.

–b, –-blocksize

Retrieves or specifies the LBA data size of a namespace on the ControllerName. This option can only be used with the namespace or the format subcommand.

–e, –-error log

Retrieves the extended error information.

–f, –-LBA format

Formats the NVM namespace(s) media on the ControllerName to the logical block size and metadata size specified by –b, –m and –n options.

–h, –-SMART/health information

Retrieves the SMART/health information of the controller specified by ControllerName. The information is over the life of the controller and is retained across power cycles. This option can be used only with the getlog subcommand.

–l, –-list lba format

Lists the LBA formats supported by the ControllerName. Each LBA format contains LBA size and metadata size.

–m, –-metadata size

Retrieves or specifies the metadata size of a namespace on the ControllerName.

–n, –-namespace

Selects the namespace on the controller specified by ControllerName.

–v, –-verbose

Displays detailed information of a controller or device/namespace, based on the invoked subcommand.

Examples

Example 1 Listing all NVM Express Controllers

The following command lists all NVM Express controllers on the host.

# nvmeadm list
SUNW-NVME-1
Example 2 Listing all NVM Express Controllers With Details

The following command lists all NVM Express controllers details on the host.

# nvmeadm list -v				
SUNW-NVME-1
		PCI Vendor ID:                  1111
		Serial Number:                  1111111111        
		Model Number:                   1111111111111
		Firmware Revision:              1.1.1   
		Number of Namespaces:           1
Example 3 Listing a Particular NVM Express Controller With Details

The following command lists one NVM Express controller details.

# nvmeadm list -v SUNW-NVME-1 
SUNW-NVME-1
		PCI Vendor ID:                  1111
		Serial Number:                  1111111111        
		Model Number:                   1111111111111
		Firmware Revision:              1.1.1   
		Number of Namespaces:           1
Example 4 Listing Namespaces

The following command lists all namespaces on all NVM Express controllers.

# nvmeadm namespace
SUNW-NVME-1
        Namespace: 1
Example 5 Listing a Given Namespace in Verbose Mode

The following command lits a given namespace in verbose mode.

# nvmeadm namespace -n 1 -v SUNW-NVME-1
SUNW-NVME-1
		Namespace: 1
			Block Size:                     512
			Capacity:                       786146787328
			Metadata Size:                  0
			Block Device Name:              /dev/rdsk/c5t0d0s2
Example 6 Offline a Given Namespace.

The following commands removes a given namespace.

# nvmeadm offline -n 1 SUNW-NVME-1
Example 7 Listing the Supported LBA Format

The following command lists the supported LBA format.

# nvmeadm format -l SUNW-NVME-1
SUNW-NVME-1
	       LBA Format: 1
	                Block Size:            512
	                Metadata Size:			0
	       LBA Format: 2
	                Block Size:			4096
	                Metadata Size:			0
Example 8 Formatting a Names to Other LBA Format

The following command formats names to other LBA format.

# nvmeadm format -n 1 -m 0 -b 4096 SUNW-NVME-1
Example 9 Erasing a Given Namespace

The following command erases the given namespace.

# nvmeadm erase -n 1 SUNW-NVME-1
Example 10 Listing the Smart/health Information of a Controller

The following command lits the smart/health information of a controller.

# nvmeadm getlog -h SUNW-NVME-1
SMART/Health Information:
	    Critical Warning: 
       		 No warning to report.
	    Temperature: 0 Kelvin
        Available Spare: 25 percent
	    Available Spare Threshold: 5 percent
        Percentage Used: 0 percent
		Data Unit Read: 1884193 of 512k bytes.
		Data Unit Written: 1497911 of 512k bytes.
		Number of Host Read Commands: 585283477 
		Number of Host Write Commands: 523315680 
		Controller Busy Time in Minutes: 0 
		Number of Power Cycle: 6 
		Number of Power On Hours: 114 
		Number of Unsafe Shutdown: 2 
		Number of Media Errors: 0 
		Number of Error Info Log Entries: 7 

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availibility
system/storage/nvme-utilities
Interface Stability
Committed

See Also

attributes(7)