Description of problem:
This isn't a bug, but its a *very* unforgiving behavior. pvcreate
doesn't seem to check whether the device being written to is in use.
There's nothing to stop a customer confused about their partitioning
to run pvcreate over, say, the device currently being used for /.
I'm an RHCX. A student sitting an RH133 lab just did this,
accidentally following the devices used in the notes' example rather
than using the partitions he'd just created. Now his machine isn't usable.
If its possible to 'reverse' a pvcreate, I can't seem to find much
documentation for this.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1.Make a typo with pvcreate
Lose all data on device.
Some kind of basic check to make sure the device isn't in use before
pvcreate is run.
pvcreate already detects some situations like this and provides
warnings, e.g. if LVM is already using the device. It also requires
the partition type be set to the LVM type of '8e' indicating that the
device is meant to be controlled by LVM.
Was the partition type also set incorrectly (for the same reason)?
Or was the '=f' argument to pvcreate used to suppress the warnings?
LVM itself is in maintenance-only mode now, so changes like this won't
happen I'm afraid. Its replacement is LVM2 and I'll add this item to
its list of requested enhancements. Additional checks like you
suggest are certainly possible. There's already a low-priority item
on the list to take a backup of any parts of the device that pvcreate
*** This bug has been marked as a duplicate of 109887 ***