From 9a4924650689205147eec94a52e07093483a1f7a Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Sun, 26 Nov 2017 17:41:13 -0700 Subject: [PATCH] LU-10047 backup: add --xattrs-include="trusted.*" For RHEL7 and GNU tar 1.27 the "--xattrs-include="trusted.*" argument is required, otherwise none of the xattrs will be restored. Signed-off-by: Andreas Dilger Change-Id: I0e0db7782fccbaf91cbf39dd4c8d030582e7786a Reviewed-on: https://review.whamcloud.com/30251 Tested-by: Jenkins Reviewed-by: Joseph Gmitter --- BackupAndRestore.xml | 84 +++++++++++++++++++++++++++++----------------------- 1 file changed, 47 insertions(+), 37 deletions(-) diff --git a/BackupAndRestore.xml b/BackupAndRestore.xml index 0f7fc0a..136afc6 100644 --- a/BackupAndRestore.xml +++ b/BackupAndRestore.xml @@ -539,13 +539,12 @@ Changelog records consumed: 42 [oss]# getfattr -R -d -m '.*' -e hex -P . > ea-$(date +%Y%m%d).bak - If the - tar(1) command supports the - --xattr option, the + If the tar(1) command supports the + --xattr option (see below), the getfattr step may be unnecessary as long as tar - does a backup of the - trusted.* attributes. However, completing this step - is not harmful and can serve as an added safety measure. + correctly backs up the trusted.* attributes. + However, completing this step is not harmful and can serve as an + added safety measure. In most distributions, the @@ -562,10 +561,12 @@ Changelog records consumed: 42 ea-$date.bak file has properly backed up the EA data on the OST. - Without this attribute data, the restore process may be missing - extra data that can be very useful in case of later file system - corruption. Look at this file with more or a text editor. Each object - file should have a corresponding item similar to this: + Without this attribute data, the MDT restore process will fail + and result in an unusable filesystem. The OST restore process may be + missing extra data that can be very useful in case of later file system + corruption. Look at this file with more or a text + editor. Each object file should have a corresponding item similar to + this: [oss]# file: O/0/d0/100992 trusted.fid= \ 0x0d822200000000004a8a73e500000000808a0100000000000000000000000000 @@ -574,24 +575,22 @@ trusted.fid= \ Back up all file system data. - [oss]# tar czvf {backup file}.tgz [--xattrs] --sparse . + [oss]# tar czvf {backup file}.tgz [--xattrs] [--xattrs-include="trusted.*" --sparse . The tar - --sparse option is vital for backing up an MDT. In - order to have - --sparse behave correctly, and complete the backup - of and MDT in finite time, the version of tar must be specified. - Correctly functioning versions of tar include the Lustre software - enhanced version of tar at - , - the tar from a Red Hat Enterprise Linux distribution (version 6.3 or - more recent) and the GNU tar version 1.25 or more recent. + --sparse option is vital for backing up an MDT. + Very old versions of tar may not support the + --sparse option correctly, which may cause the + MDT backup to take a long time. Known-working versions include + the tar from Red Hat Enterprise Linux distribution (RHEL version + 6.3 or newer) or GNU tar version 1.25 and newer. - The tar - --xattrs option is only available in GNU tar - distributions from Red Hat or Intel. + The tar --xattrs option is only available + in GNU tar version 1.27 or later or in RHEL 6.3 or newer. The + --xattrs-include="trusted.*" option is + required for correct restoration of the xattrs + when using GNU tar 1.27 or RHEL 7 and newer. @@ -643,10 +642,20 @@ trusted.fid= \ Restore the file system backup. - [oss]# tar xzvpf {backup file} [--xattrs] --sparse + [oss]# tar xzvpf {backup file} [--xattrs] [--xattrs-include="trusted.*"] --sparse + + The tar --xattrs option is only available + in GNU tar version 1.27 or later or in RHEL 6.3 or newer. The + --xattrs-include="trusted.*" option is + required for correct restoration of the + MDT xattrs when using GNU tar 1.27 or RHEL 7 and newer. Otherwise, + the setfattr step below should be used. + + - Restore the file system extended attributes. + If not using a version of tar that supports direct xattr + backups, restore the file system extended attributes. [oss]# setfattr --restore=ea-${date}.bak If @@ -668,15 +677,16 @@ trusted.fid= \ [oss]# rm -f CATALOGS This is optional for the MDT side only. The CATALOGS record the - llog file handlers that are used for recovering cross-server updates. Before - OI scrub rebuilds the OI mappings for the llog files, the related recovery - will get a failure if it runs faster than the background OI scrub. This will - result in a failure of the whole mount process. OI scrub is an online tool, - therefore, a mount failure means that the OI scrub will be stopped. - Removing the old CATALOGS will avoid this potential trouble. The - side-effect of removing old CATALOGS is that the recovery for related - cross-server updates will be aborted. However, this can be handled by LFSCK - after the system mount is up. + llog file handlers that are used for recovering cross-server updates. + Before OI scrub rebuilds the OI mappings for the llog files, the + related recovery will get a failure if it runs faster than the + background OI scrub. This will result in a failure of the whole mount + process. OI scrub is an online tool, therefore, a mount failure means + that the OI scrub will be stopped. Removing the old CATALOGS will + avoid this potential trouble. The side-effect of removing old + CATALOGS is that the recovery for related cross-server updates will + be aborted. However, this can be handled by LFSCK after the system + mount is up. @@ -688,8 +698,8 @@ trusted.fid= \ [oss]# umount /mnt/ost - If the file system was used between the time the backup was made and - when it was restored, then the online + If the file system was used between the time the + backup was made and when it was restored, then the online LFSCK tool (part of Lustre code after version 2.3) will automatically be run to ensure the file system is coherent. If all of the device file -- 1.8.3.1