Bug 120909 - its possible to run pvcreate on a mounted disk, destroying all its data
its possible to run pvcreate on a mounted disk, destroying all its data
Status: CLOSED DUPLICATE of bug 109887
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: lvm (Show other bugs)
3.0
All Linux
low Severity medium
: ---
: ---
Assigned To: Alasdair Kergon
Brian Brock
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-04-15 01:14 EDT by Mike MacCana
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-08-31 09:35:32 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Mike MacCana 2004-04-15 01:14:07 EDT
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):
20020927-11

How reproducible:
Always

Steps to Reproduce:
1.Make a typo with pvcreate
  
Actual results:
Lose all data on device.

Expected results:
Some kind of basic check to make sure the device isn't in use before
pvcreate is run.
Comment 1 Alasdair Kergon 2004-04-15 07:53:49 EDT
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
changes.
Comment 2 Heinz Mauelshagen 2004-08-13 06:03:01 EDT
Duplicate.

*** This bug has been marked as a duplicate of 109887 ***

Note You need to log in before you can comment on or make changes to this bug.