Operating System - HP-UX
1833289 Members
3035 Online
110051 Solutions
New Discussion

Re: Unable to add new disk to one VG, but able to add to other VG

 
SOLVED
Go to solution
Florian Heigl (new acc)
Honored Contributor

Re: Unable to add new disk to one VG, but able to add to other VG

Don't tell anyone, but I've had 3 or 4 cases where pvcreate -f wouldn't 'wipe it all out'.

The error was the same You got.

I came to first doing a dd over the first 10 mb of the disk or so and doing a regular pvcreate after that.

You might want to give it a try.
yesterday I stood at the edge. Today I'm one step ahead.
Stf
Esteemed Contributor

Re: Unable to add new disk to one VG, but able to add to other VG

# pvcreate -f /dev/rdsk/cxtxdx
# vgextend /dev/vgxx /dev/rdsk/cxtxdx
and then try lvextend -m 1 etc...

Stf
Fred Ruffet
Honored Contributor

Re: Unable to add new disk to one VG, but able to add to other VG

What about using this :
vgscan -v

Regards,

Fred
--

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

Re: Unable to add new disk to one VG, but able to add to other VG

quote "i'm trying to add to the same old VG. but i've removed the entry related to this bad disk before the hdd replacement."

I believe this was your initial problem.

I would do as suggested with vgscan after moving your lvmtab out of the way to see if that clears your problem.



IF that doesnt work, you will need to use the VGREDUCE command with options related to the pvkey to fix your VG.


Here from the man page for VGreduce...
==========================================

Force reduction of missing PVs from volume group: vg01
vgreduce -f /dev/vg01
Removes the physical volume from the volume group when it is still in
the lvmtab file, but it is currently marked as missing from the volume
group: vg01
vgreduce -l /dev/vg01

The following messages will appear after missing PVS has been removed
successfully:

PV with key 0 successfully deleted from vg /dev/vg01

Repair done, please do the following steps.....:

1. Save /etc/lvmtab to another file.

2. Remove /etc/lvmtab.

3. Use vgscan -v to recreate /etc/lvmtab.

4. NOW use vgcfgbackup(1M) to save the LVM setup.
Unix, the other white meat.
Todd McDaniel_1
Honored Contributor
Solution

Re: Unable to add new disk to one VG, but able to add to other VG

First ignore my previous post, I failed to read the whole post first...

Next, This is NOT meant as a criticism, but In the future It is better not to remove any disks from the VG in cases like this. Whenever I have a bad disk I usu hotswap it and then run 3 commands. vgcfgrestore vgchange -ay vgXX and vgsync.


To your problem, I believe you need to use pvremove on the device to completely remove any lvm header from it. then issue pvcreate -f /dev/rdsk/cXtXcX on the disk.

also, I think it would be good to do some maintenance on the VG first. Get the VG stable if it is not already. Then make sure you have wiped the disk properly.

Then add the disk to the original VG.


Unix, the other white meat.
A. Clay Stephenson
Acclaimed Contributor

Re: Unable to add new disk to one VG, but able to add to other VG

