EC2上的MongoDB – 无法stat / dev / xdf – 没有这样的文件或目录

我正在学习关于在EC2上设置MongoDB的教程,并且陷入了下面的部分:

$ sudo mkfs.ext4 /dev/xdf mke2fs 1.42.3 (14-May-2012) Could not stat /dev/xdf --- No such file or directory The device apparently does not exist; did you specify it correctly? 

不知道如何继续 – 任何帮助将不胜感激!

编辑:

 $ ls /dev autofs disk hvc4 loop1 mapper ppp sdg tty1 tty17 tty24 tty31 tty39 tty46 tty53 tty60 ttyS1 vcs4 vcsa5 xvdh block fd hvc5 loop2 mem psaux sdh tty10 tty18 tty25 tty32 tty4 tty47 tty54 tty61 ttyS2 vcs5 vcsa6 zero btrfs-control full hvc6 loop3 net ptmx shm tty11 tty19 tty26 tty33 tty40 tty48 tty55 tty62 ttyS3 vcs6 vga_arbiter char fuse hvc7 loop4 network_latency pts stderr tty12 tty2 tty27 tty34 tty41 tty49 tty56 tty63 urandom vcsa vhost-net console hvc0 input loop5 network_throughput random stdin tty13 tty20 tty28 tty35 tty42 tty5 tty57 tty7 vcs vcsa1 xen core hvc1 kmsg loop6 null root stdout tty14 tty21 tty29 tty36 tty43 tty50 tty58 tty8 vcs1 vcsa2 xvda1 cpu hvc2 log loop7 oldmem sda1 tty tty15 tty22 tty3 tty37 tty44 tty51 tty59 tty9 vcs2 vcsa3 xvdf cpu_dma_latency hvc3 loop0 loop-control port sdf tty0 tty16 tty23 tty30 tty38 tty45 tty52 tty6 ttyS0 vcs3 vcsa4 xvdg 

从答案,这听起来像那些块设备的名称。 在pipe理控制台中,它们看起来像是sdhsdfsdg 。 有道理xdf不退出。

此错误意味着您尝试使用ext4文件系统进行格式化的块设备/ dev / xvdf不存在。

请确保/ dev / xvdf存在。 它可能有其他的名字,而不是xvdf。

您是否使用ec2-run-instances命令启动实例作为教程,或者您是否使用以不同方式启动的实例?

它指定了ec2-run-instances命令中的附加卷:

$ ec2-run-instances ami-05355a6c -t m1.large -g [SECURITY-GROUP] -k [KEY-PAIR] -b “/ dev / xdf =:200:false:io1:1000”-b“/ dev / xdg =:25:false:io1:250“-b”/ dev / xdh =:10:false:io1:100“– ebs-optimized true

如果您启动了没有这些卷的实例,则可以创build它们并将其附加到您的实例,或者使用上面的参数启动一个新实例。

市场上预置的AMI可能更容易让你开始,他们已经安装了一切,预先configuration了许多优化。