0

People say that using the cat command dumping to a file is much faster than any other application such as dd, so for the cloning of disks over 2tb I have used the command cat /dev/disk8 > /dev/disk9, but how can I see the progress?, I read that it is possible using the pv command, but only for byte streaming and not for direct dump or intermediary between reading and dump bash.

How can I do it using Linux and Unix platforms (OSX)?

e-info128
  • 3,727
  • 10
  • 40
  • 57
  • 2
    See [How do you monitor the progress of `dd`?](https://askubuntu.com/questions/215505/how-do-you-monitor-the-progress-of-dd); therein, note the `status=progress` option added to the GNU coreutils implementation of `dd` as of 8.24. And also note the [benchmarks by one user there](https://askubuntu.com/questions/215505/how-do-you-monitor-the-progress-of-dd#comment1148916_215590) showing `dd` operating near their SSDs' write speed. – Charles Duffy May 08 '18 at 02:48
  • 3
    Questions about UNIX command-line tool usage are a better fit for [unix.se]; StackOverflow's scope is limited to *software development*. – Charles Duffy May 08 '18 at 02:48
  • 1
    BTW, `pv /dev/disk9` is another approach that avoids any FIFOs in the mix, and thus the attendant overhead. – Charles Duffy May 08 '18 at 02:53
  • @CharlesDuffy the source: https://unix.stackexchange.com/questions/144172/full-dd-copy-from-hdd-to-hdd – e-info128 May 08 '18 at 03:07
  • Yeah, `dd if=... of=...` is going to be dog slow, but that's because they didn't specify `bs=...` with a reasonable value. And the `dd if=... | pv | dd of=...` is slowed down by the FIFOs adding extra context switches, as I mentioned before. I'm not saying Gilles is *wrong*, but I am quite confident in saying that on a modern system, it's not hard (at all!) to saturate I/O bandwidth when correctly using `dd`, making any performance improvement you'd get via other means academic. – Charles Duffy May 08 '18 at 03:11
  • ...and the claim in that link that `dd` has no magic isn't really true -- `O_DIRECT`, for example, falls into the category of magic. See [Why is dd with the 'direct' (O_DIRECT) flag so dramatically faster?](https://stackoverflow.com/questions/33485108/why-is-dd-with-the-direct-o-direct-flag-so-dramatically-faster) – Charles Duffy May 08 '18 at 03:14
  • @CharlesDuffy Thank you very much for the clarifications, it has helped me a lot. – e-info128 May 08 '18 at 03:16
  • If you really are cloning entire disks, you may get better performance using *raw* devices (`/dev/rdisk8`) – Mark Setchell May 08 '18 at 06:28

1 Answers1

0

If this is regular try rsync --progress -avz /dev/disk8 /dev/disk9