How to collect the file system metadata, and other information, in the event of possible VxFS file system corruption

Article:TECH188937  |  Created: 2012-05-16  |  Updated: 2014-08-19  |  Article URL http://www.symantec.com/docs/TECH188937
Article Type
Technical Solution



Issue



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: http://www.symantec.com/docs/TECH205049

 


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. Use the Data Collector to gather additional logs
8. End the "script" collection process
9. 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
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: http://www.symantec.com/docs/TECH71582


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"
http://www.symantec.com/docs/TECH206705

 

 





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 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"
http://www.symantec.com/docs/TECH203525

 




8. 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.



 





 
 
9. 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 & 7).
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 "Data Collector" output file (from Step 8).


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




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

"As a customer, which FTP servers and services can I use to upload evidence to Symantec Technical Support?"
http://www.symantec.com/docs/TECH66995

 

 

 




Article URL http://www.symantec.com/docs/TECH188937


Terms of use for this information are found in Legal Notices