AWS 将旧卷从旧实例安装到新实例

AWS mounting old volume from old instance to new instance

我确实从旧实例中分离了旧卷并将旧卷附加到 aws 控制台中的新实例。

我关注了这个问题:Add EBS to Ubuntu EC2 Instance

当我命令'sudo mount /vol'

它告诉我错误:

mount: wrong fs type, bad option, bad superblock on /dev/xvdf, missing codepage or helper program, or other error

   In some cases useful info is found in syslog - try
   dmesg | tail or so.

'dmesg | tail'的输出如下

[ 9.158108] audit: type=1400 audit(1481970181.964:8): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/NetworkManager/nm-dhcp-helper" pid=705 comm="apparmor_parser" [ 9.158434] audit: type=1400 audit(1481970181.964:9): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/connman/scripts/dhclient-script" pid=705 comm="apparmor_parser" [ 9.178292] audit: type=1400 audit(1481970181.984:10): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/bin/lxc-start" pid=761 comm="apparmor_parser" [ 9.341874] audit: type=1400 audit(1481970182.148:11): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/lib/lxd/lxd-bridge-proxy" pid=763 comm="apparmor_parser" [ 11.673698] random: nonblocking pool is initialized [ 11.766032] EXT4-fs (xvda1): resizing filesystem from 2094474 to 2095139 blocks [ 11.766371] EXT4-fs (xvda1): resized filesystem to 2095139 [ 12.716500] cgroup: new mount options do not match the existing superblock, will be ignored [ 236.029463] blkfront: xvdf: barrier or flush: disabled; persistent grants: disabled; indirect descriptors: enabled; [ 236.038716] xvdf: xvdf1

AWS 控制台中的旧卷附件信息如下:

VOLUME_ID (NEW_INSTANCE_NAME):/dev/sdf (attached)

您的卷有一个分区 table,证明...

[ 236.038716] xvdf: xvdf1

...因此您需要挂载分区,而不是卷。

sudo mount /dev/xvdf1 /path/to/mount-point

您也可以使用 lsblk 查看此内容。