Bug 128380 - pvcreate overwrites partition when wildcarding command line options
Summary: pvcreate overwrites partition when wildcarding command line options
Keywords:
Status: CLOSED DUPLICATE of bug 109887
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: lvm
Version: 3.0
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
Assignee: Heinz Mauelshagen
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-07-22 13:28 UTC by Dave Horner
Modified: 2007-11-30 22:07 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-08-31 13:33:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Dave Horner 2004-07-22 13:28:10 UTC
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 16:17:04 UTC
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.