最新消息

修改lvm的uuid(duplicate PVs were found)

乐鱼网教程 2021-03-30 14:44

查看pv信息

在存在clonepvs时,同一个机器内的就会存在相同uuid的vg,这时就需要使用vgimportclone来修改vg的信息


vgimportclone:ImportaVGfromclonedPVs

存在clonepv时:duplicatePVswerefound


修改lvm的uuid(duplicate PVs were found)

可以使用lsblk-f查看磁盘信息(也可以使用pvs或vgs来查看信息,确定是哪个pv存在clone):


修改lvm的uuid(duplicate PVs were found)

修改lvm的uuid(duplicate PVs were found)


根据查询到的信息可以发现,/dev/sdk1&/dev/sdl1同属一个vg,/dev/sdn1&/dev/sdo1为前面pv的clone。

vgimportclone

VGVG“vg00"存在PVs“/dev/sdc”和”/dev/sdd",若clone盘为“/dev/sdf”和"/dev/sdg",将与“/dev/sdf”和“/dev/sdg”相关联的VG从“vg00”重命名为“vg00_snap”(并更改相关的uuid)。

vgimportclone--basevgnamenewnameclonevolumnclonevolumn


vgimportclone--basevgnamelvmtestre/dev/sdn1/dev/sdo1#将/devs/dn1&/dev/sdo1所在的vgname修改为lvmtestre

修改lvm的uuid(duplicate PVs were found)


pvscan


(到这里vg的uuid已经更改成功了)

激活vg

查看lv信息:lvdisplay


修改lvm的uuid(duplicate PVs were found)


从输出信息可以看LVStatus为NOTavailable(未激活),需要使用vgchange来激活:

vgchange-ayvgname


-a:activate


-y:yes激活


vgchange-aylvmtestre


修改lvm的uuid(duplicate PVs were found)

查看激活后的lv信息:lvdisplay


修改lvm的uuid(duplicate PVs were found)

最终的磁盘信息:lsblk-f


修改lvm的uuid(duplicate PVs were found)


LVM逻辑卷的创建可以参考LVM逻辑卷的创建


LVM的其他操作可以参考LVM设备的重命名,扩容,缩容及删除操作


作者:Kathyao

退出