无法在 AWS 上挂载现有的 EBS

无法在 AWS 上挂载现有的 EBS

我尝试安装现有的 EBS 存储(有数据)到一个实例,但它不断抛出这个错误。

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.

存储详细信息如下:

ec2-user@ip ~]$ sudo parted -l
Model: Xen Virtual Block Device (xvd)
Disk /dev/xvda: 8590MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name                 Flags
128     1049kB  2097kB  1049kB               BIOS Boot Partition  bios_grub
 1      2097kB  8590MB  8588MB  ext4         Linux


Model: Xen Virtual Block Device (xvd)
Disk /dev/xvdf: 16.1GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name                 Flags
128     1049kB  2097kB  1049kB               BIOS Boot Partition  bios_grub
 1      2097kB  16.1GB  16.1GB  ext4         Linux

dmesg | tail 显示以下详细信息

   [ec2-user@ip- ~]$ dmesg | tail
[    2.593163] piix4_smbus 0000:00:01.3: SMBus base address uninitialized - upgrade BIOS or use force_addr=0xaddr
[    2.625565] evbug: Connected device: input0 (AT Translated Set 2 keyboard at isa0060/serio0/input0)
[    2.625568] evbug: Connected device: input2 (Power Button at LNXPWRBN/button/input0)
[    2.625570] evbug: Connected device: input3 (Sleep Button at LNXSLPBN/button/input0)
[    3.657958] input: ImExPS/2 Generic Explorer Mouse as /devices/platform/i8042/serio1/input/input4
[    3.664979] evbug: Connected device: input4 (ImExPS/2 Generic Explorer Mouse at isa0060/serio1/input0)
[    5.731219] EXT4-fs (xvda1): re-mounted. Opts: (null)
[    5.938276] NET: Registered protocol family 10
[   11.720921] audit: type=1305 audit(1412199137.191:2): audit_pid=2080 old=0 auid=4294967295 ses=4294967295 res=1
[  101.024164] EXT4-fs (xvdf): VFS: Can't find ext4 filesystem
[ec2-user@ip- ~]$ 

答案1

看起来您已对该块设备进行了分区。在这种情况下,您需要挂载/dev/xvdf1,而不仅仅是/dev/xvdf

答案2

对我来说,有一些神秘的文件导致了这个问题。

首先检查你的分区,确保你正在运行 ext3 卷进而:

对于我来说,我必须使用以下命令清除目录。

sudo mkfs -t ext3 /dev/sdf

警告:这可能会删除您已保存的文件。因此您可以运行ls以确保不会丢失重要的已保存文件

答案3

我的问题似乎是我尝试安装辅助 EBS 卷的新服务器来自同一个 Amazon Linux 映像

这导致两个磁盘具有相同的UUID

[ec2-user@ip-172-31-2-42 ~]$ lsblk -f
NAME          FSTYPE FSVER LABEL UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
nvme0n1
├─nvme0n1p1   xfs          /     974bfdce-a279-4e16-b3a4-114c0f95708b    6.4G    19% /
├─nvme0n1p127
└─nvme0n1p128 vfat   FAT16       CE90-017B
nvme1n1
├─nvme1n1p1   xfs          /     974bfdce-a279-4e16-b3a4-114c0f95708b
├─nvme1n1p127
└─nvme1n1p128 vfat   FAT16       CE90-017B

我从不同的源 AMI(Ubuntu)创建了一个新实例,并且它安装正常

sudo mkdir /olddisk
sudo mount -t xfs /dev/xvdf1 /olddisk

相关内容