usage pattern: xfsrestore to mirror disks
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.
thanks
--Jakob
Hi Jakob,
Quoted 5 lines · Jakob Praher
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.
Quoted 8 lines
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
===========================================================================
Index: xfsdump/restore/content.c
===========================================================================
xfsdump/restore/content.c +2 -2
@@ -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 ; } } }
Hi Timothy,
thanks for your quick response.
I will apply your patch and try it out.
Quoted 4 lines · Timothy Shimmin
Hi Jakob,
I wonder if other tools might be useful to you... xfscopy,...?
that would be very interesting for me.
-- Jakob
Quoted 5 lines
--Tim
Hi Jakob,
If I'm understanding your issue correctly, it sounds like rsync would be a good tool for your needs. Or is there some reason you're not using rsync?
Bill
Quoted 19 lines · Jakob Praher
Hi Timothy,
thanks for your quick response.
I will apply your patch and try it out.Quoted 4 lines · Timothy Shimmin
Hi Jakob,
I wonder if other tools might be useful to you... xfscopy,...?
that would be very interesting for me.
-- Jakob
Quoted 5 lines
--Tim