1830241 Members
3050 Online
109999 Solutions
New Discussion

Re: pvcreate fail

 
ehab_4
Occasional Advisor

pvcreate fail

I have clustered env.
I had created a volume group on one node, then i exported to a map file
on the other node i tried to pvcreate the pv's
releated to that volume group it gave me error
pvcreate: pv belongs to a volume group
it is not in the LVMTAB
I had tried pvcreate -f /dev/rdsk/cxtxdx
it corrupted the volume group on the other node
what i am missing to start the volume group in shared mode
14 REPLIES 14
Denver Osborn
Honored Contributor

Re: pvcreate fail

No need to pvcreate it on the other node, it's a shared volume. All you need to do is create a map on the original node and copy the map to the other node where you will vgimport.

node1:
vgexport -p -v -s -m /tmp/vgname.map /dev/vgname
copy map to other node

node2:
mkdir /dev/vgname
mknod /dev/vgname/group c 64 0x??0000
(where 0x??0000 is same number from ll /dev/vgname/group on original node)
vgimport -v -s -m /tmp/vgname.map /dev/vgname


hope this helps,
-denver
Denver Osborn
Honored Contributor

Re: pvcreate fail

almost forgot... to fix your problem go to the original node and vgcfgrestore.

vgcfgrestore -n vgname /dev/rdsk/cXtXdX

-denver
ehab_4
Occasional Advisor

Re: pvcreate fail

I had done the vgimport -s on the second node
but it stayed for long time idel for all most one hour.
ps. number of disks in the original volume group is 56
I had created the original vg again
Robert_Jewell
Honored Contributor

Re: pvcreate fail

Just to add a bit...

pvcreate is used to take a physical volume (a disk) and make it usable for LVM. Since the PV is already setup for LVM and is shared, there is no need to run the command again.

-Bob
----------------
Was this helpful? Like this post by giving me a thumbs up below!
ehab_4
Occasional Advisor

Re: pvcreate fail

then why it is not imported
I had used the syntex as this
vgimport -s -v -m vg_new.map vg_new
ehab_4
Occasional Advisor

Re: pvcreate fail


More information I would like to give you,
The storage I have is DELL/EMC Cx700
and i am using power path for load balancing
Robert_Jewell
Honored Contributor

Re: pvcreate fail

You mention that the vgimport command hung on you. Did you get any errors logged to the message buffer (dmesg) or syslog? This may indicate a bad PV.

Some other data may be useful:

vgdisplay -v vgname
pvdisplay pv_device_name
strings /etc/lvmtab

-Bob
----------------
Was this helpful? Like this post by giving me a thumbs up below!
Denver Osborn
Honored Contributor

Re: pvcreate fail

In that case, create in infile with only one PV path. Try to import using the infile.

node1:
vgdisplay -v /dev/vgname |grep /dev/dsk |grep -v Alternate |awk '{print $NF}' > /tmp/vginfile.txt
confirm contents and copy the infile to node2

node2:
same mkdir, mknod as before...
vgimport -v -f /tmp/vginfile.txt /dev/vgname

Hope this helps,
-denver
ehab_4
Occasional Advisor

Re: pvcreate fail

no it does not give errors in syslog file
just the command hangs for more than hour
Denver Osborn
Honored Contributor

Re: pvcreate fail

sorry... forgot you'll need the map file also to import using your infile.

vgimport -v -m /tmp/vgname.map -f /tmp/vginfile.txt /dev/vgname

If you have a large number of luns attached the import with -s could take a long time to complete... using the infile should help.

-denver
ehab_4
Occasional Advisor

Re: pvcreate fail

Hi,
I am tring this now but for more than half hour the command did not give any output
just hangs
the pv's are 56
8 GB each
Robert_Jewell
Honored Contributor

Re: pvcreate fail

How about any other LVM command, like vgdisplay? Do they operate as expected? You have a large amount of data/PV's to address, but I agree that 30 minutes+ is not to be expected.

-bob
----------------
Was this helpful? Like this post by giving me a thumbs up below!
ehab_4
Occasional Advisor

Re: pvcreate fail

thank you it is imported
Robert_Jewell
Honored Contributor

Re: pvcreate fail

I am glad to see you got your VG imported.

How about some clarification on whether Denver or my responses helped at all? The point system is designed to show just that. Even a point of 1 will show that while we took the time to respond the recommendation didnt work. You took the time to close the thread, how about taking the 30 seconds more and submit points for our resonses?

Thank you.

-Bob
----------------
Was this helpful? Like this post by giving me a thumbs up below!