Your fundamental problem (if I am reading all this correctly) is that you should have never done a pvcreate at all. If this was a replacement of an existing PV in an existing VG, the correct initial command was vgcfgrestore. Then a "vgchange -a y /dev/vgxx" and finally (if the LVOL's were mirrored) a "vgsync /dev/vgxx". If the LVOL's were not mirrored then you should have created new filesystems, mounted them, and restored from backup.
If it ain't broke, I can fix that.
Madhu_17
Regular Advisor

Re: Unable to add new disk to one VG, but able to add to other VG

How to remove a PV from a disk.

here my problem is i could able to add the same disk to other VG successfully. but i'm facing problem with adding to one particular VG.
Fred Ruffet
Honored Contributor

Re: Unable to add new disk to one VG, but able to add to other VG

You can use pvremove command to remove data structure from disk. This will make disk clean.

After doing that, other point is to know wether PV is still affected to VG. I believe it's already asked but I can't see it : Can you give output for vgdisplay -v vg02 (I believe it's vg02) ?

If you can't see this pv in vg structure, then it's OK. Restart from beginnning of process : pvcreate, vgextend, lvextend.

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
Madhu_17
Regular Advisor

Re: Unable to add new disk to one VG, but able to add to other VG

After adding this problematic disk to the vg02 vg, it's showing stale in lvdisplay 'n' pvdisplay also.
Allocated PE: 1000
Stale PE: 1000

but when i add thid disk to the other VG, it's working fine.

allocated PE: 25
stale PE: 0
Madhu_17
Regular Advisor

Re: Unable to add new disk to one VG, but able to add to other VG

I am using HP-UX 10.20.

I can't see pvremove in my version.
Fred Ruffet
Honored Contributor

Re: Unable to add new disk to one VG, but able to add to other VG

Even if you don't have pvremove, you will have ways to drop the structure (by recreation with pvcreate).

First of all, please provide output of "vgdisplay -v vg02"

and tell me if you issued the "vgscan -v" command. If yes tell me what is output.

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
Madhu_17
Regular Advisor

Re: Unable to add new disk to one VG, but able to add to other VG

now i detached back my problematic disk.

now the vgscan -v o/p is:


/dev/vg02
/dev/dsk/c2t2d0

vgdisplay -v shows only one working disk now.

if i add this problematic disk, it's also visible in vgdisplay.
Fred Ruffet
Honored Contributor

Re: Unable to add new disk to one VG, but able to add to other VG

Do not add it "as is". First do a pvcreate on this problematic disk. If necessary, use -f option. Then try to vgextend vg02 with this new PV.

Rescan vgscan -v

Post output for all those commands.

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
Madhu_17
Regular Advisor

Re: Unable to add new disk to one VG, but able to add to other VG

#pvcreate -f /dev/rdsk/c3t4d0
Physical volume "/dev/rdsk/c3t4d0" has been successfully created.

#vgextend /dev/vg02 /dev/dsk/c3t4d0
Volume group "/dev/vg02" has been successfully extended.
Volume Group configuration for /dev/vg02 has been saved in /etc/lvmconf/vg02.conf

#vgscan -v

/dev/vg02
/dev/dsk/c2t2d0
/dev/dsk/c3t4d0

Fred Ruffet
Honored Contributor

Re: Unable to add new disk to one VG, but able to add to other VG

And now, what about lvextend whith following command :
lvextend -m 1 /dev/vg02/u02 /dev/dsk/c3t4d0

What about output ?

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
Madhu_17
Regular Advisor

Re: Unable to add new disk to one VG, but able to add to other VG

Fred,

I could able to do that lvextend successfully.

Pls find below the o/p

lvextend -m 1 /dev/vg02/u02 /dev/dsk/c3t4d0
The newly allocated mirrors are now being synchronized. This operation will
take some time. Please wait ....
lvextend: Couldn't re-synchronize stale partitions of the logical volume: I/O error
lvextend: Couldn't resynchronize logical volume "/dev/vg02/u02".

lvdisplay showing stale for this disk.
Fred Ruffet
Honored Contributor

Re: Unable to add new disk to one VG, but able to add to other VG

So all this thread to get to this conclusion : Your disk is down :-(

Regards,

Fred
--

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

Re: Unable to add new disk to one VG, but able to add to other VG

Madhu,

I dont see where you ever did a vgcfgrestore to restore the lvm info to the disk.

You MUST do this as a step to restore the mirror.

====================
#vgcfgrestore -n /dev/vg02 /dev/dsk/c3t4d0
====================

You cant resolve the stale extents till you do this. After which you can then vgsync the disk and then add it back in as the mirror.
Unix, the other white meat.
Todd McDaniel_1
Honored Contributor

Re: Unable to add new disk to one VG, but able to add to other VG


Oops I meant to say, vgsync vg02 then lvextend the mirror.
Unix, the other white meat.
Madhu_17
Regular Advisor

Re: Unable to add new disk to one VG, but able to add to other VG

aa