问题:在这次RHCE考试中,使用图形化创建LVM时候不小心勾选了集群,结果出现以下错误:

pvcreate command failed. Command attempted: "/sbin/pvcreate -M 2 /dev/sda5" - System Error Message:   Can't initialize physical volume "/dev/sda5" of volume group "clustered" without -ffSkipping clustered volume group_第1张图片

解决方法:

[root@localhost yum.repos.d]# vgs
  Skipping clustered volume group clustered
[root@localhost yum.repos.d]# vgscan
  Reading all physical volumes.  This may take a while...
  Skipping clustered volume group clustered

网上查找的资料

However, a local volume group has been incorrectly set up as clustered, and there isnot a cluster set up for the locking, when unset the cluster flag is attempted to be removed, vgchange will print out "Skipping cluster volume group."

In order to fix this, edit the /etc/lvm/lvm.conf file and set locking_type = 0. Then run the command vgchange -cn VolumeGroupName. After this, change the locking_type in the /etc/lvm/lvm.conf back to the original value.

根据说明我把/etc/lvm/lvm.conf中的locking_type = 1修改成了locking_type = 0,发现并未能解决问题

[root@localhost ~]# vgchange -c n vgo
  WARNING: Locking disabled. Be careful! This could corrupt your metadata.
  Volume group "vgo" not found
[root@localhost ~]#

这时候想起了之前老师说的dd命令,于是

[root@localhost ~]# dd if=/dev/zero of=/dev/sda5 bs=1M count=16
16+0 records in
16+0 records out
16777216 bytes (17 MB) copied, 8.80356 s, 1.9 MB/s
[root@localhost ~]#

问题成功解决!


#########公众号:w_caibao###########

         与技术无关,与“宝宝”相连

Skipping clustered volume group_第2张图片