NVMe Over Fabrics with iRDMA总结 - 2

5.0 Configure NVMe over Fabrics Target (Storage Server) 配置 NVMe over Fabrics 目标机(存储服务器)

5.1 Install NVMe over Fabrics Tools安装 NVMe over Fabrics 工具

5.1.1 Install nvme-cli安装 nvme-cli

  1. Download nvme-cli from: 从以下网址下载 nvme-cli:

https://github.com/linux-nvme/nvme-cli/releases

  1. Install with the following command: 使用以下命令进行安装:

cd /<path_to_nvme-cli>/; python setup.py install

5.1.2 Install nvmetcli安装 nvmetcli

  1. Download configshell_fb (required to setup nvmetcli) from: 从以下网址下载 configshell_fb(设置 nvmetcli 时需要):

https://github.com/open- iscsi/configshell-fb/releases

  1. Install with the following command: 使用以下命令进行安装:
    1. /<path_to_configshell-fb>/; python setup.py install
  2. Download nvmetcli from: 从以下网址下载 nvmetcli

ftp://ftp.infradead.org/pub/nvmetcli/

  1. Install with the following command: 使用以下命令进行安装:
    1. /<path_to_nvmetcli>/; python setup.py install

5.2 Configure NVMe Drives配置 NVMe 硬盘

5.2.1 Install Latest Drivers and Firmware for NVMe Drives为 NVMe 硬盘安装最新的驱动程序和Firmware

Follow NVMe drive manufacturer instructions. 按照 NVMe 硬盘制造商的说明进行操作。

5.2.2 Format NVMe Drives格式化 NVMe 硬盘

Reformatting NVMe drives can be done using nvme-cli. 使用 nvme-cli 可以重新格式化 NVMe 硬盘。

The following example code snippet formats all NVMe partitions on the server using nvme-cli: 以下示例代码片段使用 nvme-cli 格式化服务器上的所有 NVMe 分区:

for device in $(ls /dev/nvme*n*p*); do nvme format $device

done

5.2.3 Partition NVMe Drives分区 NVMe 硬盘

Partition the NVMe drives into as many partitions as needed using gdisk. Refer to the gdisk documentation for more details. 使用 gdisk 将 NVMe 硬盘划分为所需的多个分区。有关详细信息,请参阅 gdisk 文档。

The following example script partitions all NVMe drives on the server into a specified number of equal partitions. This removes all data on the drives. 以下示例脚本将服务器上的所有 NVMe 硬盘分区为指定数量的相等分区。这将删除驱动器上的所有数据。

add_partitions_gdisk.sh #!/bin/bash partitions=2

for device in $(ls /dev/nvme*n* | grep -v p); do inputString="" echo "$device"

max_sectorsize=$(echo -e "n\n"| gdisk $device |grep sector |grep -oP '(?<=34-).*?(?=,)') partNum=$((max_sectorsize/partitions)) for (( i=1; i<= $partitions; i++))do partSize=$((partNum*i)) echo $partSize

inputString+="n\n\n\n$partSize\n\n"

done

inputString+="

你可能感兴趣的:(Linux,kernel,kernel,linux)