I am using the following command to create a bootable SD Card
sudo dd bs=4m if=en_windows_10_enterprise_version_1511_x64_dvd_7224901.iso of=/dev/disk2
Is there a way to track the progress?
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.Sign up to join this community
The same information, displayed every second by in klanomath's answer, can displayed using your command. You just need to enter a controlT character from the keyboard while the
dd command is executing.
By pressing the controlT character, you are sending the same
SIGINFO signal to the
dd command that the command
pkill -INFO -x dd sends.
As of coreutils 8.24, dd added a status options. Install coreutils with Homebrew to update dd.
brew install coreutils # All commands have been installed with the prefix 'g' sudo gdd if=XXXX.iso of=/dev/diskX bs=1 status=progress > example: > 139648967 bytes (140 MB, 133 MiB) copied, 304 s, 459 kB/s
You can press Control + t while the
dd command is running or for a nice progress bar you can install
pv (pipe viewer) via Homebrew:
brew install pv
and then execute:
sudo dd if=disk-image.img | pv | sudo dd of=/dev/disk2
or (knowing size of the image, 16GB in this example):
dd if=disk-image.img | pv -s 16G | dd of=/dev/disk2
Example output 2:
(data transferred, elapsed time, speed, progress bar and estimated time):
1.61GiB 0:12:19 [2.82MiB/s] [===> ] 10% ETA 1:50:25
dd itself doesn't provide a progress bar. You may estimate the progress of the dd copy process by adding a pkill -INFO command though.
dd if=/dev/zero of=/dev/null bs=64m count=1000 & while pkill -INFO -x dd; do sleep 1; done
 37691 0+0 records in 0+0 records out 0 bytes transferred in 0.028923 secs (0 bytes/sec) 275+0 records in 275+0 records out 18454937600 bytes transferred in 1.029698 secs (17922667819 bytes/sec) 553+0 records in 553+0 records out 37111201792 bytes transferred in 2.048291 secs (18118129881 bytes/sec) 829+0 records in 829+0 records out 55633248256 bytes transferred in 3.068911 secs (18128009214 bytes/sec) 1000+0 records in 1000+0 records out 67108864000 bytes transferred in 3.720346 secs (18038339571 bytes/sec) + Done dd if=/dev/zero of=/dev/null bs=64m count=1000
Which translates to a whopping 18.1 GB/s.
First of all, install Homebrew Package Manager. Then you have to install
dialog with this command:
brew install pv dialog
You can then run this command to get a progress bar with the command:
dd if=disk.img bs=1m | pv disk.img | dd of=/dev/diskX bs=1m
but make sure to replace
disk.img with the path to the image and
diskX with your SD card's disk identifier. If you want something more graphical, you can try this:
(dd if=disk.img bs=1m | pv -n disk.img | dd of=/dev/diskX bs=1m conv=notrunc,noerror) 2>&1 | dialog --gauge "Writing image to SD card..." 10 70 0
That is easy! For macOS High Sierra and below, just run a while loop and it will run until it is finished. Just make sure to do the code below in another window:
The code below will work out of box while in a firmware boot or within the full blown OS
while kill -0 $PID; do caffeinate -t 10 kill -INFO $PID echo "still copying file" "$(date)" done
^ To keep the machine awake (caffeinate) without the use of “homebrew” or tools not available in standard Mac OS X since homebrew requires internet and an actual OS to install it on.
NOTE: The above needs you to substitute the PID with your process ID and it will constantly show the progress