2016-01-08 BSD dd progress

The commandline utilities that come installed with OS X originate from the BSD world. This means that option-wise, they're fairly spartan as opposed to GNU userland.

Today, I needed to create a bootable USB stick to install Ubuntu. It works fine and basically tells you to use dd to copy a bootable image to a USB stick.

Now if you have a slow USB stick, this can take ages and you're wondering if it's making progress. To see what it's doing, open another terminal and find the process number of dd:

  $ ps -ef | grep "dd if"
  501 76765   412   0 11:29AM ttys000    0:16.19 dd if=/Users/bartvk/Desktop/ubuntu-15.10-desktop-amd64.img of=/dev/disk1 bs=1m
  501 76786 75363   0 11:29AM ttys002    0:00.00 grep "dd if"

The second number of the first line is the process ID, in this case, 76765. Now run the following command:

 $ while true; do sudo kill -SIGINFO 76765; sleep 5; done

This will cause the running dd to print out statistics (roughly) every 5 seconds.

Image 2016-01-08 dd progress.png