[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: tar on nfs freezes



On Sat, Jun 30, 2001 at 12:18:29AM +0200, Joerg Johannes wrote:
> Dimitri Maziuk wrote:
> > 
> > * Joerg Johannes (liste_joerg@gmx.de) spake thusly:
> > > Hello list
> > >
> > > My friend just bought a new HD, and wanted to throw out the old one. So
> > > what we did was
> > > - mount an nfs directory from my server (/nfsroot)
> > > - tar cplf - /root | (cd /nfsroot && tar xpf)
> > > - threw the HD out
> > > - started rescue system, partitioned, made filesystems
> > > - mounted /nfsroot and /newroot (on the new HD)
> > > - tar cplf - /nfsroot | (cd /newroot && tar xpf)
> > > during the last step, his machine freezes (it's SuSE and SuSE kernel
> > > with reiserfs), mine, the server, does not
> > >
> > > So, why could that be? (jumpers on the hd are all ok, one partition is a
> > > windows one, and windows works, too)
> > 
> > Which last step: tar -c, cd or tar -x? Can he read from /nfsroot?
> > Can he write to /newroot? Was it really "tar xpf" or was it "tar xpf -" (hint)?
> > 
> > Dima
> 
> Oh, sorry, it was "xpf -". The freeze appeared after about 1 GB has been
> copied.
> We worked around it: cp -a does the same job and does not freeze. (I
> found it in "Linux in a nutshell". The tar way was suggested by the
> german Linux-Magazin. that worked for me on local-only filesystems)
> 
For copying large abounts of data over the network I suggest
using a netcat tunnel. This works faster than scp and doesn't
need any network file systems.

1. On the destination system start netcat listening on an
arbitrary port and piping it's output to tar. (Make sure that
you're in the right directory, since tar will extract into the
current directory. Alternatively you can use the -C option)
  e.g.: nc -l -p $PORT | tar -xf -

2. On the source system pipe the output of tar to netcat which
sends the data over the network to the destination machine.
  e.g.: tar -cf - $DIRECTORY | nc $HOST $PORT

3. Just sit back and wait :)

Cheers
Martin

-- 
The IBM 2250 is impressive ...
if you compare it with a system selling for a tenth its price.
		-- D. Cohen

Attachment: pgpuknCCPHNN6.pgp
Description: PGP signature


Reply to: