For future references, there are two cases:
1. When there are no partitions
This may happen when you have a GPT (GUID Partition Table). Unfortunately this cannot even be forced with -f
(ref to a bug report)
You can check what partition table you have with fdisk -l /dev/sda
for example.
The solution is to replace the GPT with a legacy BIOS table, for example with gparted:
Device
/ Create Partition Table...
- Select new partition table:
msdos
or with parted:
parted /dev/sda
mktable msdos
quit
After which you should be able to create your physical volume:
It is possible that pvcreate suggests to wipe out the dos signature found in the partition table. It is safe to do it.
2. When there are already partitions on the disk
It is a safety measure, and -f
cannot override it either.
You can remove the partitions with the same solution above, since creating a new table will erase everything. There are other ways to do it, for example with fdisk
, but the solution above makes sure you solve the GPT issue at the same time.
-ff
is necessary when creating the physical volume withpvcreate
. Thewipefs
command does the job of removing the GPT partition table just fine so that LVM will deal with the entire raw device directly. – James Jan 24 '23 at 21:17wipefs didn't seem to help (not sure I was using it right though), but after the dd pvcreate didn't care
– DeadChex Jun 06 '23 at 21:19