5

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
7
  • Which ones did you try?
    – slhck
    Oct 23, 2011 at 20:13
  • dd, unetbootin. I haven't (and don't want to) try daemon tools, nero, acronis, etc - they spams into system a lot and I'll have to to cleanup it after.
    – Eir Nym
    Oct 23, 2011 at 20:58
  • what kind og image? .img or .iso?
    – Journeyman Geek
    Oct 23, 2011 at 22:50
  • I have both, but prefer to able to write any .img
    – Eir Nym
    Oct 23, 2011 at 22:50
  • Have you read how to place bootable iso on a flash drive? If so, please edit your question to explain what didn't work from that post, and I'll reopen your question. Otherwise, it's a duplicate.
    – nhinkle
    Oct 23, 2011 at 23:40

5 Answers 5

4

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.

5
  • The dd of=/dev/sdc command immediately gave dd: writing to '/dev/sdc': No such file or directory. Jul 30, 2015 at 14:35
  • 2
    Fixed the problem by unassigning the drive letter. Apparently, Windows doesn't talk nice to those trying to overwrite sectors underneath a mounted filesystem! Jul 31, 2015 at 1:53
  • You can also run the Cygwin terminal with Administration privileges (e.g. Run as administrator)
    – Greg
    Aug 9, 2015 at 21:38
  • R u kidding me? I have to run as administrator, or I won't have direct access to disk! Aug 9, 2015 at 22:29
  • 1
    Well, it's no different than Linux, isn't it? See the previous comment. You need admin rights if you don't want to bother with anassigning the drive letter. It's a Windows limitation, not Cygwin, hence Windows admin rights required.
    – Greg
    Aug 15, 2015 at 18:44
2

dd, what else.

dd if=foo.img of=\\.\F:

There's also flashnul:

flashnul F: -L foo.img
8
  • it is outdated. It doesn't work in Windows 7 x64. Last update was at 2005-01-27 20:32-0800
    – Eir Nym
    Oct 23, 2011 at 20:14
  • Please explain "doesn't work". It does not use any features that could have been removed or changed. It does, however, need elevation ("Run as Administrator"). Oct 23, 2011 at 20:18
  • I've runned cmd under administrator, surely. This utilities don't want to write any data. I've do all as listed with no success. I've seen many good utilities which works fine in Windows XP and don't in Windows 7. Disk subsystem is one of part of incompatibility between W7 x64 and WXP x32.
    – Eir Nym
    Oct 23, 2011 at 20:21
  • Also I need to write everything include MBR
    – Eir Nym
    Oct 23, 2011 at 20:24
  • For example, I need write working FreeBSD release. Linux can be written with sourceforge.net/projects/unetbootin but BSD not.
    – Eir Nym
    Oct 23, 2011 at 20:31
2

Try WINDOWS 7 USB/DVD DOWNLOAD TOOL As Eir Nym stated, this installs microsoft's bootloader, which you can user for any windows iso (I've used it to install windows 8) For general purpose loader use unetbootin

4
  • it is one of tools you can use to install Windows 7. But I need low-level disk access such as dd(1). For example of image file you can use file filled with zero or random bytes to remove any data you have on USB.
    – Eir Nym
    Oct 23, 2011 at 20:54
  • +1 for digging up that link. Microsoft kept it hidden for a while.
    – AndrejaKo
    Oct 23, 2011 at 21:35
  • @Eir Nym Did you try the utility? It's supposed to be able to copy correctly image to a flash drive including any special quirks.
    – AndrejaKo
    Oct 23, 2011 at 21:36
  • Only with NT boot loader. I need BSD boot loader.
    – Eir Nym
    Oct 23, 2011 at 21:37
2

It hasn't been updated in a while, but usb-imagewriter does just what you need and definitely works with .img files and nearly any OS image I've tried (indeed, many alternative OSes recommend it).

0

Cool. What an easy question.

Here is the solution: http://unetbootin.sourceforge.net/

And it works. Believe me.

5
  • I hate Unetbootin because not every "bootable" flash drive I'll get, will boot.
    – Eir Nym
    Oct 23, 2011 at 22:43
  • @EirNym This depends on the machine your are trying to boot from. And not on machine you are building the flash drive.
    – mailq
    Oct 23, 2011 at 22:46
  • Are you sure? On which things does it depends? I've tried these images with very different netbooks, laptops and PCs. from different manufactures.
    – Eir Nym
    Oct 23, 2011 at 22:54
  • ah, Linux will boot almost always, BSD not.
    – Eir Nym
    Oct 23, 2011 at 22:55
  • BIOS implementation, version, manufacturer; flash drive size, manufacturer; machine age, manufacturer
    – mailq
    Oct 23, 2011 at 22:58

You must log in to answer this question.

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