How to Clone a Bootable (Ubuntu) USB Drive on a Mac

In my classroom we use USB drives as our primary drives, booting up the operating system (Ubuntu) from them, running software from them, and storing documents on them (for a how-to, see my previous post). After doing a "clean" install, I often want to make a perfect duplicate of that drive onto another drive, so that I have a spare ready to go in case a student needs one temporarily.
Unfortunately, the process of duplicating, or "cloning" a USB drive is surprisingly convoluted. The quickest way to do this on a Mac is to use the terminal command dd as outlined below. Be aware that it actually takes longer to clone a drive than it does to perform a manual install, but you don't have to click through the steps, and you will have a complete duplicate of the original USB drive on the second USB drive. (It goes without saying that you take my advice at your own risk!)- Plug in both USB drives (they must be the same size, of course). If prompted that either of the disks is "uninitialized" just click Ignore.
- Open the terminal and run this command: diskutil list
- A list of drives will appear. Find your bootable USB (source) and empty USB (destination) drive names. (On my Macbook, they were /dev/disk2 and /dev/disk3 respectively.)
- In the terminal, type the following command, but replace diskA with your source drive, and diskB with your destination drive: dd if=/dev/diskA of=/dev/diskB conv=notrunc
- If you get an error message that says "Resource busy" run the Disk Utility program, click each of the partitions on the busy drive, and click the "Unmount" button. Do NOT eject the drive. Then try step 4 again.
- Wait a long time. When the dd command is finished, you can eject the newly cloned USB and try to boot it up in another computer.
(Thanks to pjen from Flickr.com for the image.)