xfs
[Top] [All Lists]

Re: [Fwd: Feedback]

To: <davidlm@xxxxxxxxxxx>
Subject: Re: [Fwd: Feedback]
From: ivanr@xxxxxxxxxxxxxxxxx (Ivan Rayner)
Date: Tue, 29 May 2001 12:10:19 +1000
Cc: <linux-xfs@xxxxxxxxxxx>
In-reply-to: <3B126A4B.CB83B7FA@sgi.com>
Sender: owner-linux-xfs@xxxxxxxxxxx
The original questions were mailed to the Linux XFS project mail list but
were really about IRIX.  I'd suggest contacting SGI's customer support or
perhaps posting to comp.sys.sgi.admin in future, but I'll answer the
questions here as they are still relevant to both operating systems.

> Date: Mon, 28 May 2001 05:07:36 -0700
> From: davidlm@xxxxxxxxxxx (david martin)
>
>  I have too questions that I can't seem to figure out.
> 1\) Is it possible to use xfsdump and restore to creat and archive
> without the directory structure hard coded in.  i.e.
...
>   This is when I tried using xfsdump piped into xfsrestore to
>   copy a directory under a filesystem to another directory:
>
>   \(the 'restor_testing' is relative to /usr/people/cjones\)
>   samantha 1# cd /usr/people/cjones
>   samantha 8# xfsdump -s cjones/xlv_stuff - /usr/people \| xfsrestore -
> restore_testing
> .... and what I saw when it was done:
> samantha\[/usr/people/cjones/restor_testing/cjones/xlv_stuff\]ls -l
...
>   ***** now it didn't quite restore the data the way I wanted...  what I
>        wanted was this:
>
>   samantha\[/usr/people/cjones/restor_testing\]ll
...
> # This allowed me to create and restore but ZI wanted the data to be
> restored in a new location without creating the old directory structure
> in  the new directory.Is there a ways to do this\?

This is an interesting question, which provoked a lively discussion here.
The show answer is 'no', but if you want the medium length answer, read
on...

Basically the problem is that xfsdump is a _filesystem_ dump utility, not
a directory dump utility like tar.  It is not designed to do what you want
it to, and I would argue that it would be wrong to to give it this
feature.

What you ask seems simple and reasonable, but really it is neither.
First, is it the responsibility of xfsdump or xfsrestore?  xfsdump is
designed to create filesystem backups which means it has to maintain the
original directory structure - it does this by storing a map of the
directories in the dump.  To do what you want would mean that either
xfsdump would have to store a different directory structure in the dump,
or that xfsrestore would have to know how to compress the directory
structure the way you want.  xfsrestore would be unable to tell whether
the directory map in the dump matched the original filesystem or not - it
simply restores whatever is in the dump.  It would be unreasonable to ask
xfsrestore to somehow arbitrarily compress the directory structure as
there would be just too many variables, eg. name clashes, etc.

So, why can't xfsdump adjust the directory map when it writes the files?
First, you can specify several subdirectories with '-s', so it too would
have to deal with the possibility of name clashes.  Second, there's no way
for xfsrestore to tell whether xfsdump has adjusted the map in some way,
so unexpected things may happen if the dump is restored a year later, and
the operator doesn't know how the dump was performed.  Third, we can't
change the format of the dump to include exta information as we need to
remain forwards and backwards compatible with IRIX. Fourth, xfsdump
supports incremental dumps, and it's possible you could get into a real
mess if some parts of the series of dumps were restored to different
places in the filesystem.  Fifth, xfsdump was written in such a way as to
make implementation of this feature a real headache.  I'm sure there are
many other combinations and scenarios where horrible things could
happen...

What you want to use is cp, tar or cpio.  Or, if you really need to use
xfsdump/xfsrestore because you want to keep your extended attributes, then
just use the good ol' mv command after the restore.  But in the end,
xfsdump and xfsrestore are simply the wrong tools for the job.


> 2\)  I have been having trouble using xfsdump and restore on nfs mounted
> filesystems.  Is there a option that has to be issued, a way to work
> around this or does it just no work in this version\?  Thank you in
> advance....

xfsdump uses system calls that are specific to XFS to improve performance
and to support XFS specific features.  Unfortunately, NFS simply can't
handle these calls.  I take it your problem is that your tape drive is
attached to a host which is different from the host with the filesystem
you want dumped.  If this is the case, I'd suggest you try using xfsdump's
remote tape feature - ie. you can specify the hostname of the machine with
the attached tape drive as part of the tape device (hostname:/dev/tape).
See the xfsdump manpage for more details.

Ivan

-- 
Ivan Rayner
ivanr@xxxxxxxxxxxxxxxxx







<Prev in Thread] Current Thread [Next in Thread>
  • Re: [Fwd: Feedback], Ivan Rayner <=