1752802 Members
5374 Online
108789 Solutions
New Discussion юеВ

Re: mistake

 
SOLVED
Go to solution
Olivier Drouin
Trusted Contributor

mistake

Hi,
I destroyed logical volume informations on an array. the array was seen by 2 machines. one pv was used by one machine so it was "unused" on the other. I configured the pv as a lv on the other machines. I have data backup but I cant go back to my previous settings. Any informations on how I could do this ?

The volume group is deactivated.

bash-2.03# vgremove vgapps /dev/dsk/c3t1d0
vgremove: Volume group not activated.

bash-2.03# pvremove /dev/rdsk/c3t1d0
pvremove: The physical volume "/dev/rdsk/c3t1d0" belongs to volume group "/dev/vgapps".
pvremove: Couldn't remove physical volume "/dev/rdsk/c3t1d0".


4 REPLIES 4
Michael Tully
Honored Contributor

Re: mistake

To clean this up properly you need to remove the volume group and re-create it. You can then after re-creating it, restore your data from your backup.

# vgexport /dev/vgapps

You can't use 'pvremove' if the volume belongs to a volume group. The man pages for 'pvremove' states this.

Regards
Michael
"When I have trouble spelling, it's called fat finger syndrome"

Anyone for a Mutiny ?
Olivier Drouin
Trusted Contributor

Re: mistake

Thanks,
I still have troubles when trying to import the volume group since it is not activated. I dont seem to be able to do anything with it.

bash-2.03# vgimport -m vgapps.map -p -v vgapps
Beginning the import process on Volume Group "vgapps".
vgimport: Volume group "/dev/vgapps" already exists in the "/etc/lvmtab" file.


bash-2.03# vgremove /dev/vgapps
vgremove: Volume group not activated.

and if I try to activate it...the lost logical volumes info is the trouble.

bash-2.03# vgchange -a y /dev/vgapps
vgchange: Warning: Couldn't attach to the volume group physical volume "/dev/dsk/c3t1d0":
Cross-device link
vgchange: Warning: Couldn't attach to the volume group physical volume "/dev/dsk/c5t0d0":
Cross-device link
vgchange: Warning: couldn't query physical volume "/dev/dsk/c3t1d0":
The specified path does not correspond to physical volume attached to
this volume group
vgchange: Warning: couldn't query physical volume "/dev/dsk/c5t0d0":
The specified path does not correspond to physical volume attached to
this volume group
vgchange: Warning: couldn't query all of the physical volumes.
vgchange: Couldn't activate volume group "/dev/vgapps":
Quorum not present, or some physical volume(s) are missing.


Regards,
Olivier.
Michael Steele_2
Honored Contributor
Solution

Re: mistake

a) vgcfgrestore -n /dev/vg## /dev/rskk/c#t#d#
vgchange -a y /dev/vg##

b) Verify disks

strings /etc/lvmtab

-and-

vgcfgrestore -f /etc/lvmconf/vg##.conf -l

c) Ghost disk procedure

Is 'quorum not present' when you:

vgchange -a y /dev/vg##

..then..

vgchange -a y -q n /dev/vg##

vgreduce -f /dev/vg## (* force out missing PV *)

d) Recovery of data when no vg but pv. Use -s option in vgexport and vgimport. The -s option will cause all pv's to report in.

vgexport -p -v -s -m /tmp/vg##_mapfile /dev/vg##
(* -p preview *)

mkdir /dev/vg##
mknod /dev/vg##/group c 64 0x0#0000
vgimport -s -p -m /tmp/vg##_mapfile /dev/vg##
(* -p preview *)

Support Fatherhood - Stop Family Law
Olivier Drouin
Trusted Contributor

Re: mistake

Thanks you guys.

I was able to recover the data even if a fs was created over.
The procedure is a bit different than michael ( I recover directly from the pv).

# verify if configuration still there
$ vgcfgrestore -n vgapps -l
$ strings /etc/lvmtab


# restore configuration
$ vgcfgrestore -n vgapps /dev/rdsk/c3t1d0

# re-active volume group
$ vgchange -a y vgapps

# check if corrent
$ vgdisplay -v vgapps

#recreate /etc/mnttab
$ rm mnttab
$ mount -v


#remount everything that was in the lv

#fsck the affected LVs
fsck -F hfs /dev/vgapps/lvol
fsck -F vxfs /dev/vg/lvolo
...