Gentoo Archives: gentoo-user

From: Joerg.Schilling@fokus.fraunhofer.de (Joerg Schilling)
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: [OT] fast recursive local copy
Date: Fri, 14 Aug 2009 08:51:24
Message-Id: 4a852565.lHzcWaqePAPBfdw4%Joerg.Schilling@fokus.fraunhofer.de
In Reply to: [gentoo-user] Re: [OT] fast recursive local copy by Nikos Chantziaras
1 Nikos Chantziaras <realnc@×××××.de> wrote:
2
3 > On 08/14/2009 05:47 AM, meino.cramer@×××.de wrote:
4 > > Hi,
5 > >
6 > > I am looking for a faster way to do a
7 > >
8 > > cp -a r<thisdir> <thatdir>
9 > >
10 > > locally on one machine with one harddisk inside.
11 > >
12 > > Is there a neat trick to accomplish this faster than
13 > > good old cp?
14 >
15 > Nope. Some people like to use pipes in hope to speed it up, something like:
16 >
17 > tar -c <thisdir> | tar -xC <thatdir>
18 >
19 > but this isn't really faster and fscks up sparse files.
20
21 Pipes definitely do not speed up things, they slow things down as pipes
22 introduce a significant system overhead.
23
24 The fastest method for copying directory trees (typicalls 30% faster than any
25 other known method) is to use star:
26
27 star -copy -p -xdot -acl -sparse -C <fromdir> . <todir>
28
29 Do not forget the '.' !!!!!
30
31 Note that on Linux you may _need_ to add "-no-fsync" because file I/O is slow
32 on Linux. On Solaris, not using -no-fsync slows things down by aprox. 10% but
33 allows star to grant that everything was really copied to stable storage.
34 On Linux, ot using -no-fsync slows things down by aprox. 400%, this is why
35 I recommend to add "-no-fsync". BTW: other programs behave like star
36 "-no-fsync" by default.
37
38 It may help to speed up things (in case you have enough RAM) to add: fs=128M
39 Use no more than 1/2 of the physical RAM as FIFO size.
40
41 Star implements the most effective way since more than 20 years. The idea is
42 to use a FIFO made of shared memory and to let star fork by default into two
43 processes that work independently.
44
45
46 Jörg
47
48 --
49 EMail:joerg@××××××××××××××××××××××××.de (home) Jörg Schilling D-13353 Berlin
50 js@××××××××××××.de (uni)
51 joerg.schilling@××××××××××××××××.de (work) Blog: http://schily.blogspot.com/
52 URL: http://cdrecord.berlios.de/private/ ftp://ftp.berlios.de/pub/schily

Replies

Subject Author
Re: [gentoo-user] Re: [OT] fast recursive local copy Dirk Heinrichs <dirk.heinrichs@××××××.de>
Re: [gentoo-user] Re: [OT] fast recursive local copy Dirk Heinrichs <dirk.heinrichs@××××××.de>