Collecting the file system metadata, and other information, in the event of possible VxFS file system corruption

Article: 100027324
Last Published: 2024-05-07
Ratings: 1 0
Product(s): InfoScale & Storage Foundation

Problem

This article contains a procedure for preserving the file system metadata in the event of possible corruption

 

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/support/en_US/article.100009174

 


Table of Contents


1. Introduction
2. Use "script" to preserve the data gathering session
3. Use "fsck -n" to test for possible corruption
4. Use "ls" to collect a list of inodes
5. Gather a "metasave" of the suspect file system
6. Use "dd" to copy the meta data front-end of the corrupted file system

7. Gather a "ncheck" of the suspect file system
8. Use the Data Collector to gather additional logs
9. End the "script" collection process
10. Compress and upload the following items to the evidence server



1. Introduction
(Back to top)


When VxFS file system corruption is suspected, the degree of corruption can be often assessed *before* attempting to run “fsck –y." Gathering a "metasave" of the filesystem, along with other information makes it possible to safely run fsck against a "replay" of the filesystem metadata instead of running it against actual production data.
 
Note: This data gathering process requires unmounting and remounting the filesystem.



2. Use "script" to preserve the data gathering session
(Back to top)

Script is a native utility that is used to record a "typescript" of everything that is typed within a terminal. In this case, the recorded typescript can be used to verify that the gathering process was performed correctly.

Figure 1 - Using script to record a typescript

Syntax:

script vxfs_info.out

Example, with typical output:

# script vxfs_info.out
Script started, file is vxfs_info.out

#

 

Note: A blank prompt is expected here. The process will continue recording a typescript until the "exit" command is issue. Continue to the next step.


 

3. Use "fsck -n" to log the current status of the suspect file system

(Back to top)


When using the "-n" argument, fsck will simply report its findings without making any changes.
 

Warning: Do not use the "-y" switch at this time.



Figure 2 - Using vxfs with the "-n" switch to test for filesystem corruption

Syntax:

/usr/lib/fs/vxfs/fsck -F|t vxfs -n -o full,nolog  /dev/vx/rdsk/<diskgroupname>/<volumename> >/var/tmp/fsck-n.out

Note: Only use the version of fsck that comes with Storage Foundation for VxFS volumes. More information about this can be found here: https://www.veritas.com/support/en_US/article.100021267

Example, with typical output:

# umount /vol1
# /usr/lib/fs/vxfs/fsck -F vxfs -n -o full,nolog  /dev/vx/rdsk/datadg/vol1 >/var/tmp/fsck-n.out

 

4. Use "ls" to collect a list of inodes

Use ls with the "-aliR" switches to gather the inode numbers for each file that is contained by the file system.

Figure 3 - Using "ls -aliR" to gather a list of inodes
 

Syntax:

ls -aliR <mountpoint> > <output file>

Example, with typical output:
 
Note: If possible, mount the file system in "read-only" mode before performing this step.


# mount -t vxfs -o ro /dev/vx/dsk/datadg/vol1 /vol1
# mount | grep -i vx

/dev/vx/dsk/datadg/vol1 on /vol1 type vxfs (ro,largefiles,ioerror=mwdisable)
# ls -aliR /vol1 > /var/tmp/ls_all_files.out
 
 

5. Gather a "metasave" of the suspect file system

Use one of the provided metasave scripts to create file that contains a copy of the metadata of a volume. The metadata is a data structure that contains attributes about the data within a filesystem, but does not contain the actual data itself.
 

Information about creating a metasave can be found here:

"How to create a metasave"

 

6. Use "dd" to copy the metadata front-end of the corrupted file system
(Back to top)

Mount the volume and then use "dd" to generate a dump of the first 256 MB of the volume.
 

Syntax:

dd if=/dev/vx/rdsk/<diskgroupname>/<volumename> of=/var/tmp/dd_config.dump bs=1024k count=256 &


Example, with typical output:

# mount -t vxfs /dev/vx/dsk/datadg/vol1 /vol1
# dd if=/dev/vx/rdsk/datadg/vol1 of=/var/tmp/dd_config.dump bs=1024k count=256 &
[1] 11333

# 256+0 records in
268435456 bytes (268 MB) copied, 11.8876 s, 22.6 MB/s

 
 

 


7. Use "ncheck" to list of path names corresponding to inode numbers for files of corrupted file system

(Back to top)

Mount the volume and then use "ncheck" to gather inode-file mapping.
 

Syntax:

/opt/VRTS/bin/ncheck /dev/vx/rdsk/<diskgroupname>/<volumename> > <output file>

Example, with typical output:

# nohup /opt/VRTS/bin/ncheck /dev/vx/rdsk/datadg/vol1 > /var/tmp/ncheck_vol1.out &
[1] 11334
#

 
 

8. Use the Data Collector to gather additional logs
(Back to top)
 

Use the SORT Data Collector to gather additional logs.
 
Warning: During the data collection process, do not restart the vxconfigd daemon (Volume Manager) if prompted.


More details on gathering logs with the Data Collector can be found in this article:

"Using the SORT Data Collector to gather logs for Storage Foundation Technical Support"
 

 


9. End the "script" collection process
 

Syntax:

exit


Example, with typical output:

# exit
exit

Script done on Fri 10 May 2013 02:40:40 PM PDT

 

Note: The recorded typescript will be saved in the output file that was previously specified.



 


 
 
10. Compress and upload the following items to the evidence server

(Back to top)


If the logs were gathered at the request of Technical Support, upload them to the "evidence server" using these steps:

1. The "script" session output file (from Step 2 & 8).
2. The "fsck" output file (from Step 3).
3. The "ls -aliR" output file (from Step 4).
4. The "metasave" output file (from Step 5).
5. The "dd" dump file (from Step 6).

6. The "ncheck" output file (from Step 7).
7. The "Data Collector" output file (from Step 8).


Note: Compress the "dd" dump file before uploading.

 
Details on uploading files to the Veritas Enterprise Support FTP servers can be found in this article:

This article contains information about providing data to Technical Support

 

 

Was this content helpful?