大网数据广告活动
服务器运维问答

"Device /dev/xvdb not found" AWS EC2 symlinked volume

· 52CE 我爱测

I have an AWS instance with an encrypted EBS volume, which is at /dev/sdb . I am trying to mount it via ansible using the command: - name: format new volume filesystem: fstype=xfs dev=/dev/xvdb - name: edit fstab and mount the vo…

问题原文

原帖链接 · Dawny33 · CC BY-SA 3.0

I have an AWS instance with an encrypted EBS volume, which is at /dev/sdb.

I am trying to mount it via ansible using the command:

- name: format new volume
  filesystem: fstype=xfs dev=/dev/xvdb

- name: edit fstab and mount the vol
  action: mount=/home/ec2-user/ name= src=/dev/xvdb opts=noatime fstype=xfs state=mounted

I have put in xvdb after the suggestion from this answer: https://serverfault.com/a/365841/314047

However, I still get the error: "msg": "Device /dev/xvdb not found." PS: I get this error with /dev/sdb too.

This is the O/P of my ls -l /dev/sd* /dev/xv*

lrwxrwxrwx 1 root root       4 Feb 10 06:45 /dev/sda -> xvda
lrwxrwxrwx 1 root root       5 Feb 10 06:45 /dev/sda1 -> xvda1
lrwxrwxrwx 1 root root       4 Feb 10 06:45 /dev/sdb -> xvdb
brw-rw---- 1 root disk 202,  0 Feb 10 06:45 /dev/xvda
brw-rw---- 1 root disk 202,  1 Feb 10 06:45 /dev/xvda1
brw-rw---- 1 root disk 202, 16 Feb 10 06:45 /dev/xvdb

This command: cat /proc/partitions gives me this:

major minor  #blocks  name

 202        0    8388608 xvda
 202        1    8386543 xvda1
 202       16    8388608 xvdb

Is there anything which I did wrong? How do I mount my volume and cd into it?

已采纳解答

原帖链接 · HackToHell · CC BY-SA 3.0

Looks like you haven't partitioned and formatted it, you will have to first partition it using fdisk and then create a ext4/3 partition using makefs. You can check out the documentation here.

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-using-volumes.html

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-02-10)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。