Blame Documentation/nvme-format.1

Packit dd4ba5
'\" t
Packit dd4ba5
.\"     Title: nvme-format
Packit dd4ba5
.\"    Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
Packit dd4ba5
.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
Packit dd4ba5
.\"      Date: 04/24/2020
Packit dd4ba5
.\"    Manual: NVMe Manual
Packit dd4ba5
.\"    Source: NVMe
Packit dd4ba5
.\"  Language: English
Packit dd4ba5
.\"
Packit dd4ba5
.TH "NVME\-FORMAT" "1" "04/24/2020" "NVMe" "NVMe Manual"
Packit dd4ba5
.\" -----------------------------------------------------------------
Packit dd4ba5
.\" * Define some portability stuff
Packit dd4ba5
.\" -----------------------------------------------------------------
Packit dd4ba5
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Packit dd4ba5
.\" http://bugs.debian.org/507673
Packit dd4ba5
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
Packit dd4ba5
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Packit dd4ba5
.ie \n(.g .ds Aq \(aq
Packit dd4ba5
.el       .ds Aq '
Packit dd4ba5
.\" -----------------------------------------------------------------
Packit dd4ba5
.\" * set default formatting
Packit dd4ba5
.\" -----------------------------------------------------------------
Packit dd4ba5
.\" disable hyphenation
Packit dd4ba5
.nh
Packit dd4ba5
.\" disable justification (adjust text to left margin only)
Packit dd4ba5
.ad l
Packit dd4ba5
.\" -----------------------------------------------------------------
Packit dd4ba5
.\" * MAIN CONTENT STARTS HERE *
Packit dd4ba5
.\" -----------------------------------------------------------------
Packit dd4ba5
.SH "NAME"
Packit dd4ba5
nvme-format \- Format an NVMe device
Packit dd4ba5
.SH "SYNOPSIS"
Packit dd4ba5
.sp
Packit dd4ba5
.nf
Packit dd4ba5
\fInvme format\fR <device> [\-\-namespace\-id=<nsid> | \-n <nsid>]
Packit dd4ba5
                    [\-\-lbaf=<lbaf> | \-l <lbaf>]
Packit dd4ba5
                    [\-\-block\-size=<block size | \-b <block size>]
Packit dd4ba5
                    [\-\-ses=<ses> | \-s <ses>]
Packit dd4ba5
                    [\-\-pil=<pil> | \-p <pil>]
Packit dd4ba5
                    [\-\-pi=<pi> | \-i <pi>]
Packit dd4ba5
                    [\-\-ms=<ms> | \-m <ms>]
Packit dd4ba5
                    [\-\-reset | \-r ]
Packit dd4ba5
                    [\-\-force | \-f ]
Packit dd4ba5
                    [\-\-timeout=<timeout> | \-t <timeout> ]
Packit dd4ba5
.fi
Packit dd4ba5
.SH "DESCRIPTION"
Packit dd4ba5
.sp
Packit dd4ba5
For the NVMe device given, send an nvme Format Namespace admin command and provides the results\&.
Packit dd4ba5
.sp
Packit dd4ba5
The <device> parameter is mandatory and may be either the NVMe character device (ex: /dev/nvme0), or a namespace block device (ex: /dev/nvme0n1)\&. If the character device is given, and the controller does not support formatting of particular namespaces (ID_CTRL\&.FNA bit 0 enabled), then all namespaces will be formatted\&. If FNA is disabled, then the namespace identifier must be specified with the \fInamespace\-id\fR option; specify a value of 0xffffffff to send the format to all namespaces\&. If the block device is given, the namespace identifier will default to the namespace ID of the block device given, but can be overridden with the same option\&.
Packit dd4ba5
.sp
Packit dd4ba5
Note, the numeric suffix on the character device, for example the \fI0\fR in /dev/nvme0, does NOT indicate this device handle is the parent controller of any namespaces with the same suffix\&. The namespace handle\(cqs numeral may be coming from the subsystem identifier, which is independent of the controller\(cqs identifier\&. Do not assume any particular device relationship based on their names\&. If you do, you may irrevocably erase data on an unintended device\&.
Packit dd4ba5
.sp
Packit dd4ba5
On success, the program will automatically issue BLKRRPART ioctl to force rescanning the namespaces\&. If the driver is recent enough, this will automatically update the physical block size\&. If it is not recent enough, you will need to remove and rescan your device some other way for the new block size to be visible, if the size was changed with this command\&.
Packit dd4ba5
.SH "OPTIONS"
Packit dd4ba5
.PP
Packit dd4ba5
\-n <nsid>, \-\-namespace\-id=<nsid>
Packit dd4ba5
.RS 4
Packit dd4ba5
Send the format command for the specified nsid\&. This can be used to override the default value for either character device (unspecified) or the block device (result from NVME_IOCTL_ID)\&.
Packit dd4ba5
.RE
Packit dd4ba5
.PP
Packit dd4ba5
\-l <lbaf>, \-\-lbaf=<lbaf>
Packit dd4ba5
.RS 4
Packit dd4ba5
LBA Format: This field specifies the LBA format to apply to the NVM media\&. This corresponds to the LBA formats indicated in the Identify Namespace command\&. Conflicts with \-\-block\-size argument\&. Defaults to 0\&.
Packit dd4ba5
.RE
Packit dd4ba5
.PP
Packit dd4ba5
\-b <block size>, \-\-block\-size=<block size>
Packit dd4ba5
.RS 4
Packit dd4ba5
Block Size: This field is used to specify the target block size to format to\&. Potential lbaf values will be scanned and the lowest numbered will be selected for the format operation\&. Conflicts with \-\-lbaf argument\&.
Packit dd4ba5
.RE
Packit dd4ba5
.PP
Packit dd4ba5
\-s <ses>, \-\-ses=<ses>
Packit dd4ba5
.RS 4
Packit dd4ba5
Secure Erase Settings: This field specifies whether a secure erase should be performed as part of the format and the type of the secure erase operation\&. The erase applies to all user data, regardless of location (e\&.g\&., within an exposed LBA, within a cache, within deallocated LBAs, etc)\&. Defaults to 0\&.
Packit dd4ba5
.TS
Packit dd4ba5
allbox tab(:);
Packit dd4ba5
lt lt
Packit dd4ba5
lt lt
Packit dd4ba5
lt lt
Packit dd4ba5
lt lt
Packit dd4ba5
lt lt.
Packit dd4ba5
T{
Packit dd4ba5
Value
Packit dd4ba5
T}:T{
Packit dd4ba5
Definition
Packit dd4ba5
T}
Packit dd4ba5
T{
Packit dd4ba5
0
Packit dd4ba5
T}:T{
Packit dd4ba5
No secure erase operation requested
Packit dd4ba5
T}
Packit dd4ba5
T{
Packit dd4ba5
1
Packit dd4ba5
T}:T{
Packit dd4ba5
User Data Erase: All user data shall be erased, contents of the user data after the erase is indeterminate (e\&.g\&., the user data may be zero filled, one filled, etc)\&. The controller may perform a cryptographic erase when a User Data Erase is requested if all user data is encrypted\&.
Packit dd4ba5
T}
Packit dd4ba5
T{
Packit dd4ba5
2
Packit dd4ba5
T}:T{
Packit dd4ba5
Cryptographic Erase: All user data shall be erased cryptographically\&. This is accomplished by deleting the encryption key\&.
Packit dd4ba5
T}
Packit dd4ba5
T{
Packit dd4ba5
3\(en7
Packit dd4ba5
T}:T{
Packit dd4ba5
Reserved
Packit dd4ba5
T}
Packit dd4ba5
.TE
Packit dd4ba5
.sp 1
Packit dd4ba5
.RE
Packit dd4ba5
.PP
Packit dd4ba5
\-p <pil>, \-\-pil=<pil>
Packit dd4ba5
.RS 4
Packit dd4ba5
Protection Information Location: If set to \(oq1\(cq and protection information is enabled, then protection information is transferred as the first eight bytes of metadata\&. If cleared to \(oq0\(cq and protection information is enabled, then protection information is transferred as the last eight bytes of metadata\&. Defaults to 0\&.
Packit dd4ba5
.RE
Packit dd4ba5
.PP
Packit dd4ba5
\-i <pi>, \-\-pi=<pi>
Packit dd4ba5
.RS 4
Packit dd4ba5
Protection Information: This field specifies whether end\-to\-end data protection is enabled and the type of protection information\&. Defaults to 0\&.
Packit dd4ba5
.TS
Packit dd4ba5
allbox tab(:);
Packit dd4ba5
lt lt
Packit dd4ba5
lt lt
Packit dd4ba5
lt lt
Packit dd4ba5
lt lt
Packit dd4ba5
lt lt
Packit dd4ba5
lt lt.
Packit dd4ba5
T{
Packit dd4ba5
Value
Packit dd4ba5
T}:T{
Packit dd4ba5
Definition
Packit dd4ba5
T}
Packit dd4ba5
T{
Packit dd4ba5
0
Packit dd4ba5
T}:T{
Packit dd4ba5
Protection information is not enabled
Packit dd4ba5
T}
Packit dd4ba5
T{
Packit dd4ba5
1
Packit dd4ba5
T}:T{
Packit dd4ba5
Protection information is enabled, Type 1
Packit dd4ba5
T}
Packit dd4ba5
T{
Packit dd4ba5
2
Packit dd4ba5
T}:T{
Packit dd4ba5
Protection information is enabled, Type 2
Packit dd4ba5
T}
Packit dd4ba5
T{
Packit dd4ba5
3
Packit dd4ba5
T}:T{
Packit dd4ba5
Protection information is enabled, Type 3
Packit dd4ba5
T}
Packit dd4ba5
T{
Packit dd4ba5
4\(en7
Packit dd4ba5
T}:T{
Packit dd4ba5
Reserved
Packit dd4ba5
T}
Packit dd4ba5
.TE
Packit dd4ba5
.sp 1
Packit dd4ba5
.RE
Packit dd4ba5
.PP
Packit dd4ba5
\-m <ms>, \-\-ms=<ms>
Packit dd4ba5
.RS 4
Packit dd4ba5
Metadata Settings: This field is set to \(oq1\(cq if the metadata is transferred as part of an extended data LBA\&. This field is cleared to \(oq0\(cq if the metadata is transferred as part of a separate buffer\&. The metadata may include protection information, based on the Protection Information (PI) field\&. Defaults to 0\&.
Packit dd4ba5
.RE
Packit dd4ba5
.PP
Packit dd4ba5
\-r, \-\-reset
Packit dd4ba5
.RS 4
Packit dd4ba5
Issue a reset after successful format\&. Must use the character device for this\&.
Packit dd4ba5
.RE
Packit dd4ba5
.PP
Packit dd4ba5
\-f, \-\-force
Packit dd4ba5
.RS 4
Packit dd4ba5
Just send the command immediately without warning of the implications\&.
Packit dd4ba5
.RE
Packit dd4ba5
.PP
Packit dd4ba5
\-t <timeout>, \-\-timeout=<timeout>
Packit dd4ba5
.RS 4
Packit dd4ba5
Override default timeout value\&. In milliseconds\&.
Packit dd4ba5
.RE
Packit dd4ba5
.SH "EXAMPLES"
Packit dd4ba5
.sp
Packit dd4ba5
.RS 4
Packit dd4ba5
.ie n \{\
Packit dd4ba5
\h'-04'\(bu\h'+03'\c
Packit dd4ba5
.\}
Packit dd4ba5
.el \{\
Packit dd4ba5
.sp -1
Packit dd4ba5
.IP \(bu 2.3
Packit dd4ba5
.\}
Packit dd4ba5
Format the device using all defaults:
Packit dd4ba5
.sp
Packit dd4ba5
.if n \{\
Packit dd4ba5
.RS 4
Packit dd4ba5
.\}
Packit dd4ba5
.nf
Packit dd4ba5
# nvme format /dev/nvme0n1
Packit dd4ba5
.fi
Packit dd4ba5
.if n \{\
Packit dd4ba5
.RE
Packit dd4ba5
.\}
Packit dd4ba5
.RE
Packit dd4ba5
.sp
Packit dd4ba5
.RS 4
Packit dd4ba5
.ie n \{\
Packit dd4ba5
\h'-04'\(bu\h'+03'\c
Packit dd4ba5
.\}
Packit dd4ba5
.el \{\
Packit dd4ba5
.sp -1
Packit dd4ba5
.IP \(bu 2.3
Packit dd4ba5
.\}
Packit dd4ba5
Format namespace 1 with user data secure erase settings and protection information:
Packit dd4ba5
.sp
Packit dd4ba5
.if n \{\
Packit dd4ba5
.RS 4
Packit dd4ba5
.\}
Packit dd4ba5
.nf
Packit dd4ba5
# nvme format /dev/nvme0 \-\-namespace\-id=1 \-\-ses=1 \-\-pi=1
Packit dd4ba5
.fi
Packit dd4ba5
.if n \{\
Packit dd4ba5
.RE
Packit dd4ba5
.\}
Packit dd4ba5
.RE
Packit dd4ba5
.SH "NVME"
Packit dd4ba5
.sp
Packit dd4ba5
Part of the nvme\-user suite