创建PV报错pvcreate Read-only locking type set
冯哲彦
2023-12-01
创建PV报错pvcreate Read-only locking type set
创建PV报错
pvcreate /dev/emcpowerd
pvcreate Read-only locking type set.write locks are prohibited.
Can't get lock for orphan PVs
处理过程
测试创分区建文件系统没问题
fdisk /dev/emcpowerd
mkfs.ext4 /dev/emcpowerd1
mount /dev/emcpowerd1 /mnt
cd /mnt
vi test.txt
清理文件头没问题
dd if=/dev/zero of=/dev/emcpowerd
找存储厂家来也没找到原因。
最后查看/etc/lvm/lvm.conf
locking_type=4
修改locking_tpye=1
创建PV成功。
总结:因为是新的系统,各参数都是默认值,根本没想到谁会修改了locking_tpye默认参数.
如下为locking_type各取值介绍。
# Type of locking to use. Defaults to local file-based locking (1).
# Turn locking off by setting to 0 (dangerous: risks metadata corruption
# if LVM2 commands get run concurrently).
# Type 2 uses the external shared library locking_library.
# Type 3 uses built-in clustered locking.
# Type 4 uses read-only locking which forbids any operations that might
# change metadata.