Mounting a NVME disk on AWS EC2

前端 未结 4 535
后悔当初
后悔当初 2021-01-30 17:25

So I created i3.large with NVME disk on each nodes, here was my process :

  1. lsblk -> nvme0n1 (check if nvme isn\'t yet mounted)
  2. sudo mkfs.ext4 -E nodiscar
4条回答
  •  攒了一身酷
    2021-01-30 18:25

    I have been using "c5" type instances since almost a month, "c5d.4xlarge" mostly with nvme drives. So, here's what worked for me:

    first get the location nvme is located at:

    lsblk
    

    mine always was mounted at nvme1n1 Then check if is an empty volume and doens't any file system, (it mostly doesn't, unless you are remounting). the output should be /dev/nvme1n1: data for empty drives:

    sudo file -s /dev/nvme1n1
    

    Then do this to format(if from last step you learned that your drive had file system and isn't an empty drive. skip this and go to next step):

    sudo mkfs -t xfs /dev/nvme1n1
    

    Then create a folder in current directory and mount the nvme drive:

    sudo mkdir /data
    sudo mount /dev/nvme1n1 /data
    

    you can now even check it's existence by running:

    df -h
    

提交回复
热议问题