1. Introduction
2. Create a cache object
3. Create a sparse volume
4. Replay the metasave
(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.
(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 make 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 cache cachevolname= autogrow=on Example, with typical output: # vxmake -g datadg cache cacheobject cachevolname=cachevol autogrow=on |
| 2c | Start the cache object. | Syntax: vxcache -g start Example, with typical output: # vxcache -g datadg start cacheobjectNote: Vxprint now shows a cache object that is enabled.
# vxprint -C |
(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 len= dm= 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 plex sd= 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 vol sparsevol usetype=fsgen plex= Example, with typical output: # vxmake -g datadg vol sparsevol usetype=fsgen plex=sparsevol-01 |
| 3d | Start the sparse volume. | Syntax: vxvol -g start Example, with typical output: # vxvol -g datadg start sparsevolNote: Vxprint now shows an active volume.
|
(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_ -r -f 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 Example, with typical output: # fstyp -v /dev/vx/rdsk/datadg/sparsevol |
| 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 Example, with typical output: # fsck -t vxfs -y /dev/vx/dsk/datadg/sparsevol |
|
This article is a part of a set on troubleshooting file system corruption. Click here to start at the beginning:
|
This article contains a procedure for replaying a metasave of a VxFS file system by using a sparse volume.