I want to do a fresh install of Yosemite and I got a brand new 8GB flash drive and I followed this tutorial. I formatted the USB drive and was copying the Yosemite installer, however I got the following error
Copying installer files to disk...
The copy of the installer app failed.
Great. So I tried to reformat the drive again and start over. No. Disk utility says I can't format it because it "cannot unmount the drive". What does that suppose to mean? Then I plug the USB drive to a Windows computer and tried my luck there. No, you can't format the drive because it's "write protected" (there's no physical write protection switch on the drive or anything). Oh dear so now the drive is completely ruined? How can I force format the drive?

Now in the terminal I used sudo diskutil unmountDisk force disk1 to successfully unmount the drive, but still I can't format it! Disk utility gave me a new error "Unable to write to the last block of the device."
Error: -69760: Unable to write to the last block of the device. – LWZ Dec 05 '14 at 23:32The copy of the installer app failederror. I solved it by removing and reinserting the drive, unmounting it withdiskutil unmount /Volumes/yadda, and then killing its configuration withdd if=/dev/zero bs=1m count=8192 of=/dev/disk2. Adjust device to taste. After the dd, removing and reinserting the drive prompted me to initialize, which I did successfully using Disk Utility. – ghoti Dec 30 '15 at 15:24