Re: OT: fastest way to copy one drive to another

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

 



On Fri, Sep 07, 2018 at 11:10:08AM +1000, Cameron Simpson wrote:
> On 06Sep2018 19:20, Ranjan Maitra <maitra@xxxxxxxxx> wrote:
> >I have two drives mounted on a F28 system. Both are identical 4TB
> >drives. The second one is empty. I am concerned about the first
> >one failing so would like to copy the contents (which are around
> >3.7 TB) to the second.
> >
> >What is the fastest way to copy the contents of the first drive to
> >the second? I was using rsync, but is there a better way?

while the other suggestions might be faster, I prefer to use dd
(or ddrescue) 'cause it gives a bit-for-bit copy of everything
on the drive, partitions and all. ddrescue is handy in case it
finds spots that are hard to read on the source drive, it goes
back and retries them til it gets a good read.


> 
> I like "cp -a", it is faster than rsync. Rsync's strength is
> incremental update: make a sweep afterwards with rsync to convince
> yourself it is correct.
> 
> Even faster is a tar pipeline:
> 
>  cd /drive1
>  tar cf - . | ( cd /drive2; tar xf - )
> 
> because both cp and rsync do one file at a time. There will
> inherently be small pauses at each file boundary. Actually, rsync
> might stream a little.
> 
> Using piped tars and many files, particularly many small files, the
> first tar can get ahead of the second tar for better throughput -
> the data queued in the pipe (which has a buffer, and a generous one
> on Linux) allows the first tar to proceed until the pipe is full if
> the second tar is blocked.  (The second tar will of course be
> blocked writing to drive2, but it won't be blocked reading from
> drive1 because the first tar can read followon files from drive1
> which the second tar reads from the pipe).
> 
> However, if you're already a significant way through your copy you
> may as well stick with rsync unless you can easily do things in
> chunks, as changing systems means wasting time copying already
> copied data. Do a "df" and make an estimate.
> 
> If there are still hours to go you could consider switching methods
> and doing the uncopied subdirectories:
> 
>  cd /drive1
>  tar cf - uncopieddir1 uncopieddir2 ... | ( cd /drive2 ; tar xf - )
> 
> and then come back with rsync afterwards to clean up the rest:
> 
>  rsync -iaP /drive1/ /drive2/
> 
> Cheers,
> Cameron Simpson <cs@xxxxxxxxxx>
> _______________________________________________
> users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
> To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
> Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx

-- 
---- Fred Smith -- fredex@xxxxxxxxxxxxxxxxxxxxxx -----------------------------
               But God demonstrates his own love for us in this: 
                         While we were still sinners, 
                              Christ died for us.
------------------------------- Romans 5:8 (niv) ------------------------------
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux