Index Index for
Section 2
Index Alphabetical
listing for F
Bottom of page Bottom of
page

freezefs(2)

NAME

freezefs - The freezefs() API causes the specified fileset's domain to enter into a metadata stable state, causes a previously frozen fileset's domain to resume normal activity, or queries the freeze state of the fileset's domain. All the filesets in the AdvFS domain are affected.

SYNOPSIS

#include <sys/mount.h> int freezefs { char *mountPoint, u_long optionFlags, int timeout }; );

PARAMETERS

mountPoint Points to a null-terminated string that contains the appropriate mount point of the file system. optionFlags Specifies what action to take on the specified file system. FS_Q_QUERY Queries the freeze state and indicates whether or not the domain is frozen by way of the return code. FS_Q_FREEZE Places the filesystem in a metadata consistent state and guarantees that it stays that way until thawed. All metadata, which could be spread across multiple volumes or logical units (LUNS), is flushed to disk and does not change for the duration of the freeze. FS_Q_THAW Causes a previously frozen fileset's domain to resume normal activity. timeout Specifies the maximum time allowed for the fileset's domain to remain frozen: > 0 Specifies the timeout value in seconds. = 0 Uses the default timeout specified in the vfs stanza of /etc/sysconfigtab as freezefs_default_timeout. If not specified in /etc/sysconfigtab, freezefs uses 60 seconds. < 0 Specifies no timeout. The fileset's domain remains frozen until explicitly thawed. Certain system events on a cluster will cause automatic thaws regardless of timeout value. See DESCRIPTION for more information.

DESCRIPTION

To allow coherent hardware snapshots in multivolume domain configurations, filesystem metadata must be consistent across all volumes when the individual volumes are snapped or cloned. These configurations include both multivolume AdvFS domains and multivolume LSM logical volumes. The FS_Q_FREEZE option to the freezefs API places the filesystem in a metadata-consistent state and guarantees that it stays that way until thawed. All metadata, which could be spread across multiple volumes or logical units (LUNs), is flushed to disk and does not change for the duration of the freeze. The filesystem thaws either by timing out or explicitly with the FS_Q_THAW option to the freezefs() API. If you are running a cluster configuration, shutting down any node or the failure of any node will also thaw the filesystem. The exact nature of the freezefs API depends on whether you are running on a single system or a cluster. Single System When you freeze a filesystem, any in-process metadata updates are allowed to finish. Filesystem operations that do not modify metadata are allowed while frozen. Some operations will work normally even if the target fileset's domain is frozen, for example: · Read · No-extending write · Stat Filesystem operations that modify metadata are blocked. The following operations will block if the target fileset's domain is frozen, for example: · Mount of fileset · rmvol · Extending write · mkfset / rmfset The following filesystem operations will fail immediately if the target filesystem (that is, domain) is frozen: · Mount update of fileset · Unmount of fileset Cluster When you freeze a filesystem in a clustered configuration, all in-process filesystem operations are allowed to complete. Some filesystem operations are allowed while frozen. The following operations, which do not require metadata updates, will work normally even if the target filesystem is frozen. · Read · Stat Most new filesystem operations are blocked when the filesystem is frozen. Operations that have the potential for requiring metadata updates will block if the target filesystem is frozen, for example: · Write · chmod · Link Some filesystem operations will fail immediately if the target domain is frozen, for example: · Unmount of fileset · Mount (update) of fileset · User-initiated planned relocation · User-initiated forced unmount · addvol · rmvol The freezefs() API posts an event manager (EVM) event when a file system is frozen or thawed. Use the evmwatch and evmshow commands to determine if any file systems in the cluster are frozen. See EXAMPLES.

NOTES

At present, freezefs and thawfs functionality is only implemented for AdvFS filesystems. Using the freezefs() API for a single mount point affects all filesets in the domain. In a cluster configuration, some system events may cause an automatic thaw regardless of the timeout option. See the DESCRIPTION section for more information.

RESTRICTIONS

You must be root user to run freezefs and thawfs. The /, /usr and /var file systems cannot be frozen.

EXIT STATUS

0 (Zero) Success FS_Q_FREEZE and FS_Q_THAW Not frozen FS_Q_QUERY > 0 Frozen FS_Q_QUERY < 0 An error occurred.

ERRORS

[ENOTSUP] The freezefs is not supported by the filesystem specified. [NOENT] The filesystem is not mounted. [ENOMEM] Not enough memory. [EALREADY] The file system is already frozen freezefs, or The file system is not frozen thawfs. [EPERM] The caller does not have root privilege. [EOPNOTSUPP] Option not supported.

EXAMPLES

1. To freeze a file system: #include extern errno; ... char *mp; u_long flags; int timeout, rc; ... mp = "/oracle"; /* filesystem to freeze */ flags = FS_Q_FREEZE; /* freeze flag */ timeout = 0; /* use default timeout */ ... errno = 0; rc = freezefs(mp, flags, timeout); if (rc = -1) { error } . . . PERFORM WORK ON FROZEN FILE SYSTEM . . . flags = FS_Q_THAW; /* thaw flag */ errno = 0; rc = freezefs(mp, flags, timeout); if (rc = -1) { /* If error on thaw, cannot rely on the intial freeze */ error }

SEE ALSO

Commands: freezefs(8), thawfs(8)

Index Index for
Section 2
Index Alphabetical
listing for F
Top of page Top of
page