1NVME-FORMAT(1)                    NVMe Manual                   NVME-FORMAT(1)
2
3
4

NAME

6       nvme-format - Format an NVMe device
7

SYNOPSIS

9       nvme format <device> [--namespace-id=<nsid> | -n <nsid>]
10                           [--lbaf=<lbaf> | -l <lbaf>]
11                           [--ses=<ses> | -s <ses>]
12                           [--pil=<pil> | -p <pil>]
13                           [--pi=<pi> | -i <pi>]
14                           [--ms=<ms> | -m <ms>]
15                           [--reset | -r ]
16                           [--timeout=<timeout> | -t <timeout> ]
17

DESCRIPTION

19       For the NVMe device given, send an nvme Format Namespace admin command
20       and provides the results.
21
22       The <device> parameter is mandatory and may be either the NVMe
23       character device (ex: /dev/nvme0), or a namespace block device (ex:
24       /dev/nvme0n1). If the character device is given, the namespace
25       identifier will default to 0xffffffff to send the format to all
26       namespace, but can be overridden to any namespace with the namespace-id
27       option. If the block device is given, the namespace identifier will
28       default to the namespace id of the block device given, but can be
29       overridden with the same option.
30
31       On success, the program will automatically issue BLKRRPART ioctl to
32       force rescanning the namespaces. If the driver is recent enough, this
33       will automatically update the physical block size. If it is not recent
34       enough, you will need to remove and rescan your device some other way
35       for the new block size to be visible.
36

OPTIONS

38       -n <nsid>, --namespace-id=<nsid>
39           Send the format command for the specified nsid. This can be used to
40           override the default value for either character device (0xffffffff)
41           or the block device (result from NVME_IOCTL_ID).
42
43       -l <lbaf>, --lbaf=<lbaf>
44           LBA Format: This field specifies the LBA format to apply to the NVM
45           media. This corresponds to the LBA formats indicated in the
46           Identify Namespace command. Defaults to 0.
47
48       -s <ses>, --ses=<ses>
49           Secure Erase Settings: This field specifies whether a secure erase
50           should be performed as part of the format and the type of the
51           secure erase operation. The erase applies to all user data,
52           regardless of location (e.g., within an exposed LBA, within a
53           cache, within deallocated LBAs, etc). Defaults to 0.
54
55           ┌──────┬────────────────────────────┐
56           │Value │ Definition                 │
57           ├──────┼────────────────────────────┤
58           │0     │ No secure erase operation  │
59           │      │ requested                  │
60           ├──────┼────────────────────────────┤
61           │1     │ User Data Erase: All user  │
62           │      │ data shall be erased,      │
63           │      │ contents of the user data  │
64           │      │ after the erase is         │
65           │      │ indeterminate (e.g., the   │
66           │      │ user data may be zero      │
67           │      │ filled, one filled, etc).  │
68           │      │ The controller may perform │
69           │      │ a cryptographic erase when │
70           │      │ a User Data Erase is       │
71           │      │ requested if all user data │
72           │      │ is encrypted.              │
73           ├──────┼────────────────────────────┤
74           │2     │ Cryptographic Erase: All   │
75           │      │ user data shall be erased  │
76           │      │ cryptographically. This is │
77           │      │ accomplished by deleting   │
78           │      │ the encryption key.        │
79           ├──────┼────────────────────────────┤
80           │3–7   │ Reserved                   │
81           └──────┴────────────────────────────┘
82
83       -p <pil>, --pil=<pil>
84           Protection Information Location: If set to ‘1’ and protection
85           information is enabled, then protection information is transferred
86           as the first eight bytes of metadata. If cleared to ‘0’ and
87           protection information is enabled, then protection information is
88           transferred as the last eight bytes of metadata. Defaults to 0.
89
90       -i <pi>, --pi=<pi>
91           Protection Information: This field specifies whether end-to-end
92           data protection is enabled and the type of protection information.
93           Defaults to 0.
94
95           ┌──────┬───────────────────────────┐
96           │Value │ Definition                │
97           ├──────┼───────────────────────────┤
98           │0     │ Protection information is │
99           │      │ not enabled               │
100           ├──────┼───────────────────────────┤
101           │1     │ Protection information is │
102           │      │ enabled, Type 1           │
103           ├──────┼───────────────────────────┤
104           │2     │ Protection information is │
105           │      │ enabled, Type 2           │
106           ├──────┼───────────────────────────┤
107           │3     │ Protection information is │
108           │      │ enabled, Type 3           │
109           ├──────┼───────────────────────────┤
110           │4–7   │ Reserved                  │
111           └──────┴───────────────────────────┘
112
113       -m <ms>, --ms=<ms>
114           Metadata Settings: This field is set to ‘1’ if the metadata is
115           transferred as part of an extended data LBA. This field is cleared
116           to ‘0’ if the metadata is transferred as part of a separate buffer.
117           The metadata may include protection information, based on the
118           Protection Information (PI) field. Defaults to 0.
119
120       -r, --reset
121           Issue a reset after successful format. Must use the character
122           device for this.
123
124       -t <timeout>, --timeout=<timeout>
125           Override default timeout value. In milliseconds.
126

EXAMPLES

128       ·   Format the device using all defaults:
129
130               # nvme format /dev/nvme0n1
131
132       ·   Format namespace 1 with user data secure erase settings and
133           protection information:
134
135               # nvme format /dev/nvme0 --namespace-id=1 --ses=1 --pi=1
136

NVME

138       Part of the nvme-user suite
139
140
141
142NVMe                              06/05/2018                    NVME-FORMAT(1)
Impressum