我有一个 ext4 文件系统,它是逻辑卷的一部分,底层存储是 AWS EBS。我拍摄了 EBS 的快照,然后使用它创建一个新的 EBS 卷并将其附加到 EC2 实例。
由于这是原始卷的二进制副本,它与原始 LV 共享相同的 UUID,因此我尝试将新的设备分区(/dev/xvdi1)添加到现有卷组中:
> # pvremove /dev/xvdi1
Labels on physical volume "/dev/xvdi1" successfully wiped
> # pvcreate /dev/xvdi1
Physical volume "/dev/xvdi1" successfully created
>
> # vgextend VGoraarch /dev/xvdi1
Volume group "VGoraarch" successfully extended
>
> # lvcreate -l 100%FREE -n LVoraarch_snapshot VGoraarch /dev/xvdi1
> Logical volume "LVoraarch_snapshot" created.
当我尝试进行挂载时:
> # mount -t ext4 /dev/mapper/VGoraarch-LVoraarch_snapshot /oraarch_snapshot mount: wrong fs type, bad option, bad superblock on
> /dev/mapper/VGoraarch-LVoraarch_snapshot,
> missing codepage or helper program, or other error
> In some cases useful info is found in syslog - try
> dmesg | tail or so
安装它的正确方法是什么?
编辑:安装到同一个 EC2 实例
答案1
您需要做的就是导入它。例如:
# pvscan
pvscan -- reading all physical volumes (this may take a while...)
pvscan -- inactive PV "/dev/sdb1" is in EXPORTED VG "design" [996 MB / 996 MB free]
pvscan -- inactive PV "/dev/sdb2" is in EXPORTED VG "design" [996 MB / 244 MB free]
pvscan -- total: 2 [1.95 GB] / in use: 2 [1.95 GB] / in no VG: 0 [0]
# vgimport design
Volume group "vg" successfully imported
# vgchange -ay design
# mkdir -p /mnt/design/users
# mount /dev/design/users /mnt/design/users
(摘自http://tldp.org/HOWTO/LVM-HOWTO/recipemovevgtonewsys.html)