You can make GNU dd
show you progress - to quote the man page:
Sending a USR1 signal to a running `dd' process makes it print I/O statistics to standard error and then resume copying.
$ dd if=/dev/zero of=/dev/null& pid=$!
$ kill -USR1 $pid; sleep 1; kill $pid
Schily's dd
(sdd) has a similar option and uses SIGQUIT by default (Ctrl+\
).
Regarding your second question: Yes, dd
just copies all the blocks if used by the filesystem or not - which takes DEVICE_CAPACITY/TRANSFER_RATE seconds.
If you want to avoid copying unused disk blocks you can use tar
:
# cd /mnt/sda
# tar -c -f - . | tar -C /mnt/sdb -x -f -
GNU tar
also has timing options:
# tar -c -f - . --totals=SIGQUIT | tar -C /mnt/sdb -x -f - \
--totals --totals=SIGQUIT
Thus you get read/write statistics when hitting Ctrl+\
and at the end.
Another possibility is to use parted
or gparted
for copying a filesystem - which should be done in a efficient way with filesystems it has enough knowledge of. At least gparted
should display a nice graphical progress dialog.
/dev/sda
and/dev/sdb
, right? That's what I meant, sorry.