Centos – Cannot do “lvcreate” : “not found: device not cleared” on Centos

centoslvm

I have created volume group, but when I tried to lvcreate, it failed:

[root@c7v232 ~]# vgdisplay 
  --- Volume group ---
  VG Name               vg_1afe5376c50bb27bdc8a0342a0bfb50b
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  13
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                0
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               89.87 GiB
  PE Size               4.00 MiB
  Total PE              23007
  Alloc PE / Size       0 / 0   
  Free  PE / Size       23007 / 89.87 GiB
  VG UUID               JZMo2m-CgAd-iQ3l-sNcp-J0W5-jwfi-058onD

[root@c7v232 ~]# vgs
  VG                                  #PV #LV #SN Attr   VSize  VFree 
  vg_1afe5376c50bb27bdc8a0342a0bfb50b   1   0   0 wz--n- 89.87g 89.87g
[root@c7v232 ~]# lvs
[root@c7v232 ~]# lvcreate -L 5G -n lv_pao vg_1afe5376c50bb27bdc8a0342a0bfb50b
  /dev/vg_1afe5376c50bb27bdc8a0342a0bfb50b/lv_pao: not found: device not cleared
  Aborting. Failed to wipe start of new LV.

I known there is a similar question, but it is debian and I cannot find udev in Centos.

Best Answer

It turns out I haven't installed udev yet. Run yum install libudev-devel then it works fine.

I don't know why I have udevadm and lvcreate even before installing libudev-devel