6

I'm running on server A (Source):

dd bs=16M if=/dev/sda|bzip2 -c|nc serverB.example.net 19000

On server B (Destination):

nc -l -p 19000|bzip2 -d|dd bs=16M of=/dev/sdb

Do I need to see some progress somewhere? (Server's A /dev/sda is 50GB)

I've been waiting for 20 minutes, still both are running, how can I know that its really transferring data / etc?

user9517
  • 114,104
  • 20
  • 206
  • 289
soulSurfer2010
  • 297
  • 3
  • 9

7 Answers7

8

Send the dd process a USR1 signal:

$ dd if=/dev/urandom of=/dev/null &
[1] 977
$
$ kill -USR1 977
274647+0 records in
274646+0 records out
140618752 bytes (141 MB) copied, 17.3286 s, 8.1 MB/s
$
Cakemox
  • 24,141
  • 6
  • 41
  • 67
8

¿have you tried pv? http://www.ivarch.com/programs/pv.shtml

dd bs=16M if=/dev/sda|bzip2 -c| pv | nc serverB.example.net 19000
nc -l -p 19000| pv | bzip2 -d| dd bs=16M of=/dev/sdb

good luck!

mrc
  • 1,446
  • 11
  • 12
4

Find the PID of the process that you want to check the I/O for in your case the dd on server b would be a good place to look then

cat /proc/<PID>/io

look at the value for wchar which should be the bytes written value.

For future reference you can insert pv into one (or both) of the pipes and it will tell you how much data has passed through it.

dd bs=16M if=/dev/sda|bzip2 -c|pv|nc serverB.example.net 19000
225MB 0:04:48 [ 799kB/s] [                    <=>                            ]
user9517
  • 114,104
  • 20
  • 206
  • 289
3

Check the man page for dd on your OS, but is should support a USR1 signal which will give you a progress check. If you know the pid of you process, just send it a "kill -USR1 $pid" and it will show you how far it is.

grep
  • 206
  • 1
  • 2
1

You can use iftop to see network traffic or iotop to see IO usage.

mkudlacek
  • 1,657
  • 1
  • 11
  • 15
0

watch -d -n 1 ifconfig on server B. It will highlight all received traffic (RX packets/bytes). Don't count on the accuracy of the values if you're using a 32-bit distribution (you still can see if it's still working).

weeheavy
  • 4,039
  • 1
  • 27
  • 41
0

Newer versions of dd in GNU-Coreutils (>8.24) now include a status argument, to avoid all the pv and USR1 signal hacks:

dd if=/dev/urandom of=/dev/null status=progress

If on a Mac:

brew install coreutils
# All commands have been installed with the prefix 'g'
gdd if=/dev/urandom of=/dev/null status=progress
hurfdurf
  • 933
  • 7
  • 11