-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
bad sector wrote:
>
> I copied a folder to another as a backup experiment using
>
> rsync -avh /0/1/this /0/
>
> target:
> 5.9 GiB (6,282,464,113) 32,715 files, 2,476 sub-folders
>
> but if instead I command
>
> rsync -ach /0/1/this /0/
>
> then the target folder size becomes
>
> 5.9 GiB (6,282,496,881)
>
> What rsync command do I need to end up with EXACTLY
> the same number of files and total size, the same as
> if I had used dd?
None will -- there's a distinct difference between a block-level copy
(via dd) and a file-level copy (cp / scp / rsync ) that will affect
"size on disk".
- Block level copies will include any extra fragmentation that the
source has (and therefore overhead), whereas new copies of files
will (on an EXT4 filesystem, anyway) be allocated enough extents
(i.e. contiguous blocks) to complete the write in one go.
- Both of your sets of option switches will not copy any extended ACL
information that may have been in SOURCE ('-A' for that)
- Different filesystems can have different blocksizes, which would
somewhat reduce "used space on disk" as well.
With the assumption that both '-ah' and '-ach' ('-v' just ups the
verbosity to stdout, so ignoring that switch) were run sequentially with
the same SOURCE and DEST; the increase of ~30 KiB is most likely due to
file changes prompted by simply using the system -- for example, if
$HOME was your SOURCE, some graphical application(s) writing to
.xsession-errors , or new data in your .mozills caches, etc.
>
> The reason I want exactness is because after the copy
> I want to add 1 file to the source, then do some sort
> diff test and see as a result ONLY that added file and
> its size as the difference.
Easiest way to do this is add the '-P' switch.
It changes the output from something like this (-avch):
sending incremental file list
./
testfile
sent 386 bytes received 38 bytes 848.00 bytes/sec
total size is 192.53K speedup is 454.08
To this (-avchP):
sending incremental file list
./
testfile2
21 100% 0.00kB/s 0:00:00 (xfr#1, to-chk=1/8)
sent 413 bytes received 38 bytes 902.00 bytes/sec
total size is 192.55K speedup is 426.94
Note that in both cases, having nothing to update results in this:
sending incremental file list
sent 342 bytes received 12 bytes 708.00 bytes/sec
total size is 192.55K speedup is 543.93
Note that rsync counts its overhead (i.e. file metadata that is
generated on the fly to be shared from SOURCE to DEST, and DEST response
to SOURCE) in the bytes sent/received. The "Total Size" at the bottom
is the actual size of SOURCE (less overhead).
And if one were to remove the 'verbose' switch, all you get for
"unchanged" output is the single line "sending incremental file list";
which is kind of completely useless :).
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEE3asj+xn6fYUcweBnbWVw5UznKGAFAmK1/roACgkQbWVw5Uzn
KGDS5RAAgmHsl+XyTOBOtIbH6jlRvq5k7cglGSeq0Q0/DKBFkNEPRneLwZv0u9gX
EOkhJXE1dYnGJRUykL8T8NpS/mWg9Fjn/M5eMxiZFgpZbFUThH28c1oI/7XUl5u/
lGXa3tOPFleVOfd9okUpQN6JWVOlur3x/kcK7u6Jffef+jHf2Waw+bAKGmUwJQCO
IBjgQqGcda+WLeQL4/IbSeF9XFFoXoiD9YWKUmeJynoISZaxRuk9EKFTvLmlYC/c
GNzITw00Keqp11f3DzDSbtLkPBtYLJWDs/UFMzMHfNwRKedLxh5RzWQHZPp1E+Dz
YwvgbtpdSgMVhnK2Nqf2p5SWL9EZcrCEQSZ9vQRYJz+wQiUjnXLzVcZ2HndoAv6l
dJ9zG8bS0ekhHu5mKZC9fo0DbyHnUAigLyk5rEjYHvvMh6mtVb6vfyii3WRWjPKy
Tyc2imwol1JTfPflvHtREJXIciqPBb/rBvY9+JXAdYx1m+vdeSMM0jyr5eWnJJVb
0ENq8cP0NIFFexIO4Y60r6D4YxBR0znAJNiVIYYlGGV/3pZI1VcsaN0jLGzHarre
RDp2Lg5AaQlRkXcgBkXJ6NFFgpV9NUiq3lhCYz0jiF7w8iv3wt613rmhsCitomE6
bn3Oa0yblhV6s43p29XME7EYY1/zB3egztvHePzS+3+OWNWnMyg=
=p+g3
-----END PGP SIGNATURE-----
--
|_|O|_|
|_|_|O| Github:
https://github.com/dpurgert
|O|O|O| PGP: DDAB 23FB 19FA 7D85 1CC1 E067 6D65 70E5 4CE7 2860