Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

bplein

macrumors 6502a
Jul 21, 2007
538
197
Austin, TX USA
Quite a few misunderstandings about how dd works here. The examples given work, but the explanations have some mistakes in them.

dd does a raw copy, bit for bit, from the source to the destination. If the destination is the whole disk (i.e. /dev/disk6 for example) as opposed to a slice/partition (/dev/disk5s1 for example), then there is NO REASON to format it with FAT first. The dd to the whole disk copies the partition table and disk formatting from the source. So you can format with FAT first, but it won't help.

Second, using block sizes under 1m certainly will work. But it will take MUCH longer. dd doesn't just magically corrupt things because you used a smaller size, but a bad USB stick might not like small blocks like 512b. I use 128K as the performance gain above 128k is minimal. There are good reasons to use smaller blocks: If you use 1MB block size, and the source image doesn't end exactly on a 1MB boundary, dd will normally fail that last I/O as it cannot read the whole 1MB. Mac OS X may deal with this better, but my habits come from Linux where the last I/O will fail and the very tail end of your copy may be corrupt (but it may have no usable data so it may work for you anyhow)

Also note that it's faster to write to /dev/rdiskX vs /dev/diskx. The two names represent the same device but the former is raw (unbuffered) and will give better overall performance because you don't get the bursty flow of buffered I/O.
 

kimsharma

macrumors newbie
Nov 25, 2008
2
0
I struggled with it till

... till I found Carbon Copy Cloner!

Just clone the damn thing and it works!

Forget disk utility.. too much pain!
 

sean.carmen

macrumors newbie
Nov 23, 2011
2
0
god, finally two good solutions...

unetbootin works very well!! probably the easiest solution available at the moment..

here is another solution that worked perfect for me so far:

