NVME-FORMAT(1) | NVMe Manual | NVME-FORMAT(1) |
NAME¶
nvme-format - Format an NVMe device
SYNOPSIS¶
nvme format <device> [--namespace-id=<nsid> | -n <nsid>]
[--lbaf=<lbaf> | -l <lbaf>]
[--block-size=<block size | -b <block size>]
[--ses=<ses> | -s <ses>]
[--pil=<pil> | -p <pil>]
[--pi=<pi> | -i <pi>]
[--ms=<ms> | -m <ms>]
[--reset | -r ]
[--timeout=<timeout> | -t <timeout> ]
DESCRIPTION¶
For the NVMe device given, send an nvme Format Namespace admin command and provides the results.
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, the namespace identifier will default to 0xffffffff to send the format to all namespace, but can be overridden to any namespace with the namespace-id option. 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.
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.
OPTIONS¶
-n <nsid>, --namespace-id=<nsid>
-l <lbaf>, --lbaf=<lbaf>
-b <block size>, --block-size=<block size>
-s <ses>, --ses=<ses>
Value | Definition |
0 | No secure erase operation requested |
1 | 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. |
2 | Cryptographic Erase: All user data shall be erased cryptographically. This is accomplished by deleting the encryption key. |
3–7 | Reserved |
-p <pil>, --pil=<pil>
-i <pi>, --pi=<pi>
Value | Definition |
0 | Protection information is not enabled |
1 | Protection information is enabled, Type 1 |
2 | Protection information is enabled, Type 2 |
3 | Protection information is enabled, Type 3 |
4–7 | Reserved |
-m <ms>, --ms=<ms>
-r, --reset
-t <timeout>, --timeout=<timeout>
EXAMPLES¶
# nvme format /dev/nvme0n1
# nvme format /dev/nvme0 --namespace-id=1 --ses=1 --pi=1
NVME¶
Part of the nvme-user suite
04/08/2019 | NVMe |