研究了半天也没搞懂怎么回事
aws ec2 run-instances --image-id ami-0afda78f1d0272d99 --instance-type t3.micro --key-name my-keypair --region us-west-1 --block-device-mappings DeviceName=xvdh,Ebs={VolumeSize=20}
这样创建出来的 ec2 有两个硬盘,怎么不要默认 8G 的硬盘啊?

研究了半天也没搞懂怎么回事
aws ec2 run-instances --image-id ami-0afda78f1d0272d99 --instance-type t3.micro --key-name my-keypair --region us-west-1 --block-device-mappings DeviceName=xvdh,Ebs={VolumeSize=20}
这样创建出来的 ec2 有两个硬盘,怎么不要默认 8G 的硬盘啊?
1 whileFalse Mar 3, 2019 ec2 的 root device 是 /dev/sda1。如果你指定了其他的卷,相当于添加一个卷。你的目的是指定根卷尺寸吗? 参考: https://docs.aws.amazon.com/zh_cn/AWSEC2/latest/UserGuide/RootDeviceStorage.html https://docs.aws.amazon.com/zh_cn/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html |
2 zhaoyc2018 OP |
3 silverfox Mar 4, 2019 via iPad 这里取决于你使用的 AMI,根卷的设备名称可能是 /dev/sda1 或 /dev/xvda,比如 --block-device-mappings DeviceName=sda1,Ebs={VolumeSize=20} https://docs.aws.amazon.com/zh_cn/AWSEC2/latest/UserGuide/device_naming.html |
4 zhaoyc2018 OP |
5 zhaoyc2018 OP 之前试过设置为 /dev/sda1,但提示名称冲突,或者系统无法启动。 |