简体   繁体   English

如何在CLI中安装连接的EC2卷?

[英]How to mount an attached EC2 volume in CLI?

I just recovered data from an ec2 snapshot and created a volume with the data, i also attached the volume to my working instance, but I have problems mounting the new volume. 我刚从ec2快照恢复数据并创建了一个包含数据的卷,我还将卷附加到我的工作实例,但我在安装新卷时遇到问题。 On ec2-describe-volumes, I do get the find new volume created. 在ec2-describe-volumes上,我确实创建了查找新卷。 i-14305121 /dev/sdi i-14305121 / dev / sdi


How do I mount this /dev/sdi on to a directory so that I can access the files on it? 如何将此/ dev / sdi挂载到目录上以便我可以访问它上面的文件? I tried mount /dev/sdi, but I got an error: mount: special device /dev/sdi does not exist. 我尝试了mount / dev / sdi,但是我收到了一个错误:mount:特殊设备/ dev / sdi不存在。


On running lsblk from terminal, i get this 在从终端运行lsblk时,我得到了这个

dev1@ip-10-244-164-7:/$ lsblk /dev/sdi
lsblk: /dev/sdi: not a block device
dev1@ip-10-244-164-7:/$ lsblk /dev/xvdi
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvdi 202:128  0   8G  0 disk

On running mount /dev/xvdi, I also get this error. 在运行mount / dev / xvdi时,我也收到此错误。 Other details of fdisk, mtab are also given here: fdisk,mtab的其他细节也在这里给出:

dev1@ip-10-244-164-7:/$ sudo mount /dev/xvdi /backup
mount: can't find /backup in /etc/fstab or /etc/mtab
dev1@ip-10-244-164-7:/$ cat /etc/fstab
LABEL=cloudimg-rootfs   /    ext4   defaults    0 0
dev1@ip-10-244-164-7:/$ cat etc/mtab 
/dev/xvda1 / ext4 rw 0 0
proc /proc proc rw,noexec,nosuid,nodev 0 0
sysfs /sys sysfs rw,noexec,nosuid,nodev 0 0
none /sys/fs/cgroup tmpfs rw 0 0
none /sys/fs/fuse/connections fusectl rw 0 0
none /sys/kernel/debug debugfs rw 0 0
none /sys/kernel/security securityfs rw 0 0
udev /dev devtmpfs rw,mode=0755 0 0
devpts /dev/pts devpts rw,noexec,nosuid,gid=5,mode=0620 0 0
tmpfs /run tmpfs rw,noexec,nosuid,size=10%,mode=0755 0 0
none /run/lock tmpfs rw,noexec,nosuid,nodev,size=5242880 0 0
none /run/shm tmpfs rw,nosuid,nodev 0 0
none /run/user tmpfs rw,noexec,nosuid,nodev,size=104857600,mode=0755 0 0
dev1@ip-10-244-164-7:/$ sudo fdisk -l

Disk /dev/xvda1: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders, total 16777216 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/xvda1 doesn't contain a valid partition table

Disk /dev/xvdi: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders, total 16777216 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/xvdi doesn't contain a valid partition table
dev1@ip-10-244-164-7:/$

I'm not sure if this is a good answer, try running: 我不确定这是不是一个好的答案,试试运行:

lsblk /dev/sdi

And it may list partitions that exists on that drive like this: 它可能会列出该驱动器上存在的分区,如下所示:

sdi
|--sdi1
|--sdi2
|--sdi3

If you have something like sdi1 you can try to mount it: 如果您有类似sdi1的东西,可以尝试安装它:

mount /dev/sdi1 /your/folder/here

Hope it helps. 希望能帮助到你。

I think you should try 我想你应该试试

mount /dev/xvdi /your/folder

In EC2 devices are named differently from what they promise in AWS console. 在EC2中,设备的命名与它们在AWS控制台中的承诺不同。 See EC2: EBS device id confusion (/dev/sdf vs. /dev/xvdf) 请参阅EC2:EBS设备ID混淆(/ dev / sdf与/ dev / xvdf)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM