CFT:
"BlockDeviceMapPings": [ { "Devicename": "/dev/sda1","Ebs": { "DeleteOnTermination": "true","VolumeSize": "150","VolumeType": "standard" } },{ "Devicename": "/dev/sdm","VolumeSize": "1000","VolumeType": "standard" } }]
需要自动挂载“Devicename”:“/ dev / sdm”,此卷.
解决方法 您需要向实例的UserData属性添加一个小脚本,或者启动与此BlockDeviceMapPings关联的配置. UserData在实例第一次引导时执行.使用/ etc / fstab重新启动实例时,将自动重新装入设备."UserData" : { "Fn::Base64" : { "Fn::Join" : [ "",[ "#!/bin/bash -v\n","mkfs -t ext4 /dev/xvdm\n","mkfs -t ext4 /dev/xvda1\n","mkdir /opt/mount1 /opt/mount2\n","mount /dev/xvdm /opt/mount1\n","mount /dev/xvda1 /opt/mount2\n","echo \"/dev/xvdm /opt/mount1 ext4 defaults,nofail 0 2\" >> /etc/fstab\n" "echo \"/dev/xvda1 /opt/mount2 ext4 defaults,nofail 0 2\" >> /etc/fstab\n" ]]}}
更多信息:http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-using-volumes.html
总结以上是内存溢出为你收集整理的使用云形成在linux-Ec2实例中自动挂载ebs卷?全部内容,希望文章能够帮你解决使用云形成在linux-Ec2实例中自动挂载ebs卷?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)