在EC2实例上验证安装点
我在 ec2实例上安装多个EBS卷以执行一些验证和校验和检查,但问题是在安装在目标安装点上之前,我需要检查是否没有占用该安装由于我正在动态创建安装点,例如
test_lambda.py (例如)(例如)
device_prefixes = ['f','g','h','i','j','k','l','m','n','o','p']
attached_volumes = []
try:
for index,volume_id in enumerate(created_volumes):
MOUNT_POINT = "/dev/sd{}".format(device_prefixes[index])
我已经尝试使用 ssm Findmnt ,但它们正在显示分区和其他卷,但不像(/dev/sde,/dev/sdf etc)那样定位
i am mounting multiple ebs volumes on an ec2 instance to perform some validations and check-sums but the problem is that before mounting volumes on the target mount point , i need to check whether that mount is not occupied, since i am creating mount points dynamically e.g
test_lambda.py (e.g)
device_prefixes = ['f','g','h','i','j','k','l','m','n','o','p']
attached_volumes = []
try:
for index,volume_id in enumerate(created_volumes):
MOUNT_POINT = "/dev/sd{}".format(device_prefixes[index])
I have tried commands using SSM like /proc/mounts, findmnt, but they are displaying partitions and other volumes but not target like (/dev/sde,/dev/sdf etc)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
多亏了约旦提供的提示,我能够清除对块设备映射的理解, boto3 ec2客户端有一种相关的方法,
它确实为我们提供了有关某些资源的信息,如果我的问题不清楚,则表示歉意首先,
Thanks to the hint provided by jordan, i was able to clear my understanding about block device mapping , boto3 ec2 client has a method associated
it does give us info about certain resources, apologies if my question was not clear in the first place,