Windows – How to write precompilled image to USB flash drive from Windows

usbwindows 7

I have FreeBSD installation image for an USB memory stick, Windows 7 x64 desktop and server hardware nearby. And no CD drive at all for years.

Under Windows XP x86 you can use many solutions such as dd(Cygwin), dd(native), flashnul and many others (see links below). But they are not work under Windows 7 x64 with administrative rights. See official info from MS for information about this

Possible solutions:

  1. In BSD/Solaris/Mac OS X/Linux this is dd(1). I have no BSD/Linux/etc
  2. UNetBootin. MemStick with Linux works but doesn't with FreeBSD. I have no success with it from Windows XP too.
  3. Use Acronis/Daemon Tools/Nero/UltraISO and etc. – it may be works but they are
    1. I have to buy most of them
    2. They leave to much garbage, so I prefer better solution.
  4. Install Linux — it's not good practice to do double work.
  5. Buy CD Drive — only for one installation?
  6. Boot from PXE/TFTP — There's lack of NFS server from which I can mount root.
  7. Buy Windows 2008 which has NFS server and can be used to mount root in FreeBSD Boot process — only for one installation?
  8. Install virtual machine such as VirtualBox, install FreeBSD here and write image to flash drive. VirtualBox have very bad USB support.
  9. Buy virtual machine which works good with USB and you able to write image to flash drive under this — only for one installation?
  10. Write my own program.

So, which software can I use to do this task?

PS: If you use Linux, want to write flash image under Windows XP x86 (I don't know why this software is broken, may be because x64 platform)

Please, look here, this is not question I ask: How do I place a bootable ISO on an USB drive?

Edit:
With latest Cygwin version which are "compatible with Window Vista/7" I always get following with unmounted drive (my system drive is PhysicalDrive2):

C:\Windows\system32>dd if=//./PhysicalDrive0 of=C:/mbr count=1
1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.003 seconds, 171 kB/s

C:\Windows\system32>dd if=c:/mbr of=//./PhysicalDrive0 count=1
dd: opening `//./PhysicalDrive0': Invalid argument

Best Answer

In Cygwin version 6 and above the dd command to write an ISO has changed:

dd if=path-to-file.iso of=/dev/sdx

where sdx is one of the drives:

cat /proc/partitions

For example, to write a FreeBSD img file onto a USB memory stick:

$ cat /proc/partitions
major minor  #blocks  name

    8     0  78150744 sda
    8     1    102400 sda1
    8     2  51096576 sda2
    (...)
    8    48 976762584 sdd
    8    49 295185408 sdd1
    8    50 681573376 sdd2
    8    64   8093696 sde
    8    65   8093680 sde1

$ dd if=/cygdrive/l/FreeBSD-9.1-RELEASE-amd64-memstick.img of=/dev/sde bs=10240 conv=sync

Also see https://wiki.archlinux.org/index.php/USB_Installation_Media for alternative methods.

Related Question