Error when mounting drive

后端 未结 3 2065
难免孤独
难免孤独 2021-02-20 14:48

I created an EC2 amazon instance (ubuntu) and created a volume from an available snapshot. The volume has been successfully attached to my instance as /dev/sdf.

3条回答
  •  暖寄归人
    2021-02-20 15:51

    In my CloudFormation UserData section I had the attach-volume command and mount command execute sequentially without a delay. I introduced a 5 second delay between the attach-volume command and mount command and it solved the problem.

    aws ec2 attach-volume --volume-id $volumeId --instance-id $instanceId --device /dev/xvdf
    sleep 5
    mount /dev/xvdf /db -t ext4
    

提交回复
热议问题