LVM will only create a pv label on a device if it is not currently in use. There are some of the other various causes for this issue, which include’s:
The device for pvcreate has a mounted filesystem.
The device for pvcreate has a partition, but you are running pvcreate on the whole disk.
For the first case, it recommends a solution:
If it is being used by a mount point which is currently mounted, umount it first.
If the device is a partition with an un-mounted filesystem, will
pvcreate still refuse to create a PV out of the partition by default? (I can't test it out, because it is dangerous to test.)
I think that
pvcreate should always refuse to create a PV out of a partition by default, if the partition contains a filesystem, regardless of whether the filesystem is mounted or not, to avoid data loss.