If you have tried to create a bootable USB key from an iso image in Mac OSX using Disk Utility then you have probably encountered the frustrating and almost Windows-like cryptic error message “Could not validate source – Invalid argument” error.
Looking in the system log via the Console app I suspect this is because internally DiskUtil tries to run /usr/sbin/asr to verify the image, which fails.
1 2 3 |
$ asr imagescan --source ubuntu-rescue-remix-12-04.iso only UDIF and NDIF images can be scanned. asr: image scan failed - Invalid argument. |
UDIF and NDIF are image formats used by Apple, and Disk Utility is pretty hopeless with anything that falls outside of these standards. The iso standard is short for ISO9660 and is a standard that defines the format of an image intended for burning to CD. Even after using hdutil to convert the image to UDRO (a UDIF Read-Only image) Disk Utility will still stubbornly refuse to help.
Disk Destroyer Duplicator to the rescue
Being Unix based, OSX has the command line dd utility available. Short for Disk Duplicator, dd is a block level reader/writer that makes raw copies from one file to another. But you want to copy the image to a device, right? That’s fine, because everything in the world of Unix/Linux is a file – even devices.
Informally referred to as Disk Destroyer, should you tell dd to output to the wrong device then your day is definitely going to be spoiled, so to avoid any mishaps we will make sure we know which devices on your system is your USB stick. You can determine this from the command line:
1 2 3 4 5 |
$ ls -la /dev/disk* brw-r----- 1 root operator 1, 0 9 Feb 07:49 /dev/disk0 brw-r----- 1 root operator 1, 2 9 Feb 07:49 /dev/disk0s1 brw-r----- 1 root operator 1, 4 9 Feb 07:49 /dev/disk1 brw-r----- 1 root operator 1, 5 9 Feb 07:49 /dev/disk1s1 |
Each physical device will be listed as /dev/disk0, /dev/disk1, /dev/disk2 etc. Each partition on e.g. disk0, is listed as /dev/disk0s1, /dev/disk0s2, /dev/disk0s3 and so on. In the above example, /dev/disk0 is the main boot disk and /dev/disk1 is the USB stick. But there is a nicer way to be sure by typing:
1 2 3 4 5 6 7 8 9 10 11 |
$ diskutil list /dev/disk0 #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *250.1 GB disk0 1: EFI EFI 209.7 MB disk0s1 2: Apple_HFS OSX 249.2 GB disk0s2 3: Apple_Boot Recovery HD 650.0 MB disk0s3 /dev/disk1 #: TYPE NAME SIZE IDENTIFIER 0: FDisk_partition_scheme *8.0 GB disk1 1: DOS_FAT_32 NO NAME 8.0 GB disk1s1 |
It’s pretty clear from this output that /dev/disk1 is indeed my 8Gb Sandisk Cruzer USB drive.
The easiest way to prepare a USB for burning is to erase it. This can be done using Disk Utility (I knew it was useful for something) by selecting your USB drive (not any of its partitions) in the left hand pane, clicking the Partition tab, and creating a 1 Partition layout, with the Format Free Space. See screenshot opposite.
Once you have removed any partition data from the device, the diskutil listing will look something like this:
1 2 3 |
/dev/disk1 #: TYPE NAME SIZE IDENTIFIER 0: *8.0 GB disk1 |
The dd command is a simple animal, and only needs a few parameters:
- if is the path to the Input File
- of is the path to the Output File
- bs is the Block Size (how big a chunk of data is read and written at a time). There is no real advantage to choosing a blocksize bigger than 1 megabyte.
Lets suppose we want to burn an image called sophos_usb.iso to the USB drive. The command will be
1 2 3 4 5 |
$ sudo dd if=sophos_usb.iso of=/dev/rdisk1 bs=1m Password: [my password] 984+0 records in 984+0 records out 1031798784 bytes transferred in 87.990409 secs (11726264 bytes/sec) |
Note: We changed the device /dev/disk1 to /dev/rdisk1 – this is because in OSX each storage device has two references to it. disk[n] which is a block level, buffered device, and rdisk[n] which is the raw device – copying to the rdisk reference is about 20 times faster.
Entering the sudo command will require your admin password (due to the sudo – Super User do command). It will then take some time to copy your data and you won’t get any feedback from the terminal. As you can see, my 1Gb iso took about 90 seconds to copy.
That’s it – you should now be able to eject your USB drive and boot up the PC.
You can’t boot Macs from the majority of iso images as they don’t have the necessary EFI boot loaders – if you are trying to burn a linux iso, then take a look at Mac Linux USB Loader which we might look at another day 🙂
OMG I LOVE YOU! Thank you so much for this amazing, detailed explanation!
Thanks for your excellent article. It was the third I used to help build a bootable USB from an ISO, and it was definitely the more thorough, and explanatory.
Help me a lot.. Thanks!!
Big (big) frustrations with disk utility…
Been trying to put a Windows 8 iso on a partition of an external HD for days now and still nothing. I came to this site because of the annoying “Could not validate source – Invalid argument” error and still nothing.
I input the same exact command on terminal with the correct iso and partition location (I even tried to change .iso to .dmg) and after pressing enter…nothing…blank space no response…great, WTF do I do I’m obsessing!
The other error I keep getting sometimes while trying to use the restore function on Disk Utility is “could not validate source – error 254”
I thought something was going wrong as well when this happened to me… turns out I just had to wait as the Terminal is doing it’s thing. The bigger your .iso the longer you’ll have to wait!
This was incredibly helpful, I just wish I came upon this gem of an article before having to trudge through immense amounts of random irrelevant information thrown at me
Thanks again and god speed!
you made my day man…thx
Thanks for your in-depth article. It turns out to be the most helpful one regarding such error. I was following the above instructions and was quite successful except the bootable usb for a firmware update wasn’t detectable on my macbook pro (15″ 2011-mid, OS X Lion 10.7.5). Can you guess any reason and a possible solution to get it detectable for booting?
So awesome – great formatting and explanation.
Used it to burn a MintOS image to a USB key. Perfect and fast.
Resulting disk booted perfectly
Mahalo for your time and effort!
Nice tip!
Btw you will get error: resource is busy if you forget to umount the [mounted] USB. So just go to disk utility, choose the USB and unmount it, remember unmount – not eject.
*Slow clap*
Thanks A LOT for this! Been struggling the last couple of days to make a proper windows usb boot and its been driving me insane.
Another tip for someone who might have the same problem as I did: when I typed the name of the ISO. terminal couldn’t find the ISO file so instead i just dragged it directly into terminal instead of typing the name. Worked like a charm!
10/10
5/5
Two thumbs up! Thanks again!