1832652 Members
3132 Online
110043 Solutions
New Discussion

VG/Disk/LVM recreate

 
SOLVED
Go to solution
joe_91
Super Advisor

VG/Disk/LVM recreate

we lost one of the 2 disks attached to vg04. I have a new disk now. I have to redo the VG03/lvol etc..Pl let me know if the foll process is OK.. The current lvol name is /dev/vg04/orcl.

1. lvremove -f /dev/vg04/orcl

2. vgremove /dev/vg04

3. mkdir /dev/vg04

4. mknod /dev/vg04/group c 64 0x090000 (i do not have this minor number)

3. pvcreate /dev/rdsk/c0t9d0 (these are 2 disks)

4. pvcreate /dev/rdsk/c0t10d0

5.vgcreate /dev/vg04 /dev/dsk/c0t9d0 /dev/dsk/c0t10d0

6. lvcreate -L 4000 /dev/vg04/orcl (to create a Lvol named orcl for 4 Gig.)

7. frecover -x -i /opt/oracle -f /dev/rmt/0m (since i have a fbackup i am frestoring)

Pl let me know if this is OK.

Thanks

Joe.
9 REPLIES 9
joe_91
Super Advisor

Re: VG/Disk/LVM recreate

one last step would be a "mountall" as i currently have the same lvol name and mount point in fstab.

Thanks

Joe.
generic_1
Respected Contributor

Re: VG/Disk/LVM recreate

http://docs.hp.com/en/5991-1236/When_Good_Disks_Go_Bad.pdf

This doc has it all. I would imagine your node and vgdir exist on vg00 already. I am a little confused about your directions too because you talk about a damaged volume in vg03 but talk about rebuilding vg04. Your commands look valid, but I dont think all are needed. Also I think you might have more to restore depending how many volume groups and LVs you lost. If your oracle filesystem was not raw you will need an fsadm command to format a fileystem and you will want to doublecheck your /etc/fstab, also again asuming your oracle is not raw. Do an ioscan and and insf -e then ioscan -fnC disk and make sure your new disk shows up as claimed.

I would highly suggest you start mirroring your disks. This is also talked about in the directions above. The document is very step by step
joe_91
Super Advisor

Re: VG/Disk/LVM recreate

sorry..that was a typo. it is VG04 that needs to be rebuild

Thanks

Joe.
joe_91
Super Advisor

Re: VG/Disk/LVM recreate

PLEASE HELP..

This is what happened..

two disks (c0t9d0 and c0t10d0) belonged to vg04 which has only one lvol(/dev/vg04/orcl). c0t9d0 went bad and was replaced and i have a new disk and it shows up in ioscan. now i also have a backup from which i can restore the /opt/oracle filesystem (/dev/vg04/orcl mounted on /opt/oracle). Please let me know the steps. Are my earlier steps OK?

Thanks

Joe.
Kent Ostby
Honored Contributor

Re: VG/Disk/LVM recreate

That would probably work, but it seems a little long.

I would do:

1) pvcreate /dev/dsk/newdisk
2) vgcfgrestore -n /dev/vg04 /dev/dsk/newdisk
3) newfs /dev/vg04/rorcl
4) mountall
5) restore data
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
Giri Sekar.
Trusted Contributor
Solution

Re: VG/Disk/LVM recreate

Joe:

the steps..

1.vgcfgrestore -n /dev/vg04 /dev/rdsk/c0t9d0 (restore LVM headers on new disk)

2. vgchange -a y /dev/vg04 (activate the vg04)

3. vgdisplay /dev/vg04 (your Cur PV and Act PV should both be 2)

4. lvdisplay -v /dev/vg04/orcl|more (you should see both the disks in Distribution of L vol)

5. pvdisplay -v /dev/dsk/c0t9d0 |more (you shd see only /dev/vg04/orcl in Distribution of P vol)

6. more /etc/fstab (check to make sure largefiles are not enabled in /dev/vg04/orcl)

7. newfs -F vxfs /dev/vg04/rorcl (if largefiles use the -o largefiles option)

8. mount -a

9. bdf (you should see the /opt/oracle now with 0%)



Thanks

Giri Sekar.
"USL" Unix as Second Language
Devender Khatana
Honored Contributor

Re: VG/Disk/LVM recreate

Hi,

I agree with this. You do not require to recreate the VG & LV here.

#pvcreate -f /dev/rdsk/c0t9d0
1. vgcfgrestore -n /dev/vg04 /dev/rdsk/c0t9d0
2. vgchange -a y /dev/vg04
3. vgdisplay -v /dev/vg04
4. lvdisplay -v /dev/vg04/orcl|more
5. pvdisplay -v /dev/dsk/c0t9d0 |more
6. more /etc/fstab
7. newfs -F vxfs /dev/vg04/rorcl
8. mountall
9. bdf

Please let us know any errors encountered with these steps.

HTH,
Devender
Impossible itself mentions "I m possible"
joe_91
Super Advisor

Re: VG/Disk/LVM recreate

Thanks Giri. Perfect lesson. I have it restored and the data is being ported in from the tape. What a forum!!!!! Hats Off.

Best Regards

Joe.
joe_91
Super Advisor

Re: VG/Disk/LVM recreate

Thanks.

Joe