close

運行架構的部分,網路上很多,這邊就不贅述。

Under Linux, install nvme-cli
Cmd: yum install nvme-cli

一般情況下,拿到的設備,在Linux OS下會看到設備名稱結尾會有個n1的字串
E.g.:
[root@localhost ~]# nvme list
Node                  Generic               SN                   Model                                    Namespace  Usage                      Format           FW Rev
--------------------- --------------------- -------------------- ---------------------------------------- ---------- -------------------------- ---------------- --------
/dev/nvme0n1          /dev/ng0n1            4024SNDAN4208ILA0B0V HFS00XXXXXXXXXN                          0x1         12.21  GB /   1.02  TB    512   B +  0 B   51021A20
/dev/nvme1n1          /dev/ng1n1            S6UKNC0XB00533       SAMSUNG MZXXX30XXXXX-00A07               0x1         30.72  TB /  30.72  TB    512   B +  0 B   MPPA5B5Q
/dev/nvme9n1          /dev/ng9n1            XXXX                           WDXXXXXXXXXXXXXXXXXXXX               0x1          0.00   B / 113.18  TB      4 KiB +  8 B   4.4.2
/dev/nvme9n2          /dev/ng9n2            XXXX                           WSXXXXXXXXXXXXXXXXXXXX               0x5          0.00   B /   1.57  GB    512   B +  8 B   4.4.2
這個n1就是指namespace 1
這個n2就是指namespace 2

Identify Controller about the NVMe
Command: nvme id-ctrl /dev/nvmeX
E.g.: $nvme id-ctrl /dev/nvme2
 

List the namespaces of NVMe controller under OS.
Command: nvme list-ctrl /dev/nvmeX
E.g.: Single Controller
$nvme list-ctrl /dev/nvme3
num of ctrls present: 1
[   0]:0

E.g.: Multi-Controller: SAMSUNG MZWLR30THBLA-00A07
$nvme list-ctrl /dev/nvme2
num of ctrls present: 66
[   0]:0x1
[   1]:0x2
[   2]:0x3
...
[  64]:0x41
[  65]:0x42
Multi-Controller的主要控制器,則是要從id-ctrl查詢
Command: nvme id-ctrl /dev/nvmeX | grep cntlid
E.g.: $ nvme id-ctrl /dev/nvme2 | grep cntlid
cntlid    : 0x41
 

Find NVMe nsze.
Command: nvme id-ns /dev/nvmeXn1 |grep -i nsze

 

Detach NVMe namespace.
Command: nvme detach-ns /dev/nvmeX -n 1 -c {cntlid}

 

Delete NVMe namespace.
Command: nvme delete-ns /dev/nvmeX -n 1

 

Create NVMe namespace.
Command: nvme create-ns /dev/nvmeX -s <nsze> -c <nsze> -f 0

 

Attach namespace.
Command: nvme attach-ns /dev/nvmeX -n 1 -c {cntlid}

 

Check the sector size.
Command: nvme list |grep nvmeXn1
Command: nvme id-ns /dev/nvmeXn1 |grep -i nsze

 

Check NVMe namespace can be reconized by OS. (Expect /dev/nvmeXn1 exists.)
Command: ls /dev/nvmeXn1

 

More operation, please refer below.
Ref: https://www.ibm.com/docs/en/linux-on-systems?topic=nvme-namespaces

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 吾給力 的頭像
    吾給力

    吾給力的部落格

    吾給力 發表在 痞客邦 留言(0) 人氣()