![为什么BlockDeviceMapping不创建UUID?](https://linux22.com/image/1616609/%E4%B8%BA%E4%BB%80%E4%B9%88BlockDeviceMapping%E4%B8%8D%E5%88%9B%E5%BB%BAUUID%EF%BC%9F.png)
在Linux机器中,块设备有UUID
以下是 CloudFormation 模板:
"BlockDeviceMappings": [
{
"DeviceName" : "/dev/sdf",
"Ebs" : {
"VolumeSize" : "20",
"DeleteOnTermination" : true
}
}
],
创建大小为 20 GB 的块设备
但是,以下命令不会在 Amazon Linux 实例上显示 UUID。
$ lsblk -o +UUID --fs /dev/sdf
NAME FSTYPE LABEL UUID MOUNTPOINT UUID
nvme2n1 ext4 /ecs/app_home
如何"BlockDeviceMappings"
生成 UUID /dev/sdf
?想法是使用该 UUID 并运行mkfs.ext4 -U ${uuid_var}
...