16

Okay I'm trying to create a BOOTABLE Windows7 image on a USB key from a Mac running Lion. My image is .iso format. I tried:

sudo dd if=/Users/myusername/Win7.iso of=/dev/disk1 bs=1m

And this succeeded in writing the files, except in DISK UTILITY on the mac, it shows the partition type as GUID Partition Table and not 'Master Boor Record'. Booting the key on my Vista computer yields the error "No boot sector on USB Device'

From what I can tell, bs=1m in the DD command should have left 1 Megabyte for the boot sector, but for some reason this area of the USB Key is not set up correctly so that it will boot

How can I fix this, or correctly use dd to write a bootable cd image such that it is now a bootable usb drive?

Note: in the instructions I read about, they recommended renaming my Win7.iso to Win7.dmg before using DD, which made absolutely no sense to me, so I didn't do it. I could try with that step now, but it takes 1.99 hours to write the image to the USB drive so there is a huge penalty to trial and error here. Thank you.

6
  • Have you verified that the .iso file has a valid boot sector? If you ripped it directly from a bootable CD, something may have gone wrong as CD's have 2048-byte sectors and most flash drives have 512-byte sectors.
    – LawrenceC
    Jun 9, 2012 at 15:51
  • FYI. DD is a utility to covert and copy a file. It doesn't know anything about partition tables or boot sectors. bs=1m means read and write up to 1 megabyte at a time. If you wanted to leave space at the front of the drive you'd use seek=BLOCKS. Where blocks = sector size which defaults to 512.
    – hookenz
    Jan 9, 2013 at 21:39
  • @MattH You wrote "FYI. DD is a utility to covert and copy a file." <--- That is so totally wrong and you know it. And as for what it knows, you say "It doesn't know anything about partition tables " Well sure it doesn't but it can still affect them. It's about copying the raw bytes from the partition or whole hard drive, not the file, and you know it. And what gets copied can include files and (while i;m no expert), I suppose it would include a partition table.
    – barlop
    Mar 18, 2018 at 0:02
  • dd doesn't sound like the right tool to convert a cd iso to an image for usb. There are many ways to put a win7 iso to USB, and I don't think dd is one of them! At least not one anybody would normally use! dd/ddrescue is good if you have two identical hard drives and want to copy one to another. or if a hard drive had some errors and you want to make an image of it when other imaging software fails to.
    – barlop
    Mar 18, 2018 at 0:06
  • @barlop - dd man page - " Copy a file, converting and formatting according to the operands."
    – hookenz
    Mar 18, 2018 at 20:30

5 Answers 5

7

Use Disk Utility Options to set the partition type to Master Boot Record before you do dd.

enter image description here enter image description here

1
  • 4
    This failed. I was aware of the settings depicted in your screenshots but after doing this first, then DD, the resulting image was still not finding a boot sector. The DD command appears to trash whatever the disk util does anyway, it seems like it is writing in some very low level raw mode. I wish this worked but honestly it didn't, and its stupid that disk util doesn't support .iso images for restore. Dec 16, 2011 at 11:16
6

I had a similar problem when trying to create a bootable USB disk from OSX. The issue was that UnetBootin doesn't set up the Master Boot Record correctly on the USB disk. You have to do this manually with Disk Util and fdisk.

  1. Format the disk in Disk Utility, with the correct MBR

    1. Open Disk Utilty
    2. Select the USB device
    3. Click Partition
    4. Select 1 partition in the partition layout
    5. Select “Master Boot Record” in the options
    6. Select MS-DOS (FAT) in the format type.
    7. Click Apply, then Partition
    8. Close Disk Utility
      This will wipe the USB disk and set it up with the correct boot record
  2. Install the MBR binary from the SysLinux project

    1. Use the command line diskutil to find the device name for your USB drive.
      diskutil list
    2. Unmount the USB drive with the command line. NB: Be sure to swap the device reference (in my case it is /dev/SOMEdisk2) with the correct one for your usb key that you identified in the previous step – this will change for each machine.
      diskutil unmountDisk /dev/SOMEdisk2
    3. Mark the partition active, then unmount it again
      sudo fdisk -e /dev/SOMEdisk2
      print
      f 1
      write
      print
      exit
      diskutil unmountDisk /dev/SOMEdisk2
    4. Download Syslinux and extract the mbr.bin file
    5. Install the MBR
      sudo dd conv=notrunc bs=440 count=1 if=mbr.bin of=/dev/SOMEdisk2
      NB: see my full instructions if you need further help with steps 4 & 5.
  3. Use UnetBootin to install your OS install files

    1. Download and install UnetBootin if you haven’t already
    2. Load the application, choose your preferred distribution, and then click OK
    3. When it’s finished, eject the USB key and use it

