1829718 Members
1938 Online
109992 Solutions
New Discussion

pvcreate

 
SOLVED
Go to solution
JUP
Regular Advisor

pvcreate

On using the following command:

pvcreate /dev/rdsk/c0t15d0

I get the message:

pvcreate: The physical volume already belongs to a volume group.

The disk pointed to by c0t15d0 is blank and about to be setup so its a mirror of another.

How do I find out which volume group its in ?
And how do I remove it from the volume group its in.

Thanks
7 REPLIES 7
Dan Am
Frequent Advisor

Re: pvcreate

you find all your pv's at the end of
vgdisplay -v

if your disk is not part of that list, it might be an old o/s on that disk, with a vg setup

you can handle with
pvcreate -f /dev/dsk/c0t5do

do what you can. don't if you can't.
Anthony deRito
Respected Contributor

Re: pvcreate

Run the command:
strings /etc/lvmtab | more
and make sure the disk is really not known to LVM.

Make sure you have a valid copy of /etc/lvmtab when you do this. Believe me, it can be wrong! If you are uncertain, run the vgscan command. You can use preview mode (-p -v) option to view the scan but not make any changes. If you see differences and decide that a new lvmtab must be generated, run the command with (-a -v) to rebuild the lvmtab file. Before you do this, move the old one out of place. If anything strange occurs with the new lvmtab file, move the old one back.
Antoanetta Naghiu
Esteemed Contributor

Re: pvcreate

If pvcreate with -f option (force) is not working that means you are missing LVM patches. There are about 4-5 patches that you need to have them install. Which OS do you have installed?
JUP
Regular Advisor

Re: pvcreate

To Antoanetta : I am using HP-UX B.11.00A

Tim Malnati
Honored Contributor

Re: pvcreate

The quick answer to finding out where it is allocated is with the command "pvdisplay /dev/dsk/c0t15d0" NOTE: use the block device designation with pvdisplay not the raw device. The -v option is also available to display extent information if desired.

The other comments in this thead are valid. There are a number of patches out there for LVM and it is not that unusual to find the lvmtab to be in error.

By chance, is this a drive that is part of an EMC array? The device number that you are using is very commonly used with an EMC as the gatekeeper device. Just a thought.
Antoanetta Naghiu
Esteemed Contributor
Solution

Re: pvcreate

Hi,
There are a few questions that need to be answered.
1. run ioscan -fnC disk. Is it your disk claimed? Is the device file as /dev/dsk/c0t15d0?
2.run pvdisplay -v /dev/dsk/c0t15d0 is it shown as part of any vg? (what is the output?)
3. Is this disk an independent disk or the device is part of an array?
4. Follow Anthony suggestion vgscan -p -v. Is this disk part of any vg?
5. if run pvcreate -f /dev/rdsk/c0t15d0 (use raw device). What is the output?
6. If you can see the disk claimed, is not part of any vgs, and using pvcreate on raw device is not working, check if you have the following patches:
s700_800 11.00 cumulative SAM/ObAM patch(PHCO_19047)
s700_800 11.00 LVM commands cumulative patch(PHCO_20870)
s700_800 11.00 autox0 cumulative patch(PHKL_15955)
s700_800 11.00 fix race conditions in UP emulation(PHKL_16209)
s700_800 11.00 Invalid I/O sizes from JFS causes hangs(PHKL_18452)
s700_800 11.00 PM/VM/UFS/async/scsi/io/DMAPI/JFS/perf patch(PHKL_18543)
s700_800 11.00 Fibre Channel Mass Storage Driver Patch(PHKL_20207)
s700_800 11.00 LVM Cumulative patch(PHKL_20419)
Hope this helps. If not, come back with details.
warghade
Occasional Advisor

Re: pvcreate

To find out if PV is a part of VG,

# strings /etc/lvmtab --> shows all VG's entry along with thier PV. If you saw the entry like,

/dev/vgXX
/dev/dsk/c0t15d0

then PV /dev/dsk/c0t1d0 is a part of vgXX.
To remove physical volume /dev/dsk/c0t1d5 from volume group /dev/vgXX:
# vgreduce /dev/vgXX /dev/dsk/c0t1d5

Now try,
# pvcreate -f /dev/rdsk/c0t1d5


I think this should solve your problem.

Good luck.