Home > Veritas Storage Foundation™ File System Manual Pages
FCLADM (1M) |
Maintenance Commands |
fcladm -s savefile dump mount_point
fcladm [-s savefile] off mount_point
fcladm on [-o version=ver ] mount_point
fcladm [-cdfghit] print offset mount_point
fcladm -s savefile restore restorefile
fcladm rm mount_point
fcladm set eventlist mount_point
fcladm state mount_point
fcladm sync mount_point
The File Change Log is a quasi-regular file in the file system namespace that resides at mount_point/lost+found/changelog. This file can be opened, read, and closed. You can also seek to offsets within the file. However, to prevent corruption of the FCL, operations such as write, rename, and memory mapping are prohibited. The FCL file contains an FCL superblock that stores the meta-information about the FCL, followed by a number of FCL records. Each FCL record typically contains information such as file or directory changes along with the type of change. In addition, each record by itself, or in conjunction with adjacent records, tracks a file system event.
When a file system is created and mounted, the FCL is not enabled by default. Changes to the files and directories of the file system are not automatically logged in the FCL. You must enable the FCL using the on keyword. A newly created FCL initially contains only the superblock, along with the superblock state. To stop logging file system activity, use the the off keyword to de-activate the FCL. When the FCL is off, the FCL file remains at mount_point/lost+found/changelog. You can only remove or delete the FCL by using the rm keyword.
If needed, applications may offload FCL processing to a different system. However, physical layout restrictions may prevent the direct transfer of an FCL file to an off-host system. In such cases, you must first transfer an image of the FCL using the dump keyword. You can then restore the saved fileimage on an off-host system using the restore keyword.
The FCL was first introduced in VxFS 4.0. Version 3 was the FCL version for VxFS 4.1. Version 4 is the default version for VxFS 5.0. For backwards compatibility, VxFS 5.0 supports both versions 3 and 4.
fcladm operates only on file systems using the Version 6 or 7 disk layout.
The FCL feature is not available on file systems created with the nolargefiles option.
Only a superuser can run the fcladm command.
The
VX_FCL_MTIME_CHGrecord is updated when the time stamps of the inode are changed by an external event, such as the touch command. During a read or write access of the file, the record is not updated for
atimeor
mtimechanges.
Access control lists updates do not produce a mode change record.
In some cases, the state printed by the state keyword might differ from the state displayed in the FCL superblock by the print keyword. For example, if the FCL is turned on when a Storage Checkpoint is created, the fcladm print command shows the FCL superblock state as ON. However, if the Storage Checkpoint is mounted as read-only, the fcladm state command shows the Storage Checkpoint state as OFF. No activities are recorded in the FCL file for a read only file system.
If a future release of VxFS containing an FCL file higher than Version 4 is ever downgraded to VxFS 5.0, most fcladm keywords may not function properly. In such cases, it is recommended to remove the higher version FCL file using fcladm rm and to re-activate it using fcladm on.
Certain events such as data writes have an associated time interval that specify when the write event can be logged in the FCL. If a write event falls inside the time interval, it is not logged. See fcl_winterval in the vxtunefs(1M) manual page. sync also resets the FCL write interval for data write records, which forces the next write to each file in the file system to write a record in the FCL file.
- mount_point
- Specifies where the directory of the file system containing the File Change Log is mounted.
- ver
- Specifies the version of the FCL file to be created. This can be either Version 3 or 4. If no version is specified, the default is 4.
- offset
- Specifies an offset (in bytes) in the FCL file. This indicates where to begin printing the FCL file. Use this option in combination with the print keyword to produce an ASCII display of the FCL contents. The offset must always be 32-byte aligned.
- savefile
- Specifies the name of the saved FCL file image. This image can be shipped to a different system and restored for off-host processing.
- restorefile
- Specifies the name of the FCL file to restore that was created earlier by savefile. The restored file is a regular file, unlike the original FCL file.
- eventlist
- Specifies a list of the following events: accessinfo, fileopen, filestats. You may list multiple events, by separating them with a common. Use this option in conjunction with the set or clear keywords to optionally turn on or off the recording of the specified events.
The following options are valid only with the print keyword.
- accessinfo
- Enables recording information about the process that accessed the file in each FCL record. This includes the process ID, the real and effective user and group IDs of the process, and the ID of the node from which the file/ directory was accessed. The node ID is significant only in cases where the file system is mounted from multiple nodes. The node ID is specified in the LLT configuration.
- fileopen
- Enables file open recordings. Whenever a file is opened, this results in an FCL record that contains the command name of the process that opened the file.
- filestats
- Enables recording of file I/O statistics to the FCL. The FCL is used as a persistent store for the collected I/O statistics. When logging of this event is enabled, the I/O statistics collected in-core, get written to the FCL periodically.
- -c
- Prints the change type field.
- -d
- Prints the directory inode number field. The directory inode is only stored in an FCL record when the record is a VX_FCL_LINK, VX_FCL_UNLINK, or VX_FCL_RENAME FCL change type.
- -f
- Prints the file name field. The file name is only stored after an FCL record when the record is a VX_FCL_LINK, VX_FCL_UNLINK, or VX_FCL_RENAME FCL change type.
- -g
- Prints the inode generation count field.
- -h
- Displays the field names before printing the contents of the FCL.
- -i
- Prints the inode number field.
- -t
- Prints the time stamp field.
# fcladm on /home
To turn off the FCL for a file system mounted on /export/data, type the following:
# fcladm off /export/data
The following example removes the FCL file for a file system mounted on /export/reports. The FCL must be OFF before it can be removed.
# fcladm rm /export/reports
To turn on the logging of file openings for the file system mounted on /home once the command is executed, type the following:
# fcladm set fileopen /home
To turn off the logging of file openings for the file system mounted on /home, type the following:
# fcladm clear fileopen /home
To obtain the current FCL state for a file system mounted on /home, type the following:
# fcladm state /home
To disable the logging of file opens, file I/O statistics, and access information for the file system mounted on /home, type the following:
# fcladm clear fileopen,filestats,accessinfo /home
To print all the FCL records present in an FCL file, you can print the contents of the FCL superblock by skipping offset 0, and using the first valid offset (foff) as an argument to the subsequent print.
For example, to print an ASCII display of the on-disk FCL superblock from offset 0 and to obtain information about the FCL for the file system mounted on /export/data, type the following:
# fcladm print 0 /home magic a506fcf5 version 2 time 1087979247 930092 (Wed 23 Jun 2004 04:27:27 PM CST CDT) state ON sync 1foff 1024 loff 63744
Use the foff (1024) as the offset to the next call to print with the -h option to display the field names and the -citdf options to display the change type, inode number, time stamp, directory inode number, and file name for each record.
# fcladm -h -citdf print 0x400 /export/data Change Type Inode Number Timestamp Dir Inode Number Filename Create 5 Thu Apr 10 13:49:54 2003 Extend 5 Thu Apr 10 13:50:02 2003 Create 6 Thu Apr 10 13:50:30 2003 Unlink 6 Thu Apr 10 13:50:38 20032 bar
- The magic number which identifies the FCL file. This is always a506fcf5.
- The version of the FCL file. This is either 3 or 4 for VxFS 5.0.
- The last time that the FCL was activated. This can be used by a script which scans the FCL periodically to check if the FCL has been active continuously since its last scan.
- The activation state of the FCL. If the state is ON, changes to the file system are logged in the FCL.
- The first and last valid offsets in the FCL - foff and loff. FCL records are present only between these offsets.
- The eventmask, which is a hexadecimal number representing the set of events being tracked. If the eventmask is interpreted as a 64-bit number and the event 'e' is defined as '20' in the fcl.h header, the logging of event 'e' is enabled when the 20th bit is set in the eventmask.
When a non-zero offset is specified with the print keyword, fcladm prints the contents of the FCL starting at the specified offset until the end of the file. The output consists of one physical FCL record per line, where each file system event corresponds to one or more physical FCL records. The output also shows the event type whether the tracking of additional information (for example, access information) is enabled or not.
- The eventmask change time, which represents the time that the eventmask was last changed, that is, the time when the set of events was last changed through the set or clear keyword.
Each physical FCL record typically contains the following basic information:
- The change/event type.
FCL Event Types
- The inode number and generation count of the file/directory which was changed.
- The time when the event occurred.
Certain records have additional information that is specific to each event type. This information is either stored along with the base FCL record or as an extension record. The extension record is another physical FCL record that immediately follows the base record. For instance in the case of a file unlink, the name of the file that was unlinked and the inode number of the file directory is stored as a part of the unlink record. However, if the tracking of access information is enabled, the extra access information is stored as a separate FCL record which immediately follows the original record. For example, if accessinfo has been enabled, a file create results in a "Create" record followed by an "AccessInfo" record.
The following file system events produce an FCL record that contains only the basic information listed above. The change type is the string that is displayed by the print keyword.
In addition, the following system events also contain this information:ln -s file symlink --------------------------- ------------------ Inode extent attributes ExtnAttrChg change --------------------------- ------------------ Change in the number of ReserveChg blocks reserved to a file. The reservation can be set through the setext command. See the setext(1M) manual page. --------------------------- ------------------ File mode change. See the ModeChg chmod(1) manual page. --------------------------- ------------------- File owner change. See OwnerChg the chown(1) manual page. --------------------------- ------------------- File group change. See GroupChg the chgrp(1) manual page. --------------------------- ------------------- File modification time MtimeChg change. See the touch(1) manual page. --------------------------- ---------------------------------------------- ----------------- File system event type Change type --------------------------- ----------------- File create Create e.g. ls > newfile --------------------------- ----------------- File undelete through the Undelete VxFS internal file promote API. --------------------------- ------------------ Extending write to the file Extend i.e., one that increases the size of the file --------------------------- ------------------ Write to a file that Overwrite overwrites existing contents, but does not increase the file size --------------------------- ------------------ File truncates, i.e., Truncate operations that reduce the file size --------------------------- ------------------ Extended attribute change Ext_Attr_Chg --------------------------- ------------------ Operations that result in Hole_Punch deallocating some of the internal blocks of the file --------------------------- ------------------ Symbolic link creation Sym_Linke.g.,
- A file name.
- The inode number.
- The generation count of the directory containing the file name.
ln(1) manual page. This FCL record contains the file name and the directory inode number of the new link. --------------------------- ----------------- File removal or unlink via Unlink the rm(1) or unlink(2) manual pages. The directory information corresponds to the removed file. --------------------------- ----------------- Rename an existing file. Rename See the mv(1) manual page. This record contains the old file name. --------------------------- -------------------------------------------- ----------------- File system event type Change type --------------------------- ----------------- Create a hard link to an Add_Link existing file. See the
In 5.0, the information maintained with each record and events cause the following records to be written:
A call to fcladm print with just the offset and no extra options prints all the records in the FCL starting from that offset and all the information that is tracked with each record. However, new record types or information provided in a future VxFS release may not be available to an application or script that uses a Version 4 FCL. For compatibility, make sure that the script tries to interpret only the set of records enumerated in this man page and ignores other records.
- Maintains a syncfile containing the synchronization offset from the last scan.
- Uses the offset in this file as the starting point for the current scan.
- Gets a synchronization point and updates the syncfile with this offset.
# Get the previous synchronization point stored in syncfile. # Set a synchronization point in the FCL and save the offset to # syncfile. Print records starting from previous sync offset. $ syncoffset=`cat syncfile` $ fcladm sync /mnt1 > syncfile $ fcladm -citf print $syncoffset /mnt1 ModeChg 4 Thu 01 Jul 2004 12:51:10 AM Extend 4 Thu 01 Jul 2004 12:51:20 AM FileOpen 1071 Thu 01 Jul 2004 12:52:10 AM a.out
To obtain the full file path name relative to the root of the file system, the inode number acquired from the FCL record must be passed to the VxFS Reverse Name Lookup (RNL) API. See the vxlsino(1M), vxfs_inotopath(3) and vxfs_inotopath_gen(3) manual pages. In cases where the file was renamed or removed, the directory inode number can be given to the RNL API to help obtain the full path name for the parent directory relative to the root of the file system. The file name stored in the FCL record can then be appended to this path to get the full file path name.
- Determine the full path name of every file changed in the file system, based on several categories of changes
- Determine whether an inode number was reused
- •
- Determine the user and group names and obtain hostnames in a cluster configuration
You can use the file generation count to determine whether an inode number was reused when another FCL record has the same inode number. However, you cannot use the file generation count to determine inode number reuse with the remove record. The generation count displayed in the remove record is the generation count of the directory inode and not of the inode that was removed.
Similarly, the user ID and group IDs displayed along in the AccessInfo records can be used in conjunction with the /etc/passwd file to determine the user and group names. The node ID printed with this record is important only in clusters configurations. With this information, you can use the lltstat command to obtain the hostname in a cluster.
Last updated: 7 May 2007
Copyright ©2009 Symantec Corporation
All rights reserved.