Gentoo Archives: gentoo-user

From: Mick <michaelkintzios@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Copying data efficiently
Date: Sat, 17 May 2014 19:41:53
Message-Id: 201405172041.41217.michaelkintzios@gmail.com
In Reply to: Re: [gentoo-user] Copying data efficiently by meino.cramer@gmx.de
1 On Saturday 17 May 2014 08:59:08 meino.cramer@×××.de wrote:
2 > Mick <michaelkintzios@×××××.com> [14-05-17 09:48]:
3 > > On Saturday 17 May 2014 04:33:57 meino.cramer@×××.de wrote:
4 > > > Hi,
5 > > >
6 > > > is there any tool in the Gentoo portage which may speed up (make it
7 > > > mopre efficient) the following task:
8 > > >
9 > > > On my HD there are data I want to copy to two identical external HDs.
10 > > > These HDs are of the same type/model and each is separately
11 > > > connectable via USB to my PC (...these two of the typical mobile
12 > > > external USB-HDs).
13 > > >
14 > > > Instead of copying the data twice from my PC to eah of the HDs I want
15 > > > to do it once...like I would be able to give the cp-command two
16 > > > instead of one target where to copy two.
17 > > >
18 > > > The result should be two identically populated external HDs, each of
19 > > > them useable/readable without the need to the other one.
20 > > >
21 > > > What tool of the portage tree I able to accomplish this task?
22 > > >
23 > > > Best regards,
24 > > > mcc
25 > >
26 > > 1. You could set up the two ext drives as a mirrored RAID and use your
27 > > copying/tar-ing/dd tool of choice.
28 > >
29 > >
30 > > 2. Or you could use pipe and tee to split the feed into any devices you
31 > > want,
32 > >
33 > > e.g.:
34 > > pv /dev/sda1 | tee >(dd of=/dev/sdb1) >(dd of=/dev/sdc1)
35 > >
36 > > 3. Or you could use a sequential copy:
37 > > cp -a /home /dev/sdb1/ && cp -a /home /dev/sdc1
38 > >
39 > > NOTES:
40 > >
41 > > a) Unlike other commands, pv will give you a progress bar so that you
42 > > know how long your back up is taking.
43 > >
44 > > b) The 3rd example above will copy sequentially, but depending on the
45 > > size of the file(s) the second copy may be read from cache.
46 > >
47 > > c) If you're doing this over the network then you can use nc in listening
48 > > mode at the receiving end, or ssh if the network is untrusted.
49 > >
50 > >
51 > > I'm interested to see what other ways will be suggested for this task.
52 >
53 > Hi Mick,
54 >
55 > thank your reply! :)
56 >
57 > From your numbering of the possibilities...
58 > 1.) ...I am no RAID guru and would try this later with data, which
59 > are not valuable...
60
61 If the drives are not permanently connected, then you will have to assemble
62 the RAID each time you want to copy something, after you plug them in.
63 Perhaps not the most efficient method.
64
65
66 > 2.) That looks interesting! Unfortunately it seems to copy device
67 > contents on low level instead of files. The source are directory
68 > structure -- not whole devices...
69
70 Well, I just offered an example for a whole drive. You will need to point it
71 to the file(s) you want to copy over. The pv command works like cat;
72
73 e.g. cat myfile | tee >(blah ...)
74
75 is the same like:
76
77 pv myfile | tee >(blah ...)
78
79 > Or did I overlook an option mentioned in the manpage...?
80 > 3.) The files I want to copy are in the size of some GB each. So the
81 > cache isnt big enough to hold ALL files for the second part.
82 >
83 >
84 > Best regards,
85 > mcc
86
87 --
88 Regards,
89 Mick

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] Copying data efficiently Neil Bothwick <neil@××××××××××.uk>