Operating System - HP-UX
1821804 Members
3154 Online
109637 Solutions
New Discussion юеВ

Restore the LVM after pvcreate

 
SOLVED
Go to solution
Trimarchi Rosario
Occasional Contributor

Restore the LVM after pvcreate

Hi all,
I did a "pvcreate -f /dev/rdsk/c3t0d1" which is the alternate path to /dev/rdsk/c5t0d1. After, I vgextend this disk to vg01, but the
system doesn't see this as an alternate link
but instead an individual disk. How can I resolve this problem?
Thanks
6 REPLIES 6
Steven E. Protter
Exalted Contributor

Re: Restore the LVM after pvcreate

You aren't done.

After pvcreate, you need to re-establish your alternate links.

http://docs.hp.com/cgi-bin/fsearch/framedisplay?top=/hpux/onlinedocs/B7660-90010/B7660-90010_top.html&con=/hpux/onlinedocs/B7660-90010/00/00/60-con.html&toc=/hpux/onlinedocs/B7660-90010/00/00/60-toc.html&searchterms=PVLINK&queryid=20030923-121401

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Patrick Wallek
Honored Contributor

Re: Restore the LVM after pvcreate

Are you absolutely sure that c3t0d1 is an alternate link to c5t0d1? If you did a 'pvcreate -f' then you essentially wiped out the config that was there.

To add an alternate link to a VG all you have to do is the 'vgextend'. You don't have to do the pvcreate.

At this point you may have to recreate the VG. As a first step you might try doing a 'vgcfgrestore' to c5t0d1 and then try your 'vgextend' again.
John Poff
Honored Contributor

Re: Restore the LVM after pvcreate

Hi,

Are you sure that c3t0d1 is really the alternate path to c5t0d1? If LVM adds your disk to a volume group and it doesn't come in as an alternate link, it must be another disk.

JP
Sundar_7
Honored Contributor

Re: Restore the LVM after pvcreate

Hi,

I think u did a blunder here.

Was /dev/dsk/c5t0d1 already in the VG01 and U pvcreated and vgextended the /dev/dsk/c3t0d1. ???

Incase of PV links, since both the device files are referring to the same LUN, you should NOT have pvcreated the c3t0d1 but rather just vgextend /dev/vg01 /dev/dsk/c3t0d1.

You have effectively overwritten the PVRA, VGRA & VGDA of c5t0d1.

I am sure all ur LVs of VG01 are dead by now ???

Sundar.
Learn What to do ,How to do and more importantly When to do ?
Kent Ostby
Honored Contributor
Solution

Re: Restore the LVM after pvcreate

The problem is that you should have have done a pvcreate on the disk before the vgextend.

Here is what I would do to fix the issue.

1) cd /etc/lvmconf
2) cp vg01* /tmp
(save these before we start making changes)
3) vgreduce /dev/vg01 /dev/dsk/c3t0d1
4) vgcfgrestore -f /tmp/vg01.conf.old /dev/dsk/c5t0d1

Then proceed to do the extending of the alternate linking with vgextend without doing anything with pvcreate.

Best regards,

Kent M. Ostby
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
Helen French
Honored Contributor

Re: Restore the LVM after pvcreate

When creating a PV links, you don't need to run pvcreate. In your case, if the disk had data in it, you might have erased that too. All you have to do is 'vgextend'. The pvcreate should be done only when you create the primary disk. For adding alternative path, just do vgextend and that will update the VG information for that disk.
Life is a promise, fulfill it!