Operating System - HP-UX
1833788 Members
2076 Online
110063 Solutions
New Discussion

Mirroring root disk "Physical volume already belongs to a volume group"

 
SOLVED
Go to solution
David_616
New Member

Mirroring root disk "Physical volume already belongs to a volume group"

Hello all,

I´m triying to mirror our Boot disk, using "pvcreate -B /dev/rdsk/c2t2d0".

It returns the following error "pvcreate: The physical volume already belongs to a volume group"

I have readed that I must use the "-f" to force it, but I´m afraid I could be wrong, "/dev/rdsk/c2t2d0" being the OS disk, and broke our system.

On the attachment file I have written the sentences I think I must use and the output of ioscan and pvdisplay.

Thank you very much in advance for your time and h
8 REPLIES 8
Fred Ruffet
Honored Contributor

Re: Mirroring root disk "Physical volume already belongs to a volume group"

If you want to be sure, you could do a
vgdisplay -v |grep c2t2d0
and it should provide no line.
This should make you sure it isn't used.
--

"Reality is just a point of view." (P. K. D.)
Geoff Wild
Honored Contributor

Re: Mirroring root disk "Physical volume already belongs to a volume group"

strings /etc/lvmtab |grep c2t2d0

If yes - then it is already in a VG on your system...

Or try pvdisplay:

pvdisplay /dev/dsk/c2t2d0


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.
Sanjay_6
Honored Contributor
Solution

Re: Mirroring root disk "Physical volume already belongs to a volume group"

Looks like c2t2d0 was used in another system where there was a vg configured on it.

you can force it by using -f with the pvcreate command. However check and make sure it is not listed in lvmtab,

strings /etc/lvmtab |grep c2t2d0

If you don't get anything back, that means it is not configured on this system. So you can extend the vg00 on this disk after doing a pvcreate.

Added some steps to your plan, added lvlnboot commands

pvcreate -B /dev/rdsk/c2t2d0
vgextend /dev/vg00 /dev/dsk/c2t2d0
mkboot /dev/dsk/c2t2d0
mkboot -a "hpux -lq" /dev/rdsk/c2t2d0
lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c2t2d0
lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c2t2d0
lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c2t2d0
lvextend -m 1 /dev/vg00/lvol4 /dev/dsk/c2t2d0
lvextend -m 1 /dev/vg00/lvol5 /dev/dsk/c2t2d0
lvextend -m 1 /dev/vg00/lvol6 /dev/dsk/c2t2d0
lvextend -m 1 /dev/vg00/lvol7 /dev/dsk/c2t2d0
lvextend -m 1 /dev/vg00/lvol8 /dev/dsk/c2t2d0
lvlnboot -r /dev/vg00/lvol3
lvlnboot -b /dev/bh00/lvol1
lvlnboot -s /dev/vg00/lvol2
lvlnboot -d /dev/vg00/lvol2
lvlnboot -R

Hope this helps.

Regds
Ashwani Kashyap
Honored Contributor

Re: Mirroring root disk "Physical volume already belongs to a volume group"

Do a
#strings /etc/lvmtab | grep c2t2d0

If you get c2t2d0 then it really belongs to a volume group that is recorded in the lvmtab .

Jeff Schussele
Honored Contributor

Re: Mirroring root disk "Physical volume already belongs to a volume group"

Hi David,

Others have showed you how to check if it's in use on this system. BUT I would caution you to insure that it's not in use by another system that may be connected to whatever disk subsystem it's in.
Better safe than sorry....

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
A. Clay Stephenson
Acclaimed Contributor

Re: Mirroring root disk "Physical volume already belongs to a volume group"

There is not quite enough data here to be sure that this is safe. You need to do a vgdisplay -v and see if the disk is listed. You can also do a "strings /etc/lvmtab" and see if the disk is listed.

This is still not quite enough because it is convievable that the disk might be used as a raw device but not under LVM --- it's not common but it can be done. Also, make sure the disk is not under VxVM.

Also, if this is a shared disk (e.g. a Service Guard cluster) then you need to make the same checks on all nodes which have physical access to this disk.

After you assure yourself that the disk is not in use then all you need to do is add -f to your existing pvcreate.

I would also make a change to your mkboot -a (simply because I don't completely trust defaults).

mkboot -a "hpux -lq (;0)/stand/vmunix" /dev/rdsk/cXtYdZ

You should also add an
lvlnboot -R /dev/vg00
at the end of your script.

Man lvlnboot for details.
If it ain't broke, I can fix that.
SS_6
Valued Contributor

Re: Mirroring root disk "Physical volume already belongs to a volume group"

Hi David, Its a standard when you use a disk which was a part of some other volume group. You will not get this error when we use disk very first time. Do the following to make sure that disk is no more a part of any VG.
#strings /etc/lvmtab|grep dev/dsk/c2t2d0
#vgdisplay -v |grep /dev/dsk/c2t2d0
#pvdisplay /dev/dsk/c2t2d0
Once you are sure, use the -f option
#pvcreate -f -b /dev/rdsk/c2t2d0



By providing solutions I am helping myself
David_616
New Member

Re: Mirroring root disk "Physical volume already belongs to a volume group"

Hello all,

Thank you very much for your responses. I didn´t thougth this would be so fast.

My primary question is solved, c2t2d0 not being my OS disk.

I think it´ll be better to open another message asking for help to clarify my script, but I should see through the manual before.

¡¡Thank you very much