Operating System - HP-UX
1834936 Members
2273 Online
110071 Solutions
New Discussion

Re: cannot pvcreate for new volume group

 
SOLVED
Go to solution
Michael Cline_1
Occasional Advisor

cannot pvcreate for new volume group

I am running HP-UX 10.20 and have lost some data. When I did a 'bdf -l' I saw that I a volume group was not mounted. I tried to mount -a, but can't. I removed the volume group, but when I try to rebuild it and I get to pvcreate, it tells me the physical volume is already attached to a volume group (even though I've already removed that volume group). Any idea why I can't rebuild the deleted volume group using the same physical volumes? Why does it think they are still attached to a volume group?

Thanks!
Kevin
8 REPLIES 8
Pete Randall
Outstanding Contributor
Solution

Re: cannot pvcreate for new volume group

Kevin,

First be absolutely sure which disk you're working on then use "pvcreate -f".


Pete

Pete
Michael Cline_1
Occasional Advisor

Re: cannot pvcreate for new volume group

What do you mean? do I just type 'pvcreate -f /dev/dsk/c11t4d0' and 'pvcreate /dev/dsk/c11t4d1'?
Geoff Wild
Honored Contributor

Re: cannot pvcreate for new volume group

Actually - pvcreate on rdsk - not dsk.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Anthony Lennan
Valued Contributor

Re: cannot pvcreate for new volume group

Hi Kevin,

Do a strings on /etc/lvmtab and see if there is any reference to the volume group and/or the disk that you've removed.

What commands did you use to remove the volume group?

Also, what errors did you get when you tried to mount the volume group? Make sure that its in /etc/fstab and that the volume group is activated.

Rgds,
Anthony
Jeff Gyurko
Frequent Advisor

Re: cannot pvcreate for new volume group

10.20? Ouch!

"strings /etc/lvmtab" and see what vg it thinks that device belongs to. If you "removed" that vg with vgexport, you would have to force pvcreate those devices to use them again.

If your plan is to re-create then restore the data you should be good to go with the forced pvcreate. If you are looking to recover the data on those devices, don't force pvcreate.

Your first thing would be to figure out whay vg those devices belong to with the strings command above, then report back here.
Devender Khatana
Honored Contributor

Re: cannot pvcreate for new volume group

Hi Kevin,

It seems your information is not updated in /etc/lvmtab file. Just do "strings /etc/lvmtab" and see wheather your vg is listed in it. If yes you have to recreate lvmtab using vgscan command. How did you removed your VG?

HTH,
Devender
Impossible itself mentions "I m possible"
Pete Randall
Outstanding Contributor

Re: cannot pvcreate for new volume group

Kevin,

Maybe you should start with a look at the man page. I quote:

"-f Force the creation of a physical volume (thus deleting any file system or volume manager information present) without first requesting confirmation.

Warning: The -f option should only be used as a last resort to over write file system or volume manager information that cannot properly be removed using the commands designed for that purpose. When invoked with -f, the command does minimal verification, so care should be taken to assure that the disk is not already in use prior to invoking the command."

"EXAMPLES
Create a physical volume on raw device /dev/rdsk/c1t0d0, and force the creation without confirmation:

pvcreate -f /dev/rdsk/c1t0d0"


Pete

Pete
Victor BERRIDGE
Honored Contributor

Re: cannot pvcreate for new volume group

Hi Kevin,
If you are sure they are the disks of the volume group then yes go ahead with pvcreate -f /dev/rdsk...
You need -f because the disk has been used in lvm once so unless you have reformated by some way (I just did last week-end for an entire external subsystem to add to a 10.20...) you will get such message...


All the best
Victor