Full instructions

7
  • Hello Paul, if you just post a link please be so kind and add some more content. I added your step-by-step instructions if you don't mind. Else you can revert the edit
    – nixda
    Jan 9, 2013 at 20:56
  • No problem, I can see that it makes it quicker/easier to get to the answer so I will do so next time - thanks for doing it for me :) Jan 10, 2013 at 15:58
  • There are 3 mbr.bin in syslinux zip, which one should I use? Mar 7, 2014 at 12:56
  • Just use the standard one syslinux-5.00/mbr/mbr.bin Mar 10, 2014 at 10:36
  • It didn't work for me. Still, I got "Non system disk" message.
    – waste
    Dec 29, 2016 at 11:00
2

Format a USB key with a Master Boot Record (MBR)

  • in Terminal: diskutil list

  • note the name of your USB key (mine was /dev/disk1)

  • in Terminal: diskutil eraseDisk MS-DOS "WINDOWS10" MBR /dev/disk1

  • replace /dev/disk1 with the name of your USB key

Mount a Windows 10 disk image

  • in Disk Utility: select File › Open Disk Image › select your .iso

  • in the left pane: click on the newly mounted image

  • in the right pane: select the name and copy it: something like CCSA_X64FRE_FR-FR_DV5

Copy the disk image to the WINDOWS10 USB key

  • in Terminal: cd /Volumes

  • in Terminal: cp -R CCSA_X64FRE_FR-FR_DV5/ WINDOWS10

  • replace the image name in the example with the name of your disk image

  • the slash at the end (after DV5 in the example) is important

  • it took more than 90 minutes to copy to a USB 2.0 usb key with, no progress indicator

1
  • The intro is a great command line answer to properly format a USB Key. I have been searching for a few hours. Thanks Andrew! Nov 6, 2021 at 4:02
0

This method doesn't use dd nor have I tested it.

You should be able to use UNetBootIn to transfer the filesystem in the ISO to a USB drive. UNetBootIn is an open-source, cross-platform utility for transfering bootable CD/DVD images to USB drives.

Run UNetBootIn (runs on Windows, Mac OS X and Linux) and select the Disk Image radio button. Then choose ISO from the dropdown menu (ISO is the default) and put the path to the ISO file into the path field. From there select the desired USB drive to transfer it to and click OK.

enter image description here

2
  • 2
    I tested it, it seemed to work, the boot sector is found, but it warns of 'missing operating system'. I am not sure if that is a problem with the image I used, but I doubt it. Going to play with this a little more though since it did appear to write the boot sector properly. Dec 16, 2011 at 11:20
  • @LanaMiller I am getting the same error, while trying to boot with a usb stick with Windows 7 Professional x64, did you manage to solve it?
    – Chris-Top
    Oct 20, 2012 at 14:48
0

Just found an answer here

# fdisk /dev/sdY

create single partition type 7+bootable partition

# mkfs.ntfs -f /dev/sdY1
# ms-sys -7 /dev/sdY

# mount -o loop win7.iso /mnt/iso
# mount /dev/sdY1 /mnt/usb
# cp -r /mnt/iso/* /mnt/usb/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .