Operating System - HP-UX
1833772 Members
2262 Online
110063 Solutions
New Discussion

Mirror disk pvcreate -B error: The physical volume already belongs to a volume group

 
SOLVED
Go to solution
Gary L
Super Advisor

Mirror disk pvcreate -B error: The physical volume already belongs to a volume group

Hi

I have been doing the task of rebuild a rp4440 server as OS went bad couple weeks ago. I have done the OE (HP-UX 11i v1) installation and complete install the Mirror_disk/UX.
There are two physical HDs in this box
0/1/1/0.1.0 /dev/rdsk/c2t1d0 -- primary boot root disk
0/1/1/0.0.0 /dev/rdsk/c2t0d0 -- wanna configure it as alternate boot root disk
I have configured c2t1d0 as primary root disk and installed the OE … into it. I'm going to configure c2t0d0 as alternate boot root disk. But when I run command # pvcreate -B /dev/rdsk/c2t0d0 I got below error message
"pvcreate: The physical volume already belongs to a volume group".
# vgscan
Following Physical Volumes belong to one Volume Group.
Unable to match these Physical Volumes to a Volume Group.
Use the vgimport command to complete the process.
/dev/dsk/c2t0d0
But when I run
# vgimport /dev/vg00 /dev/dsk/c2t0d0
vgimport: Volume group "/dev/vg00" already exists in the "/etc/lvmtab" file.
# vgextend /dev/vg00 /dev/dsk/c2t0d0
vgextend: Couldn't install the physical volume "/dev/dsk/c2t0d0".
Device busy
I have tried pvremove, it didn't work...

How to remove old configurations of c2t0d0 and how to remove/delete all the data on c2t0d0? I need a fresh new c2t0d0 like a new HD in order to use it configure as AlterNet boot root disk.

Thanks a lot any answers will be very appreciate.

-Gary
5 REPLIES 5
Johnson Punniyalingam
Honored Contributor
Solution

Re: Mirror disk pvcreate -B error: The physical volume already belongs to a volume group

# vgdisplay -v /dev/vg00 |more --> check wether ""/dev/dsk/c2t0d0" exist ..?

# cp -pi /etc/lvmtab /etc/lvmtab.old

# mv /etc/lvmtab /etc/lvmtab.

# /usr/sbin/vgscan -v

# strings /etc/lvmtab --> look weather disk /dev/dsk/c2t0d0" still exists

if not

# pvcreate -fB /dev/rdsk/c2t0d0

# vgextend /dev/vg00 /dev/dsk/c2t0d0

Thanks,
Johnson

Problems are common to all, but attitude makes the difference
Gary L
Super Advisor

Re: Mirror disk pvcreate -B error: The physical volume already belongs to a volume group

Hi Johnson

Thanks you very much for your fast reply and detail steps.

I know the reason why c2t0d0 existing, because that HD contains the old data, I'm going to rebuid this server, but I have no idea how to remove the old data on those two HDs (like format on windows). OE installation process deleted/covered the old data on c2t1d0.

I will try # pvcreate -fB to force create see if it works.

Thanks again.

-G
Gary L
Super Advisor

Re: Mirror disk pvcreate -B error: The physical volume already belongs to a volume group

option -f force pvcreate works.

I have done the mirror disk job.

Thanks a lot.

Q: How to "format" or delete all the data on a HD like c2t0d0.

Thanks.

-G

R.K. #
Honored Contributor

Re: Mirror disk pvcreate -B error: The physical volume already belongs to a volume group

Hi Gary,

Normally we NEVER "format" any disk. We simply do a vgexport to remove all information about the VG and LVOLs and then reuse the disk for any other VG (by pvcreate and vgcreate) that will ultimately overwrite the data.

If you still wants to format or rather destroy the data (by overwriting by zeroes) on the disk, use below command:

#dd if=/dev/zero of=/dev/rdsk/c2t0d0 bs=1024k

-R.K.$
Don't fix what ain't broke
Gary L
Super Advisor

Re: Mirror disk pvcreate -B error: The physical volume already belongs to a volume group

Hi R.K.$

Thanks for your good answer.

Have a good day.

-Gary