2

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.

3 Answers 3

2

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

0
1

I was testing LVM in a minimal qemu environment (no systemd, no udev), and got this error too.

Expanding on the other answer

Use "lvcreate -Zn …".

and the proposed solution at the Arch Linux forum [SOLVED] Can't create new lvm logical volume

I couldn't find any relevent errors or debugging info, but I've found a solution.
Add -Z n to dissable zeroing. Then it just works fine.


So adding this option creates the logical volume with a warning

# lvcreate --zero n --size 10G --name usr vg0
  WARNING: Logical volume vg0/usr not zeroed.
  Logical volume "usr" created.

Option --zero is also mentioned at option --activate

The --zero option normally requires the LV to be active.

Using --activate n gives the same result

# lvcreate --activate n --size 10G --name usr vg0
  WARNING: Logical volume vg0/usr not zeroed.
  Logical volume "usr" created.

But reading further down to OPTIONS --zero

Warning: trying to mount an unzeroed LV can cause the system to hang.

So activate the volume

vgchange -a y

create the needed /dev nodes

vgmknodes

and zero manually

dd if=/dev/zero of=/dev/vg0/usr bs=4k count=1

before creating the file system

mkfs /dev/vg0/usr
0

Assuming that udev is installed and running, it might just be too slow. Or whatever.

Use "lvcreate -Zn …".

1
  • 1
    This gives Option --zero is unsupported with snapshots. Run 'lvcreate --help' for more information.
    – mdzeko
    Oct 31, 2019 at 11:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .