Skip to content

Instantly share code, notes, and snippets.

@pyramation
Last active November 6, 2020 05:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pyramation/0c5a8bfdd89e140b5e85693f33e4614a to your computer and use it in GitHub Desktop.
Save pyramation/0c5a8bfdd89e140b5e85693f33e4614a to your computer and use it in GitHub Desktop.

Format the USB Stick

  • Launch Disk Utility from Applications>Utilities or Spotlight search
  • Insert your USB stick and observe the new device added to Disk Utility
  • Select the USB stick device (you may need to enable the option View>Show All Devices) and select Erase from the tool bar (or right-click menu)
  • Set the format toMS-DOS (FAT) and if the option shows, the scheme to GUID Partition Map
  • Check you’ve chosen the correct device and click Erase

Burning the drive

Thanks to this post I found information below:

locate the disk

Run df -h to locate the SD card's partition, which will be in the pattern /dev/diskns1, where n is an integer. In this case, it's /dev/disk2s1 (the other two are external USB hard drives).

$ df -h
Filesystem      Size   Used  Avail Capacity iused               ifree %iused  Mounted on
/dev/disk1s1   466Gi  422Gi   33Gi    93% 9569543 9223372036845206264    0%   /
devfs          194Ki  194Ki    0Bi   100%     672                   0  100%   /dev
/dev/disk1s4   466Gi   10Gi   33Gi    24%      10 9223372036854775797    0%   /private/var/vm
map -hosts       0Bi    0Bi    0Bi   100%       0                   0  100%   /net
map auto_home    0Bi    0Bi    0Bi   100%       0                   0  100%   /home
/dev/disk2s1    29Gi  1.5Mi   29Gi     1%       0                   0  100%   /Volumes/UBUNTU

Unmount the partition

$ sudo diskutil unmount /dev/disk2s1
Password:
Volume UBUNTU on disk2s1 unmounted

ensure it's not mounted

Check that it's been unmounted/it no longer shows up when you run df -h (otherwise that's what causes the Resource busy error above

Filesystem      Size   Used  Avail Capacity iused               ifree %iused  Mounted on
/dev/disk1s1   466Gi  422Gi   33Gi    93% 9569543 9223372036845206264    0%   /
devfs          194Ki  194Ki    0Bi   100%     672                   0  100%   /dev
/dev/disk1s4   466Gi   10Gi   33Gi    24%      10 9223372036854775797    0%   /private/var/vm
map -hosts       0Bi    0Bi    0Bi   100%       0                   0  100%   /net
map auto_home    0Bi    0Bi    0Bi   100%       0                   0  100%   /home

burn the disk

While it's still unmounted, burn the disk using dd command

 sudo dd bs=1m if=/Users/dlynch/Desktop/ubuntu-20.10-desktop-amd64.iso of=/dev/rdiskn

replacing n with the N in /dev/diskNs1 from df -h step. Make sure to write to /dev/rdiskN (the disk) and NOT /dev/diskNs1 (the partition), which is something else that causes the Resource busy error. Also, the reason to use /dev/rdiskN and not /dev/diskN is a performance issue you can read more about here

For me it was disc2, so

$  sudo dd bs=1m if=/Users/dlynch/Desktop/ubuntu-20.10-desktop-amd64.iso of=/dev/rdisk2
2805+1 records in
2805+1 records out
2942003200 bytes transferred in 349.080290 secs (8427870 bytes/sec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment