Bug 128380 - pvcreate overwrites partition when wildcarding command line options
pvcreate overwrites partition when wildcarding command line options
Status: CLOSED DUPLICATE of bug 109887
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: lvm (Show other bugs)
3.0
All Linux
medium Severity high
: ---
: ---
Assigned To: Heinz Mauelshagen
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-07-22 09:28 EDT by Dave Horner
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-08-31 09:33:39 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 Dave Horner 2004-07-22 09:28:10 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030922

Description of problem:
I came across this during RH300 training.

While initialising 4 partions using pvcreate I tried to cut corners by
instead of doing :

pvcreate /dev/hda9
pvcreate /dev/hda10
pvcreate /dev/hda11
pvcreate /dev/hda12

I attempted this instead:

pvcreate /dev/hda[9-12]

This then destroyed /dev/hda2 - without any warning (and it was
mounted on /usr !)

After rebuilding the system I repeated the issue using variations of
this command line.  Results below:

pvcreate /dev/hda[9-10]
[root@station1 RPMS]# pvcreate /dev/hda[9-10]
pvcreate -- invalid physical volume name "/dev/hda[9-10]"

pvcreate /dev/hda[9-11] destroyed /dev/hda1
pvcreate /dev/hda[9-12] destroyed /dev/hda2







Version-Release number of selected component (if applicable):
lvm-1.0.3-15

How reproducible:
Always

Steps to Reproduce:
shown in description
    

Actual Results:  shown in description

Expected Results:  shown in description

Additional info:

shown in description
Comment 1 Alasdair Kergon 2004-08-12 12:17:04 EDT
Always use 'echo' to check how the shell will expand what you type:
  echo pvcreate /dev/hda[9-11]
gives
  pvcreate /dev/hda1

To understand this, read the man page for your shell eg the 'Pattern
Matching' section of 'man bash'.


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