Путеводитель по Руководству Linux

  User  |  Syst  |  Libr  |  Device  |  Files  |  Other  |  Admin  |  Head  |



   xfsdump    ( 8 )

утилита инкрементного дампа файловой системы XFS (XFS filesystem incremental dump utility)

  Name  |  Synopsis  |  Description  |    Note    |  Examples  |  Files  |  See also  |  Diagnostic  |  Bugs  |

Примечание (Note)

Dump Interruption A dump can be interrupted at any time and later resumed. To interrupt, type control-C (or the current terminal interrupt character). The operator is prompted to select one of several operations, including dump interruption. After the operator selects dump interruption, the dump continues until a convenient break point is encountered (typically the end of the current file). Very large files are broken into smaller subfiles, so the wait for the end of the current file is brief.

Dump Resumption A previously interrupted dump can be resumed by specifying the -R option. If the most recent dump at the specified level was interrupted, the new dump does not include files already dumped, unless they have changed since the interrupted dump.

Media Management A single media object can contain many dump streams. Conversely, a single dump stream can span multiple media objects. If a dump stream is sent to a media object already containing one or more dumps, xfsdump appends the new dump stream after the last dump stream. Media files are never overwritten. If end-of-media is encountered during the course of a dump, the operator is prompted to insert a new media object into the drive. The dump stream continuation is appended after the last media file on the new media object.

Inventory Each dump session updates an inventory database in /var/lib/xfsdump/inventory. xfsdump uses the inventory to determine the base of incremental and resumed dumps.

This database can be displayed by invoking xfsdump with the -I option. The display uses tabbed indentation to present the inventory hierarchically. The first level is filesystem. The second level is session. The third level is media stream (currently only one stream is supported). The fourth level lists the media files sequentially composing the stream.

The following suboptions are available to filter the display.

-I depth=n (where n is 1, 2, or 3) limits the hierarchical depth of the display. When n is 1, only the filesystem information from the inventory is displayed. When n is 2, only filesystem and session information are displayed. When n is 3, only filesystem, session and stream information are displayed.

-I level=n (where n is the dump level) limits the display to dumps of that particular dump level.

The display may be restricted to media files contained in a specific media object.

-I mobjid=value (where value is a media ID) specifies the media object by its media ID.

-I mobjlabel=value (where value is a media label) specifies the media object by its media label.

Similarly, the display can be restricted to a specific filesystem.

-I mnt=mount_point (that is, [hostname:]pathname), identifies the filesystem by mountpoint. Specifying the hostname is optional, but may be useful in a clustered environment where more than one host can be responsible for dumping a filesystem.

-I fsid=filesystem_id identifies the filesystem by filesystem ID.

-I dev=device_pathname (that is, [hostname:]device_pathname) identifies the filesystem by device. As with the mnt filter, specifying the hostname is optional.

More than one of these suboptions, separated by commas, may be specified at the same time to limit the display of the inventory to those dumps of interest. However, at most four suboptions can be specified at once: one to constrain the display hierarchy depth, one to constrain the dump level, one to constrain the media object, and one to constrain the filesystem.

For example, -I depth=1,mobjlabel="tape 1",mnt=host1:/test_mnt would display only the filesystem information (depth=1) for those filesystems that were mounted on host1:/test_mnt at the time of the dump, and only those filesystems dumped to the media object labeled "tape 1".

Dump records may be removed (pruned) from the inventory using the xfsinvutil program.

An additional media file is placed at the end of each dump stream. This media file contains the inventory information for the current dump session. Its contents may be merged back into the online inventory database at a later time using xfsrestore(1M).

The inventory files stored in /var/lib/xfsdump are not included in the dump, even if that directory is contained within the filesystem being dumped. Including the inventory in the dump may lead to loss or corruption of data, should an older version be restored overwriting the current version. To backup the xfsdump inventory, the contents of /var/lib/xfsdump should be copied to another location which may then be safely dumped. Upon restoration, those files may be copied back into /var/lib/xfsdump, overwriting whatever files may be there, or xfsinvutil(1M) may be used to selectively merge parts of the restored inventory back into the current inventory. Prior to version 1.1.8, xfsdump would include the /var/lib/xfsdump directory in the dump. Care should be taken not to overwrite the /var/lib/xfsdump directory when restoring an old dump, by either restoring the filesystem to another location or by copying the current contents of /var/lib/xfsdump to a safe place prior to running xfsrestore(1M).

Labels The operator can specify a label to identify the dump session and a label to identify a media object. The session label is placed in every media file produced in the course of the dump, and is recorded in the inventory.

The media label is used to identify media objects, and is independent of the session label. Each media file on the media object contains a copy of the media label. An error is returned if the operator specifies a media label that does not match the media label on a media object containing valid media files. Media labels are recorded in the inventory.

UUIDs UUIDs (Universally Unique Identifiers) are used in three places: to identify the filesystem being dumped (using the filesystem UUID, see xfs(5) for more details), to identify the dump session, and to identify each media object. The inventory display (-I) includes all of these.

Dump Level Usage The dump level mechanism provides a structured form of incremental dumps. A dump of level level includes only files that have changed since the most recent dump at a level less than level. For example, the operator can establish a dump schedule that involves a full dump every Friday and a daily incremental dump containing only files that have changed since the previous dump. In this case Friday's dump would be at level 0, Saturday's at level 1, Sunday's at level 2, and so on, up to the Thursday dump at level 6.

The above schedule results in a very tedious restore procedure to fully reconstruct the Thursday version of the filesystem; xfsrestore would need to be fed all 7 dumps in sequence. A compromise schedule is to use level 1 on Saturday, Monday, and Wednesday, and level 2 on Sunday, Tuesday, and Thursday. The Monday and Wednesday dumps would take longer, but the worst case restore requires the accumulation of just three dumps, one each at level 0, level 1, and level 2.

Quotas If the filesystem being dumped contains user quotas, xfsdump will use xfs_quota(8) to store the quotas in a file called xfsdump_quotas in the root of the filesystem to be dumped. This file will then be included in the dump. Upon restoration, xfs_quota(8) can be used to reactivate the quotas for the filesystem. Note, however, that the xfsdump_quotas file will probably require modification to change the filesystem or UIDs if the filesystem has been restored to a different partition or system. Group and project quotas will be handled in a similar fashion and saved in files called xfsdump_quotas_group and xfsdump_quotas_proj , respectively.

Excluding individual files It may be desirable to exclude particular files or directories from the dump. The -s option can be used to limit the dump to a specified directory, and the -z option can be used to exclude files over a particular size. Additionally, when xfsdump is run with the -e option, files that are tagged with the "no dump" file attribute will not be included in the dump. The chattr(1) command can be used to set this attribute on individual files or entire subtrees.

To tag an individual file for exclusion from the dump:

$ chattr +d file

To tag all files in a subtree for exclusion from the dump:

$ chattr -R +d directory

Note that any new files or directories created in a directory which has the "no dump" attribute set will automatically inherit this attribute. Also note that xfsdump does not check directories for the "no dump" attribute.

Care should be taken to note which files have been tagged. Under normal operation, xfsdump will only report the number of files it will skip. The -v excluded_files=debug option, however, will cause xfsdump to list the inode numbers of the individual files affected.