public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Timothy Shimmin <tes@sgi.com>
To: Jakob Praher <jp@hapra.at>
Cc: linux-xfs@oss.sgi.com
Subject: Re: usage pattern: xfsrestore to mirror disks
Date: Mon, 09 Jul 2007 15:03:54 +1000	[thread overview]
Message-ID: <4691C1BA.4040603@sgi.com> (raw)
In-Reply-To: <f6r9pb$qv0$1@sea.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1917 bytes --]

Hi Jakob,

Jakob Praher wrote:
> hi all,
> 
> first of all: I am a very happy user of xfs for a long time now.
> I use xfs in tandem with lvm2 and I have to say I am very pleased.
> 
> Now a question:
> 
> There are two modes of using xfs(dump,restore): non-cumulative and 
> cumulative. Is this cumulative mode also good to work with full dumps 
> (level0). E.g. the data I have to mirror is not large, and I don't want 
> to rely on inventory data. So I want for instance if between two full 
> dumps a file F was deleted, it should get deleted when I do xfsrestore 
> for the second time.
> 
> I don't keep the xfsdump output files but i just apply them via ssh. So 
> something like that would be great!
> 
> Maybe someone can shed some light on that.
> 

The cumulative mode really only relates to restore and not xfsdump.
xfsrestore in cumulative mode keeps its version of the directory tree
around (restoredir/xfsrestorehousekeepingdir/tree) so that it can use
it to compare with and decide if directory entries have been renamed,
deleted etc.. The code has been written to do this given an initial
level 0 dump and then delta dumps (incremental or resumed).
If you try to use a 2nd level 0 dump on restore then it will fail to
work - it won't restore anything.
It fails in xfsdump/restore/content.c/dumpcompat() when it
compares the restores uuid from persp->a.lastdumpid with the
incremental's uuid stored in scrhdrp->cih_last_id (and for a full
dump the cih_last_id won't be set).
Unfortunatly, a flag is set in restore so that it stops it from reporting
this error (not sure why).
I tried circumventing this uuid check (see the patch) and things
seemed to work ok (it did the renames and deletes).
However, I'm uncertain of any other repercussions - it's been a while
since I looked at cumulative restores. Maybe others might know.

I wonder if other tools might be useful to you... xfscopy,...?

--Tim




[-- Attachment #2: restore_hack.patch --]
[-- Type: text/plain, Size: 836 bytes --]


===========================================================================
Index: xfsdump/restore/content.c
===========================================================================

--- a/xfsdump/restore/content.c	2007-07-09 14:41:15.000000000 +1000
+++ b/xfsdump/restore/content.c	2007-07-09 14:36:54.000000000 +1000
@@ -2019,7 +2019,7 @@ content_stream_restore( ix_t thrdix )
 		} else if ( dumpcompat( resumepr,
 					level,
 					*baseidp,
-					BOOL_FALSE )) {
+					BOOL_TRUE )) {
 			if ( uuid_compare( lastdumprejectedid,
 					 grhdrp->gh_dumpid) == 0) {
 				matchpr = BOOL_FALSE;
@@ -6762,7 +6762,7 @@ dumpcompat( bool_t resumepr, ix_t level,
 						  "selected dump not based on "
 						  "previously applied dump\n"));
 					}
-					return BOOL_FALSE;
+					/*return BOOL_FALSE;*/ return BOOL_TRUE;
 				}
 			}
 		}

  reply	other threads:[~2007-07-09  5:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-08 18:18 usage pattern: xfsrestore to mirror disks Jakob Praher
2007-07-09  5:03 ` Timothy Shimmin [this message]
2007-07-10 19:24   ` Jakob Praher
2007-07-10 20:13     ` Bill Kendall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4691C1BA.4040603@sgi.com \
    --to=tes@sgi.com \
    --cc=jp@hapra.at \
    --cc=linux-xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox