Install xz with homebrew:
brew install xz
Insert the SD and get the device name for the SD with df
:
Filesystem 512-blocks Used Available Capacity iused ifree %iused Mounted on
/dev/disk1 487867392 157859992 329495400 33% 2352643 4292614636 0% /
devfs 373 373 0 100% 647 0 100% /dev
map -hosts 0 0 0 100% 0 0 100% /net
map auto_home 0 0 0 100% 0 0 100% /home
/dev/disk2s1 124702720 61860336 62842384 50% 5090 4294962189 0% /Volumes/USBDisk
/dev/disk3s1 130780 130780 0 100% 512 0 100% /Volumes/SD
In this case, the SD is /dev/disk3
.
Unmount the SD card:
sudo diskutil unmount /Volumes/SD
Decompress the ubuntu image you downloaded:
unxz ubuntu-mate-16.04.2-desktop-armhf-raspberry-pi.img.xz
Write the uncompressed image to the SD card simply using dd
, no need to use ddrescue
:
sudo dd bs=1m if=ubuntu-mate-16.04.2-desktop-armhf-raspberry-pi.img of=/dev/rdisk3