Mounting a NVME disk on AWS EC2

前端 未结 4 517
后悔当初
后悔当初 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:20

    I just had a similar experience! My C5.xlarge instance detects an EBS as nvme1n1. I have added this line in fstab.

     /dev/nvme1n1 /data ext4 discard,defaults,nofail 0 2
    

    After a couple of rebooting, it looked working. It kept running for weeks. But today, I just got alert that instance was unable to be connected. I tried rebooting it from AWS console, no luck looks the culprit is the fstab. The disk mount is failed.

    I raised the ticket to AWS support, no feedback yet. I have to start a new instance to recover my service.

    In another test instance, I try to use UUID(get by command blkid) instead of /dev/nvme1n1. So far looks still working... will see if it cause any issue.

    I will update here if any AWS support feedback.

    ================ EDIT with my fix ===========

    AWS doesn't give me feedback yet, but I found the issue. Actually, in fstab, whatever you mount /dev/nvme1n1 or UUID, it doesn't matter. My issue is, my ESB has some errors in file system. I attached it to an instance then run

    fsck.ext4 /dev/nvme1n1
    

    After fixes a couple of file system error, put it in fstab, reboot, no problem anymore!

提交回复
热议问题