1820219 Members
3912 Online
109620 Solutions
New Discussion юеВ

About vgcfgrestore

 
SOLVED
Go to solution
Eric Antunes
Honored Contributor

About vgcfgrestore

Hi,

Will "vgcfgrestore -n /dev/EVA00 /dev/rdsk/c6t0d1" restore /dev/EVA00/disc4 file that was damaged by mistake?

Thanks,

Eric
Each and every day is a good day to learn.
14 REPLIES 14
Robert-Jan Goossens_1
Honored Contributor

Re: About vgcfgrestore

Hi Eric,

No it will not restore the device file, this will restore the LVM (VolumeGroup) information to the disk.

If the device file has been altered/removed you can use the mknod or the insf -e "hardwarpath" to recreate the device file.

Regards,
Robert-Jan
Jozef_Novak
Respected Contributor

Re: About vgcfgrestore

Hello Eric,

vgcfgrestore restores the LVM Physical volume header onto the target disk. This enables recovery of a lost LVM configuration but not of any data.

J.
Fabio Ettore
Honored Contributor

Re: About vgcfgrestore

Hi Eric,

vgcfgrestore restores LVM configuration from file, no data which has to be restored by a backup. Hope you have that.

Best regards,
Fabio
WISH? IMPROVEMENT!
Eric Antunes
Honored Contributor

Re: About vgcfgrestore

The data was not really important: just archivelogs.

What I really want is to restore the logical volume "/disc4" availability, if it is possible.

I already executed the "insf -e -H hw-path" but fsck returns the following:

fsck -F vxfs /dev/rdsk/c4t0d3
vxfs fsck: not a valid vxfs file system
invalid super-block
vxfs fsck: cannot initialize aggregate
file system check failure, aborting ...
Each and every day is a good day to learn.
Eric Antunes
Honored Contributor

Re: About vgcfgrestore

Maybe a full check "fsck -F vxfs -ofull,nolog /dev/rdsk/c4t0d3" will work?
Each and every day is a good day to learn.
Jozef_Novak
Respected Contributor

Re: About vgcfgrestore

Hello Eric,

the physical volume /dev/rdsk/c4t0d3 does not contain a filesystem directly, since it is configured in LVM. Get the list of logical volumes from dev/EVA00 by running:

# vgdisplay -v dev/EVA00

Then select the logical volume that you want to repair and run:

# fsck -F vxfs /dev/EVA00/disc4 ,for example

Hope this helps,
J.



Ganesan R
Honored Contributor

Re: About vgcfgrestore

Hi Eric,

If the LVM header has been accidently overwritten or became corrupted on the disk you can recover it from the backup file using vgcfgrestore.

# vgcfgrestore -n vgXY /dev/rdsk/c1t6d0

But keep in mind this before restore the headers.

vgcfgrestore cannot be performed on devices attached to activated volume groups. Prior to restoring a backup configuration to a disk, detach the PV from the volume group using the pvchange(1M) command, or deactivate the volume group using the vgchange(1M) command.

So either you need to detach the pv from the VG or deactivate the VG before use vgcfgrestore on that disk.
Best wishes,

Ganesh.
Robert-Jan Goossens_1
Honored Contributor

Re: About vgcfgrestore

Hi Eric,

--
"fsck -F vxfs -ofull,nolog /dev/rdsk/c4t0d3"
--

Only if you have created a filesystem on the complete disk.

# fsck -F vxfs -o full,nolog /dev/vgxx/lvoly

Regards,
Robert-Jan
Eric Antunes
Honored Contributor

Re: About vgcfgrestore

Hi,

Full fsck did not work:

fsck -F vxfs -y -ofull /dev/EVA00/disc4
vxfs fsck: OLT extent 0 has bad magic
read of primary OLT failed
vxfs fsck: OLT extent 1 has bad magic
read of OLT copy failed
vxfs fsck: no valid OLT, cannot continue
file system check failure, aborting ...
Each and every day is a good day to learn.
Eric Antunes
Honored Contributor

Re: About vgcfgrestore

Yes, c4t0d3 had only /disc4.

The same result with -ofull,nolog:

fsck -F vxfs -n -ofull,nolog /dev/EVA00/disc4
vxfs fsck: OLT extent 0 has bad magic
read of primary OLT failed
vxfs fsck: OLT extent 1 has bad magic
read of OLT copy failed
vxfs fsck: no valid OLT, cannot continue

The use of nolog option is only relevant for clean (empty?) filesystems, right?
Each and every day is a good day to learn.
Ganesan R
Honored Contributor
Solution

Re: About vgcfgrestore

Hi Eric,

Few questions.

If the disk failed or LVM headers corrupted first you need to restore the LVM headers into the disk. Have you restored?

This restoration just update LVM headers not file system structures. You have two options here.

1. If all the data on the problematic disk was mirrored, you do not have to do anything; LVM automatically synchronizes the data on the disk with the other mirror copies of the data.

2.If the disk contained any unmirrored logical volumes (or mirrored logical volumes that did not have a current copy on the system), restore the data from backup, mount the file systems

If you are in option two, follow these steps.

# -> if necessary
# vgcfgrestore ├в n vg01 /dev/rdsk/c2t2d0
# vgchange ├в a y vg01
# newfs [options] /dev/vg01/rlvol1
# mount /dev/vg01/lvol1 /dump
#

fsck is not going to work unless you have created the filesystem onto the disk.
Best wishes,

Ganesh.
Eric Antunes
Honored Contributor

Re: About vgcfgrestore

Ganesan:

I will try this tonight with the volume group inactivated (the manual says that, preferably the volume group should be made unavailable before run this command):

#vgchange -a n /dev/EVA00
#vgcfgrestore -n /dev/EVA00 /dev/rdsk/c4t0d3 (this is the right raw device path name)
#vgchange -a y /dev/EVA00
#newfs ...

Thank you,

Eric Antunes


Each and every day is a good day to learn.
Avinash20
Honored Contributor

Re: About vgcfgrestore

"The data was not really important: just archivelogs. "

If the disk is Ok then I would advice to recreate the FS. You need to restore the data again !!

# newfs -F vxfs /dev/
"Light travels faster than sound. That's why some people appear bright until you hear them speak."
Eric Antunes
Honored Contributor

Re: About vgcfgrestore

Hi,

Ganesan' solution worked:

#vgchange -a n /dev/EVA00
#vgcfgrestore -n /dev/EVA00 /dev/rdsk/c4t0d3 (this is the right raw device path name)
#vgchange -a y /dev/EVA00
#newfs -F vxfs -o largefiles /dev/EVA00/rdisc4

Thank you,

Eric Antunes
Each and every day is a good day to learn.