Exports DCE LFS aggregates and non-LFS partitions to the DCE namespace
Synopsis
dfsexport [{-all | -aggregate name}] [-type name] [-detach] [-force] [-verbose] [-help]
Options
-all
Specifies that all aggregates and partitions listed in the dcelocal/var/dfs/dfstab file are to be exported. Use the -type option with this
option to export only DCE LFS aggregates or only non-LFS partitions. Use this option or use -aggregate; omit both options to list all aggregates and partitions currently exported from the
local disk to the DCE namespace.
-aggregate name
Specifies the device name or aggregate name of the aggregate or partition to be exported. These names are specified in the first and second fields of
the entry for the aggregate or partition in the dfstab file. Use this option or use -all; omit both options to list all aggregates and partitions currently exported from the local
disk to the DCE namespace.
-type name
Used with the -all option, specifies that only aggregates or partitions whose file system types match the type specified with this option are to be
exported. The type can be specified as lfs to export only DCE LFS aggregates, or it can be specified as ufs to export only non-LFS partitions. The type of each aggregate or
partition appears in the third field of the entry for the device in the dfstab file. The type must be specified in lowercase letters (as it appears in the dfstab file).
Use this option only with the -all option; it is ignored if it is used without the -all option. If it is omitted and -all is used, the command exports both lfs and ufs devices.
-detach
Specifies that the aggregates or partitions indicated with the command's other options are to be detached (no longer exported), making them unavailable via the DCE
namespace. Use -all or -aggregate with this option to indicate the devices to be detached; use the -type option with -all to detach only one type of device.
Use the -detach option only when no users are accessing data on the aggregate or partition to be detached or when a serious emergency warrants its use. When the -detach option is used, the command revokes all tokens for data on a device before it detaches it. It does not detach a device unless it can revoke all necessary tokens. You can use the -force option to direct the command to detach a device even if it cannot revoke all necessary tokens.
To permanently detach an aggregate or partition, it must also be removed from the dfstab file. Otherwise, the dfsexport command exports the aggregate or partition the next time it is run (provided the aggregate or partition is included in the specification for the devices to be exported).
-force
Used with the -detach option, directs the dfsexport command to detach an aggregate or partition even if it cannot revoke all tokens for data on the
device. By default, the command does not detach a device unless it can revoke all necessary tokens. Use this option only when a serious emergency requires its use.
This option can be used only with the -detach option. The command fails if this option is used with any combination of options that does not include the -detach option.
-verbose
Directs the command to report on its actions as it executes.
-help
Prints the online help for this command. All other valid options specified with this option are ignored.
The help and apropos commands available with all command suites are also available with the dfsexport command. See the bos help and bos apropos reference pages for examples using these commands.
Description
The dfsexport command exports DCE LFS aggregates and non-LFS disk partitions from the local disk of a machine to the DCE namespace. File systems on
exported aggregates and partitions are available to other users in the DCE namespace. The binary file for the dfsexport command resides in dcelocal/bin/dfsexport.
The command exports DCE LFS aggregates, non-LFS partitions, or both based on the values provided with its options. If the -all option is provided, the command exports all aggregates and partitions listed in the dcelocal/var/dfs/dfstab file. If the -aggregate option is provided, it exports only the aggregate or partition whose device name or aggregate name is specified with the option. The specified name must be listed in the dfstab file.
The -type option can be used with the -all option to indicate that only DCE LFS aggregates or only non-LFS partitions are to be exported. If lfs is provided with the -type option, the command exports only DCE LFS aggregates; if ufs is specified with the -type option, it exports only non-LFS partitions. If the -type option is used, the -all option must also be included; otherwise, the -type option is ignored.
When dfsexport executes, it reads the dfstab file on the local disk of the machine to determine the aggregates and partitions available to be exported. An aggregate or partition must have an entry in the dfstab file if it is to be exported. Because this command reads the dfstab file, information supplied with its options must match exactly the information for an aggregate or partition specified in that file.
The dfsexport command reads a list of all currently exported aggregates and partitions that is maintained in the kernel of the local machine. The command will not export an aggregate or partition that is currently exported. The command also refuses to export a DCE LFS aggregate that needs to be recovered with the salvage command. If the dfsexport command fails with an exit status of 2, use the salvage command to recover the aggregate that caused the failure and reissue the dfsexport command.
Issuing the dfsexport command with no options lists the aggregates and partitions currently exported from the local disk to the DCE namespace. The fts lsaggr command can also be used to display a current list of all aggregates and partitions exported from a machine.
The dfsexport command is generally included in a machine's initialization file (/etc/rc or its equivalent) rather than issued at the keyboard. Once included in the initialization file, the command automatically exports all indicated aggregates and partitions whenever the machine is rebooted. Typically, the command is included with its -all option to export all aggregates and partitions listed in the dfstab file.
Prior to using this command to export a non-LFS partition for the first time, perform the following steps:
1. Ensure that the partition is mounted locally; it can contain data or it can be empty.
2. Issue the fts crfldbentry command to register the non-LFS fileset that resides on the partition (each non-LFS partition contains a single fileset) in the Fileset Location Database (FLDB). The Fileset Location Server (FL Server) can then track the fileset's location. The fts crfldbentry command also allocates a unique fileset ID number for the non-LFS fileset.
3. Create an entry for the non-LFS partition in the dfstab file on the machine on which the partition resides. Use the aggregate ID number specified with the -aggrid option of the fts crfldbentry command and the fileset ID number allocated by the command in the fourth and fifth fields of the entry for the partition. Also, use the name of the partition's local mount point as its aggregate name in the second field of its entry. (Once these steps are complete, use the fts crmount command to mount the non-LFS fileset that resides on the partition.)
Before exporting a non-LFS partition, also make sure that no users have files open on the partition. DFS cannot effectively synchronize file access between users who opened files from a non-LFS partition before the partition was exported and users who open files from the partition after the partition is exported because only the latter have tokens.
Before using this command to export a DCE LFS aggregate for the first time, complete the following steps:
1. Ensure that the disk partition on which the aggregate is to reside is initialized with the newaggr command; the partition cannot contain data when the newaggr command is executed. The newaggr command needs to be run on a partition only once. Do not use the newaggr command to reinitialize a partition that contains data you want to preserve; the command destroys any data on the partition on which it is used.
2. Create an entry for the DCE LFS aggregate in the dfstab file on the machine on which the aggregate is located. (Once the aggregate is exported, the fts create command can be used to create and register filesets on the aggregate, after which the fts crmount command can be used to mount the new filesets.)
The dfsexport command can also be used to detach an exported aggregate or partition from the DCE namespace. Detaching an aggregate or partition makes it unavailable in the namespace. To detach one or more aggregates or partitions, use the -all (and optionally the -type) option or the -aggregate option to specify the devices to be detached, and include the -detach option with the command.
Before it detaches a device, the command revokes all tokens for data on the device. When their tokens are revoked, clients flush data cached from the device, writing any modified data back to the device. If the command cannot revoke all necessary tokens, it does not detach the device (it instead displays a message reporting that the device is busy). The -force option can be used with the -detach option to direct the command to detach a device even if it cannot revoke all necessary tokens (that is, even if files from the device are still open). (You can also remove an aggregate or partition from the DCE namespace by removing its entry from the dfstab file and rebooting the machine.)
Privilege Required
If the command is issued with no options to list the aggregates and partitions exported from the local machine, no privileges are required. Otherwise, the
issuer must be logged in as root on the local machine.
Cautions
Before detaching an aggregate or partition, attempt to ensure that no users are currently accessing data from filesets on the device. The command revokes all tokens
for data on the device before it detaches it, which causes clients to flush data cached from the device (writing any modified data back to the File Server machine). However, a user who is accessing
data from the device will no longer be able to save the data. Any attempt to perform an action that involves a detached aggregate or partition elicits a message reporting that the device is unknown.
Exercise special caution before using both the -detach and -force options, which forces a device to be detached even if all tokens cannot be revoked (that is, even if files are
still open).
Examples
The following command line is typically added to a machine's initialization file (/etc/rc or its equivalent). The line exports all of the aggregates and
partitions that have entries in the machine's dfstab file.
dfsexport -all
The following command exports the aggregate whose device name (as it appears in the dfstab file) is /dev/lv02:
# dfsexport /dev/lv02
The command that follows exports all DCE LFS aggregates (all entries in the dfstab file with file system type lfs):
# dfsexport -all -type lfs
Exit Values
The dfsexport command can return the following exit values:
0
The command completed successfully.
1
The command failed for a reason other than that associated with an exit value of 2.
2
The command failed because a DCE LFS aggregate to be exported needs to be recovered with the salvage command before it can be exported.
Related Information
Commands: fts create(8dfs)
Files: dfstab(4dfs)