How to replay a metasave of a VxFS file system by using a sparse volume

Article: 100009597
Last Published: 2013-06-13
Ratings: 1 0
Product(s): InfoScale & Storage Foundation

Problem

This article contains a procedure for replaying a metasave of a VxFS file system by using a sparse volume.

Solution

 

This article is a part of a set on troubleshooting file system corruption. Click here to start at the beginning: https://www.veritas.com/docs/000017547

 

Table of Contents


1. Introduction
2. Create a cache object
3. Create a sparse volume
4. Replay the metasave




1. Introduction

(Back to top)

Since a sparse volume has minimal space requirements, it can be used to replay a metasave for larger volumes without using a significant amount of storage. The benefit of replaying a metasave on a temporary volume is that it allows the use of utilities that affect file system metadata, such as fsck -y and fsdb, without affecting the original file system.

Warning: This procedure should not be performed on a production server. If a cache object unexpectedly runs out of space, vxconfigd may become unresponsive.




2. Create a cache object

(Back to top)


Create a new volume and designate it as a cache object. The cache object can then be used in a similar manner as a disk, but in a space-optimized fashion that is useful for sparse volumes.


Table 1 - Creating a cache object

Step Description Syntax and example
2a Create a new volume that is at least slightly larger than the size of the metasave file.

In this example, the metasave file is 600 MB, so a volume of 1 GB is created.

Syntax:

vxassist -g <disk group> make <provide name for a new volume> <size>



Example, with typical output:

# vxassist -g datadg make cachevol 2048000
#

 
2b Create a cache object and associate it with the volume that was just created.
Syntax:

vxmake -g <disk group> cache <provide name for a new cache object> cachevolname=<cache volume> autogrow=on



Example, with typical output:

# vxmake -g datadg cache cacheobject cachevolname=cachevol autogrow=on
#

 
2c Start the cache object.
Syntax:

vxcache -g <disk group> start <cache object name>



Example, with typical output:

# vxcache -g datadg start cacheobject
#


 
Note: Vxprint now shows a cache object that is enabled.


# vxprint -C
Disk group: datadg

TY NAME         ASSOC        KSTATE   LENGTH   PLOFFS   STATE    TUTIL0  PUTIL0
co cacheobject  -            ENABLED  -        -        ACTIVE   -       -
 

 





3. Create a sparse volume

(Back to top)


Use vxmake to create the layers that are required for a volume, including the subdisk, plex and the volume itself. Instead of a normal volume, these steps result in the creation of a sparse volume.


Table 2 - Creating a sparse volume

Step Description Syntax and example
3a Create a subdisk that is the exact length of the source volume and associate it with the cache object that was created in Step 1. Specifying the length in sectors is recommended.

Since this will be used by a sparse volume, the length specified here is theoretical. Very little of the length will actually be used.

Syntax:

vxmake -g sd <provide name for a new subdisk> len=<exact length of source volume> dm=<cache object>



Example, with typical output:

# vxmake -g datadg sd cacheobject-01 len=6291456000 dm=cacheobject
#

 
3b Create a plex and associate it with the subdisk that was previously created.
Syntax:

vxmake -g <disk group> plex <provide name for a new plex> sd=<name of subdisk>



Example, with typical output:

# vxmake -g datadg plex sparsevol-01 sd=cacheobject-01
#

 
3c Create a sparse volume and associate it with plex that was previously created.
Syntax:

vxmake -g <disk group> vol sparsevol usetype=fsgen plex=<name of plex>



Example, with typical output:

# vxmake -g datadg vol sparsevol usetype=fsgen plex=sparsevol-01
#

 
3d Start the sparse volume.
Syntax:

vxvol -g <disk group> start <sparse volume>



Example, with typical output:

# vxvol -g datadg start sparsevol
#


 

Note: Vxprint now shows an active volume.



# vxprint -v
Disk group: datadg

TY NAME         ASSOC        KSTATE   LENGTH   PLOFFS   STATE    TUTIL0  PUTIL0
v  cachevol     cacheobject  ENABLED  1228800  -        ACTIVE   -       -
v  locks        fsgen        ENABLED  102400   -        ACTIVE   -       -
v  sparsevol    fsgen        ENABLED  6291456000 -      ACTIVE   -       -
v  vol1         fsgen        ENABLED  6010880  -        ACTIVE   -       -

 





4. Replay the metasave

(Back to top)

Use one of the provided metasave scripts to replay the metasave to the sparse volume. The metadata from the source volume can now be reviewed using utilities such as fstyp, fsck or fsdb without affecting the original volume.


Table 3 - Replaying a metasave

Step Description Syntax and example
4a Run the metasave script that matches the operating system and platform. Point it to the metasave output file, and provide a path to the sparse volume.
Syntax:

/opt/VRTSspt/FS/MetaSave/metasave_<os> -r -f <metasave file> <path to sparse volume>


Example, with typical output:

# /opt/VRTSspt/FS/MetaSave/metasave_rhel6_x86_64 -r -f /var/tmp/metasave.out /dev/vx/rdsk/datadg/sparsevol
#
4b Use fstyp to view the superblock of the sparse volume. The metadata should match the source volume.
Syntax:

fstyp -v <path to the sparse volume>


Example, with typical output:

# fstyp -v /dev/vx/rdsk/datadg/sparsevol
vxfs
magic a501fcf5  version 9  ctime Mon 07 May 2012 09:42:40 AM PDT
logstart 0  logend 0
bsize  1024 size  3005440 dsize  3005440  ninode 0  nau 0
defiextsize 0  ilbsize 0  immedlen 96  ndaddr 10
aufirst 0  emap 0  imap 0  iextop 0  istart 0
bstart 0  femap 0  fimap 0  fiextop 0  fistart 0  fbstart 0
nindir 2048  aulen 32768  auimlen 0  auemlen 8
auilen 0  aupad 0  aublocks 32768  maxtier 15
inopb 4  inopau 0  ndiripau 0  iaddrlen 8   bshift 10
inoshift 2  bmask fffffc00  boffmask 3ff  checksum f4b720ed
oltext1 32  oltext2 19458  oltsize 1  checksum2 0
free 2986185  ifree 0
efree  1 0 2 2 1 1 2 2 1 1 1 1 2 1 1 2 2 1 2 2 1 0 0 0 0 0 0 0 0 0 0 0

 
4c (Optional) Run fsck -y on the sparse volume that now contains the metasave replay. This can be used to "predict" the effect that running fsck -y will have on a file system without actually running it on production data.
Syntax:

fsck -t|F vxfs -y <path to the sparse volume>


Example, with typical output:

# fsck -t vxfs -y /dev/vx/dsk/datadg/sparsevol
fsck from util-linux-ng 2.17.2
file system is clean - log replay is not required

 

 

 

Was this content helpful?