Operating System - HP-UX
1833875 Members
1863 Online
110063 Solutions
New Discussion

Re: Problem with pvcreate

 
SOLVED
Go to solution
Simon R Wootton
Regular Advisor

Problem with pvcreate

I'm using SAM to create VG's & LVOL's. When trying to create a volume group using a couple of 4Gb disks, I'm getting the message :

'pvcreate : The physical volume /dev/dsk/c0t3d0 is already recorded in the /etc/lvmtab file'

I have removed all existing filesystems and volume groups.

I'm also getting an error when trying to create 'vg03', this is saying that vg03 is already in use - I'm sure it isn't. Please help !
11 REPLIES 11
Joseph C. Denman
Honored Contributor
Solution

Re: Problem with pvcreate

Simon,

You must still have some entries in your lvmtab. Try recreating it.

mv /etc/lvmtab /etc/lvmtab.bak
vgscan

vgscan will recreate the lvmtab.

Then attempt to create the vg again.

Hope this helps.

...jcd...
If I had only read the instructions first??
Christopher McCray_1
Honored Contributor

Re: Problem with pvcreate

Hello,

do a strings /etc/lvmtab to ensure that the disk in question isn't there. Use the vgreduce command to take the disk out of the vg if necessary.

do an ll /dev/*/group and see if vg03 is really there or not. Secondly, make sure it isn't and important VG in use, but not activated. Use vgexport to remove the VG.

Use pvcreate again. If it complains that the PV already belongs to an existing VG, use the -f option, but use extreme caution and make sure this is what you want to do.

Hope this helps

Chris
It wasn't me!!!!
Uday_S_Ankolekar
Honored Contributor

Re: Problem with pvcreate

Hello,

Check with strings /etc/lvmtab and see these volume groups are recorded in there.

If yes you need check what vg these physical disks belongs and being used or not.
If not try vgscan to recreate lvmtab.

You can also try using pvcreate -f /dev/rdsk/cxtydz from command line if you are sure these disks are not belongs to any volume group.

Goodluck
-USA..
Good Luck..
S.K. Chan
Honored Contributor

Re: Problem with pvcreate

Recreate your "lvmtab" file to see if it helps ..
# cd /etc
# mv lvmtab lvmtab.org
# vgscan -v

Does "strings /etc/lvmtab" still shows vg03 in it ? If you're sure c0t3d0 is not used in any of your volume group you can "force" pvcreate it.
# pvcreate -f /dev/rdsk/c0t3d0
V. V. Ravi Kumar_1
Respected Contributor

Re: Problem with pvcreate

hi,
backup lvmtab.
run vgscan with the present situation, then see what is the content of lvmtab. if ur problem disk is still listed in lvmtab, i doubt a reboot may solve the problem.
regds
Never Say No
MANOJ SRIVASTAVA
Honored Contributor

Re: Problem with pvcreate

Simon


there are 2 ways to do it .

1.mv /etc/lvmtab to /etc/lvmtab.old and than doa vgscan -a and try creating vg03 using ther disk .

2. or use a differnt vgname like vg05 etc .

It looks that the lvmtab has information which is conflicting .

You can also use sam to do the job.

Manoj Srivastava
James R. Ferguson
Acclaimed Contributor

Re: Problem with pvcreate

Hi Simon:

In addition to the advice already offered, you indicated that you "removed all existing filesystems and volume groups" before you attempted to reuse the physical volume(s).

Did you 'vgreduce' all physical volumes but the last and 'vgremove' the last?

A quick, clean way to destroy a volume group, remove '/dev/vgXX' files and insure that the 'etc/lvmtab' configuration is consistent is to 'vgexport' the volume group you no longer want.

Then, since the volume group (VGID) remains on the physical disk, do a 'pvcreate -f' to erase it.

Regards!

...JRF...
George Petrides_1
Honored Contributor

Re: Problem with pvcreate

Can you attach the output of 'strings /etc/lvmtab' here so we can all give you a more educated answer?
Simon R Wootton
Regular Advisor

Re: Problem with pvcreate

Thanks for everyone's help so far. Output of /etc/lvmtab as requested :

/dev/vg01
Y(==q
/dev/dsk/c0t1d0
/dev/vg07
Y(==r
/dev/dsk/c0t12d0
/dev/dsk/c1t12d0
/dev/vg02
Y(==r
/dev/dsk/c0t13d0
/dev/vg04
Y(==rK
/dev/dsk/c0t14d0
/dev/vg00
/dev/dsk/c0t15d0
/dev/dsk/c1t15d0
/dev/vg05
Y(==r
/dev/dsk/c1t1d0
/dev/dsk/c1t2d0
/dev/dsk/c1t3d0
/dev/dsk/c1t6d0
/dev/vg08
Y(==s*
/dev/dsk/c1t13d0
/dev/dsk/c1t14d0
/dev/dsk/c2t1d0
/dev/dsk/c2t2d0
/dev/dsk/c2t3d0
/dev/dsk/c2t4d0
Simon R Wootton
Regular Advisor

Re: Problem with pvcreate

Sorry, forgot to mention - I have created a few filesystems since the original message, but still getting the errors described. When trying to create vg03, it's saying that there is a problem with the minor number (?).
George Petrides_1
Honored Contributor

Re: Problem with pvcreate

OK, the minor number of the group is the problem. Each volume group has a special file called /dev/vgXX/group which has a major number (the LVM subsystem in the kernel) and a UNIQUE minor number that indentifies the group. What you need to do, is ll /dev/vg*/group, look at the minor numbers e.g. 0x010000 and then do rm /dev/vg03/group and create a new file with a different minor number. e.g. mknod /dev/vg03/group c 64 0x070000. However, keep in mind that the first two digits after the 'x' is hexadecimal. Now, regarding disk c0t3d0 it is obvious that this device file is not recorded in your lvmtab, however, it might be an alternate path. Are you using PVLINKS? Do you 'see' the same physical disks twice? You could try adding the c0t3d0 disk to the other existing volume groups, just to see the result e.g. vgextend /dev/vg01 /dev/dsk/c0t3d0 and go through each group until one group accepts the disk. Then do a vgdisplay -v /dev/vgXX | grep dsk on that group and look for the disk if it's an alternate path. If all groups accept the disk, then we have a different problem and you might need to recreate your lvmtab. In any case, do not use pvcreate -f on that disk unless you are 100% sure it's a free disk!!!
George