gpt4 book ai didi

amazon-ec2 - EC2 : EBS device id confusion (/dev/sdf vs./dev/xvdf)

转载 作者:行者123 更新时间:2023-12-02 09:59:50 24 4
gpt4 key购买 nike

我将一个 EBS 卷附加到我的 EC2 实例,将其转换为 EXT3 文件系统,并成功挂载它。然而,最初我有点困惑,主要是因为 AWS 控制台显示我的 EBS 设备 ID 是什么。

根据AWS控制台:

i-xxxxxxx :/dev/sdf (attached)

我认为这意味着我附加的 EBS 设备 ID 是/dev/sdf。因此,当我尝试使用此设备 ID 将设备转换为文件系统时,我收到了以下错误消息。

ubuntu@ip-xx-xx-xx-xx:~$ mkfs -t ext3 /dev/sdf
mke2fs 1.42 (29-Nov-2011)
Could not stat /dev/sdf --- No such file or directory
The device apparently does not exist; did you specify it correctly?

经过一番研究,我发现 this文章,然后通过运行 cat/proc/partitions 发现我的真实设备 ID 是/dev/xvdf 而不是/dev/sdf。

我的问题是为什么 AWS 控制台说它是/dev/sdf 而实际上是/dev/xvdf?我认为对此必须有某种合乎逻辑的解释。

最佳答案

通过 AWS Management Console 连接卷时,AWS 提供以下消息/警告:

Note: Newer linux kernels may rename your devices to /dev/xvdf through /dev/xvdp internally, even when the device name entered here (and shown in the details) is /dev/sdf through /dev/sdp.

我没有任何可用的上游信息来源,但 Jay Rum 对(不再相关)临时问题的回答 EBS Disks starting as device /dev/xvde, but mapped as /dev/sda将此功能归因于 xen-blkfront 驱动程序:

The "xen-blkfront" driver, which allows the virtual machines (i.e. the EC2 instances) to access the underlying block devices, traditionally mapped sda, sdb... to xvda, xvdb..., [...]

最后,cyberx86 对 How do I access the attached volume in Amazon EC2 的回答提供了对该设备命名不匹配的详细说明以及如何处理它,即识别当前可用的设备等。

注意:这个问题已于 2012 年 8 月 24 日得到回答,但该答案有 6 票赞成,于 2013 年 5 月 1 日被社区版主删除(即自动化过程)出于不透明的原因(显然是因为用户被删除) - 无论如何,从我的角度来看,我已经添加了原始内容的轻微变化。

关于amazon-ec2 - EC2 : EBS device id confusion (/dev/sdf vs./dev/xvdf),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12102551/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com