Download the desired file
Open the Terminal (in /Applications/Utilities/ or query Terminal in Spotlight)
Convert the .iso file to .img using the convert option of hdiutil (e.g., hdiutil convert -format UDRW -o ~/path/to/target.img ~/path/to/ubuntu.iso)
Note: OS X tends to put the .dmg ending on the output file automatically.
Run diskutil list to get the current list of devices
Insert your flash media
Run diskutil list again and determine the device node assigned to your flash media (e.g. /dev/disk2)
Run diskutil unmountDisk /dev/diskN (replace N with the disk number from the last command; in the previous example, N would be 2)
Execute sudo dd if=/path/to/downloaded.img of=/dev/rdiskN bs=1m (replace /path/to/downloaded.img with the path where the image file is located; for example, ./ubuntu.img or ./ubuntu.dmg).
Using /dev/rdisk instead of /dev/disk may be faster.
If you see the error dd: Invalid number '1m', you are using GNU dd. Use the same command but replace bs=1m with bs=1M.
If you see the error dd: /dev/diskN: Resource busy, make sure the disk is not in use. Start the 'Disk Utility.app' and unmount (don't eject) the drive.
Run diskutil eject /dev/diskN and remove your flash media when the command completes
Restart your Mac and press alt while the Mac is restarting to choose the USB-Stick

let me know how this works for you....
 

jhawk65

macrumors newbie
Dec 4, 2011
1
0
Well, I was dealing with this problem, but after a little digging I found a be-all end-all solution for creating Windows/Linux bootable Flash Drives on the mac.

Disk Utility, for whatever reason, is prohibited from writing Joliet (ISO 9660) onto MS-DOS FAT 32 Flash Drives, though it should definitely work.

The best way to accomplish your goal is the following:

Open Terminal

Type 'diskutil list'. You'll see your primary hard drive (probably listed under /dev/disk0) and your Flash Drive, which will be listed as /dev/disk#, with # being any number that isn't zero. REMEMBER THE DISK LOCATION

In the next line, type 'diskutil unmountDisk /dev/disk#'. You'll see this message on success:
Unmount of all volumes on disk# was successful

Now type, 'dd if=(DRAG ISO/DMG HERE) of=/dev/disk# bs=1m'

Do not forget bs=1m! The blocksize cannot be any different from this because of the nature of the MS-DOS FAT partition structure. Using smaller block sizes can potentially corrupt the newly created iso and will slow down the process tremendously.

Now give your computer some time (anywhere from 15 minutes to 2+ hours depending on file size) to finish this procedure.


If you're unsure about the dd command and how it functions, head over to http://en.wikipedia.org/wiki/Dd_(Unix)


An awesome program I saw makes use of the dd command and includes a progress bar! Very cool stuff! http://www.gingerbeardman.com/dd-gui/

With this program, you don't have the option to change the blocksize, but the addition of a progress bar makes it worth it.


I did that and I got this message afterwards:


David-Mitchells-Mac-Pro:~ davidmitchell$ diskutil list
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *200.0 GB disk0
1: Apple_HFS Untitled 1 200.0 GB disk0s1
/dev/disk1
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *2.0 GB disk1
1: Windows_NTFS 2.0 GB disk1s1
David-Mitchells-Mac-Pro:~ davidmitchell$ diskutil unmountDisk /dev/disk1
Unmount of all volumes on disk1 was successful
David-Mitchells-Mac-Pro:~ davidmitchell$ dd if=/Users/davidmitchell/Desktop/ubuntu-11.10-desktop-amd64.iso of=/dev/disk1 bs=1m
697+1 records in
697+1 records out
731164672 bytes transferred in 10520.430231 secs (69500 bytes/sec)
David-Mitchells-Mac-Pro:~ davidmitchell$


I was wondering if I did this correctly, and at the end of it a message box popped up and said that my media could not be read. My thought is because was in fat, but idk.
 

timtunbridge

macrumors newbie
Feb 18, 2012
3
0
Struggling

Am using a USB Stick to install Ubuntu Server 11 on a Linux machine, rather than using CD-ROM.
(Am using Mac OSX 10.6.7 to download my iso, configure USB stick, and then copy .iso to it)

This worked for me
- Insert 4GB USB Stick
- Open Disk Utility, Click ERASE. Format USB using MS-DOS (FAT)
- When Disk appears in Left hand column, right click and get Information (note down the "Disk Identifier : eg disk6")
- Then right click the Disk and select Unmount. (the drive still shows but the disk unmounts)
- Switching to the Terminal App
- Change to superuser / root, by issuing: sudo su - (then enter your password)
- Change directory to where ever your recently downloaded .iso image is stored, eg: Downloads
- My file iso is called ubuntu-11.04-server-amd64.iso, (approx 650mb) so use the following command:
Code:
dd if=ubuntu-11.04-server-amd64.iso of=/dev/disk6 bs=8192
- This will start copying the file to the USB stick.
- There is no "verbose" or screen "output" of what is happening. But after 15mins you should see something like:



The end result is a USB stick containing the installation media of Ubuntu Server (swap Ubuntu server for your media download of choice). Happy Days.

I must be missing something here. I can successfully perform all of the above steps and I end up with a USB with a single partition containing all of the linux files (Debian 6.0). However when I boot either my iMac 6,1 (late 2006) or Mac mini 5,1 (mid 2011 Intel graphics) holding down the alt/option key, this is not offered to me as a bootable drive.

Have I missed something? How does the Mac know it can boot from this drive? Must rEFIt be installed and can I have this on the USB too (I rather not install rEFit directly on my Macs just yet as I'm wary of messing thing up)?
 

timtunbridge

macrumors newbie
Feb 18, 2012
3
0
No longer struggling

An update to my earlier post ... I have found that after updating the firmware of my new Macmini (5,1) to MM51.0077.B0E (EFI 1.4) that I can now boot from a USB stick. Hold down the alt-option key on start up and a "Windows" drive is offered in addition to the Macintosh HDD and Recovery drives. Whilst this is labeled Windows it was actually a Linux Live distro.

Note, there is no need to install rEFIt to achieve the above. It is not required on the USB stick, nor on the Mac mini HD - you just don't need it - at least not on the new Macmini 5,1 with the latest firmware update. However this same stick will not boot an iMac 6,1 (even with the latest firmware update IM61.0093.B07 (EFI 1.2) where I suspect rEFit will be required, although I have not confirmed this.

For anyone interested, I found the Ubuntu Download an excellent way to get started on this http://www.ubuntu.com/download/ubuntu/download. I followed the "I would like to create a USB stick" and "I will be using a Mac" instructions. After successfully booting Ubuntu in this way I repeated the instructions with a Debian Live CD distro. Fundamentally this has worked but I am ironing out some Mac specific issues with Debian.

In case those instructions are taken down, they are repeated here. Essentially they are very similar to other instructions posted earlier in this thread:

Mac

We would encourage Mac users to download Ubuntu Desktop Edition by burning a CD for the time being. But if you would prefer to use a USB, please follow the instructions below.

Note: this procedure requires an .img file that you will be required to create from the .iso file you download.

TIP: Drag and Drop a file from Finder to Terminal to 'paste' the full path without typing and risking type errors.

Download the desired file
Open the Terminal (in /Applications/Utilities/ or query Terminal in Spotlight)
Convert the .iso file to .img using the convert option of hdiutil (e.g., hdiutil convert -format UDRW -o ~/path/to/target.img ~/path/to/ubuntu.iso)
Note: OS X tends to put the .dmg ending on the output file automatically.
Run diskutil list to get the current list of devices
Insert your flash media
Run diskutil list again and determine the device node assigned to your flash media (e.g. /dev/disk2)
Run diskutil unmountDisk /dev/diskN (replace N with the disk number from the last command; in the previous example, N would be 2)
Execute sudo dd if=/path/to/downloaded.img of=/dev/rdiskN bs=1m (replace /path/to/downloaded.img with the path where the image file is located; for example, ./ubuntu.img or ./ubuntu.dmg).
Using /dev/rdisk instead of /dev/disk may be faster.
If you see the error dd: Invalid number '1m', you are using GNU dd. Use the same command but replace bs=1m with bs=1M.
If you see the error dd: /dev/diskN: Resource busy, make sure the disk is not in use. Start the 'Disk Utility.app' and unmount (don't eject) the drive.
Run diskutil eject /dev/diskN and remove your flash media when the command completes
Restart your Mac and press alt while the Mac is restarting to choose the USB-Stick
 
Last edited:

Jibberish18

macrumors newbie
Jul 17, 2007
9
0
Quote:
Originally Posted by sootysam View Post
Am using a USB Stick to install Ubuntu Server 11 on a Linux machine, rather than using CD-ROM.
(Am using Mac OSX 10.6.7 to download my iso, configure USB stick, and then copy .iso to it)

This worked for me
- Insert 4GB USB Stick
- Open Disk Utility, Click ERASE. Format USB using MS-DOS (FAT)
- When Disk appears in Left hand column, right click and get Information (note down the "Disk Identifier : eg disk6")
- Then right click the Disk and select Unmount. (the drive still shows but the disk unmounts)
- Switching to the Terminal App
- Change to superuser / root, by issuing: sudo su - (then enter your password)
- Change directory to where ever your recently downloaded .iso image is stored, eg: Downloads
- My file iso is called ubuntu-11.04-server-amd64.iso, (approx 650mb) so use the following command:
Code:

dd if=ubuntu-11.04-server-amd64.iso of=/dev/disk6 bs=8192

- This will start copying the file to the USB stick.
- There is no "verbose" or screen "output" of what is happening. But after 15mins you should see something like:



The end result is a USB stick containing the installation media of Ubuntu Server (swap Ubuntu server for your media download of choice). Happy Days.
I must be missing something here. I can successfully perform all of the above steps and I end up with a USB with a single partition containing all of the linux files (Debian 6.0). However when I boot either my iMac 6,1 (late 2006) or Mac mini 5,1 (mid 2011 Intel graphics) holding down the alt/option key, this is not offered to me as a bootable drive.

Have I missed something? How does the Mac know it can boot from this drive? Must rEFIt be installed and can I have this on the USB too (I rather not install rEFit directly on my Macs just yet as I'm wary of messing thing up)?

This did not work for me either. Nothing has and I've been trying to do this for hours now. When I used the method above the Mac did not give me the option to boot anything and the worst part was I waited HOURS for it to finish. When I used a program in Windows called "ISOTOUSB" to make the boot drive, it boots great on a Windows laptop but not on my Mac. Really stinks. I don't know why I've always had trouble booting on this goddamn thing. And the worst part is no one online really knows why it doesn't want to boot.

Thank you for all the replies everyone. It was worth a shot.
 

squeeky

macrumors newbie
Jun 6, 2012
1
0
alternatively open a terminal:

%> df -h

locate the name of the usb device it will be something like /dev/disk1s1

%> diskutil umount /dev/disk1s1

using this example the usb drive is now /dev/rdisk1, the rdisk number will match the number used when it was mounted.

%> dd bs=1m if={path/iso image} of=/dev/rdisk1

wait a bit for it to finish..... it isn't very chatty and eject the disk.

%> diskutil eject /dev/rdisk1

usb drive will now be imaged with the iso.
 

cubosounds

macrumors newbie
Nov 23, 2012
1
0
I'm sorry, this is probably a noob question, but I have a linux LiveCD ISO I need to be bootable on a USB flash drive.

Can I do this with DiskUtil or through the terminal?

Thanks for any help you can provide...

Try use bootcamp, then click mount iso windows 7 to USB.... get your iso and get your flash and click next! people who have bootcamp should have know that! ;)
 

orange.x

macrumors member
Oct 15, 2009
84
0
Not working at all

Same problems here, tried almost all the above options. Terminal actions, CCC, unetbootin... Nothing will popup the usb stick (tried 2) as a bootable device.

Another thing that worries me is that when I'm going through the bootcamp assistant it will reboot and then doesn't react with the keyboard. For once I had the "can't find a boot device, press a key to try again" nothing seems to work, my Macbook Pro doesn't react to that. When I inserted a DVD with a Windows 7 install into the superdrive It gave me 2 options, and I wasn't able to type or what so ever. Not even with an USB keyboard.

I'll try to burn a official iso tonight at my mom's iMac and i'll see if it gets in the install gui of windows 7. But it's becoming a pain in the ass! Maybe my Macbook Pro is getting to old? It's a MacBookPro3,1. But in the early days it ran Bootcamp under Tiger / Snow Leopard just fine with Windows XP. And now this...
 

bplein

macrumors 6502a
Jul 21, 2007
538
197
Austin, TX USA
My understanding is that Mac's EFI will NOT boot from USB sticks that are non-Mac OS. In other words, you can boot from USB-based CD or DVD, and from Mac OS X bootable USB keys, but not Linux, DOS or Windows USB keys.
 

jey27di

macrumors newbie
Feb 27, 2013
1
0
Wwwoow

Am using a USB Stick to install Ubuntu Server 11 on a Linux machine, rather than using CD-ROM.
(Am using Mac OSX 10.6.7 to download my iso, configure USB stick, and then copy .iso to it)

This worked for me
- Insert 4GB USB Stick
- Open Disk Utility, Click ERASE. Format USB using MS-DOS (FAT)
- When Disk appears in Left hand column, right click and get Information (note down the "Disk Identifier : eg disk6")
- Then right click the Disk and select Unmount. (the drive still shows but the disk unmounts)
- Switching to the Terminal App
- Change to superuser / root, by issuing: sudo su - (then enter your password)
- Change directory to where ever your recently downloaded .iso image is stored, eg: Downloads
- My file iso is called ubuntu-11.04-server-amd64.iso, (approx 650mb) so use the following command:
Code:
dd if=ubuntu-11.04-server-amd64.iso of=/dev/disk6 bs=8192
- This will start copying the file to the USB stick.
- There is no "verbose" or screen "output" of what is happening. But after 15mins you should see something like:



The end result is a USB stick containing the installation media of Ubuntu Server (swap Ubuntu server for your media download of choice). Happy Days.


Thanks very much! your method completely worked.... although mine was windows. hehehe. but still it worked. im just waiting for the copying to finish then im on my way....


THANKS VERY MUCH!
 

mmond

macrumors newbie
Nov 13, 2010
4
0
Simple Disk Utility Process Worked

Like a lot previous posters, I struggled getting a USB drive bootable. It sounds like the dd command line process and recent 3rd party options are working for some.

I just wanted a native, GUI, straightforward method. I found this and it worked: http://www.techrepublic.com/blog/mac/how-to-create-a-bootable-usb-to-install-os-x/2699

It's just a couple, basic, well-documented steps to use Disk Utility to create a bootable, installable OSX USB drive. I burned Lion to it and booted a mid 2007 Macbook to install the new OS. (....after I upgrade it to 2GB which the installer then reminded me it requires. =)

Hope this helps,
Mark
 

andy-ch

macrumors member
Mar 30, 2007
46
0
Beeze Shehu Makom Baolam
It's working pretty good here:
Code:
andych-macpro:~ andych$ dd if=/Volumes/Master/Windows\ 7/DVD_ROM.iso of=/dev/disk2 
7295552+0 records in
7295552+0 records out
3735322624 bytes transferred in 2794.886347 secs (1336485 bytes/sec)
andych-macpro:~ andych$
Code:
andych-macpro:~ andych$ diskutil list
/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *128.0 GB   disk0
   1:                        EFI                         209.7 MB   disk0s1
   2:                  Apple_HFS Macintosh HD            127.7 GB   disk0s2
/dev/disk1
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *2.0 TB     disk1
   1:                        EFI                         209.7 MB   disk1s1
   2:                  Apple_HFS andych-hd1              500.0 GB   disk1s2
   3:                  Apple_HFS andych-hd2              1.5 TB     disk1s3
/dev/disk2
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:                           DVD_ROM                 *7.6 GB     disk2
andych-macpro:~ andych$
 

AdsoFromOVR

macrumors newbie
May 18, 2010
2
0
You can get dd run faster using using rdisk instance instead :

Something like :
# dd if=image.iso of=/dev/rdisk2 bs=1048576
 

hallgeorge

Cancelled
Apr 2, 2016
1
0
I finally managed to burn an ISO of Windows 7 to a USB on my Mac!
OK, I checked it ha to be MS-DOS (FAT) and formatted the drive in Disk Utility.
Then, I mounted the ISO and just copied+pasted all the stuff from the ISO to my USB.
Haven't tried booting yet - wish me luck!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.