windows equivalent for dd

246,403

Solution 1

Rufus works as expected. Choose 'DD Image' for 'Create bootable disk using'.

The source is published on GitHub: https://github.com/pbatard/rufus.

balenaEtcher is another Windows compatible tool for writing writing images to USB drives. It's also fast, and is easier to use than Rufus.

My experience: Win32DiskImager did not detect u-SD through a USB-3 reader; dd for Windows, MinGW compiled dd, Unix Utils dd, and Linux dd VIA VirtualBox VM USB3 pass-through were all unacceptably slow; I have yet to find a Windows command line equivalent that can beat the 50MB/s write speeds I'm seeing with Rufus.

Solution 2

Just use dd for WIndows ... it works perfectly even though it is quite an old project.

Solution 3

Try Win32DiskImager , it can write images to disks.

Solution 4

surprised nobody mentioned GNU core utils for Windows, I've been using them for years. they're 32-bit binaries but apparently, except for less, they still work under Windows 7 64-bits.

example usage:

C:\Windows\Temp>dd if="\\.\s:" of=sdrive.dat bs=4096
25599+0 records in
25599+0 records out
104853504 bytes (105 MB) copied, 30.3147 seconds, -56145186608800624000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000000000000000 MB/s

C:\Windows\Temp>dd if="\\.\physicaldrive0" of=mbr.dat bs=512 count=1
1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.0210012 seconds, -891479495977528 kB/s

the reported times are a bit odd but otherwise it seems to work well.

Solution 5

First I also tried Win32DiskImager, which I thought is doing only partition copy based on its display (no, it can backup an entire SD card), so I continued searching.

My current favourite is HDDRawCopy. It copies to/from file an entire disk image, but not partitions separately. It creates dd compatible or compressed images on the fly - not as efficient as 7zip (does not reach ZIP performance even) but you don't need to touch the image again.

Share:
246,403
Jarmund
Author by

Jarmund

Ask and I'll answer.

Updated on September 18, 2022

Comments

  • Jarmund
    Jarmund almost 2 years

    I need to read and write various flash card images. The way i always did this in linux was with dd, and that did the trick. What is a good windows equivalent?

    Simply put, i need to be able to read an entire card into a file and vice versa. I tried WinDD, but that seems to operate on partitions rather than entire devices, but i need to be able to dump the entire disk/card and its partition table regardless of its content.

    Using Windows 7 64bit, with the card reader on a USB3 port.

  • Jarmund
    Jarmund over 9 years
    This is the one i ended up with, as windows command line is a pain. Any idea if it takes a raw copy, thus allowing me to read and image with dd and then write that image with Win32DiskImager? (and vice versa)
  • TravisWhidden
    TravisWhidden over 8 years
    Seems to have an issue under windows 10. Anyone having issues with .6 beta 3?
  • Florian Fida
    Florian Fida over 8 years
    Great, even works on Windows 10 64bit!
  • Scott Stevens
    Scott Stevens about 8 years
    @TravisWhidden what kind of issues? I've experienced some "unable to write" errors, but unsure if that's the same problem.
  • Anthony Lozano
    Anthony Lozano over 7 years
    Scott, do you have a link where I can get it from that is not source forge? Google isn't helping much today.
  • Logern
    Logern over 7 years
    @AnthonyLozano I downloaded win32diskimager from sourceforge, it doesn't have any malware and it's widely used and even recommended for things like the Raspberry Pi to write disk images to. There is a fork on github but you have to compile it yourself github.com/bizplay/win32-disk-imager
  • Aaron
    Aaron over 7 years
    It doesn't work for me on my Win7 machine
  • Luc
    Luc about 7 years
    Just for the record, I think it would be many times faster to do more than one byte at a time. And there is no error condition, the script relies on non-null bytes occurring early on and you catching that it printed "done" early on.
  • Mike Loux
    Mike Loux about 7 years
    I have started using Chocolatey for all of my utilities. Think apt-get for Windows using NuGet's framework. There is a win32diskimager package on there that installs with no issues. Portable one, as well. chocolatey.org
  • Doug Wilson
    Doug Wilson almost 7 years
    My vote for Rufus as well. None of the other proposed answers worked for me on Windows 10 Pro v1703. Okay... lets be honest... I didn't try the Python solution.
  • Andrew Keeton
    Andrew Keeton almost 7 years
    I had some confusion because the disk I wanted to clone had multiple volumes on it with different drive letters. I discovered that the first drive letter, which also was the boot partition, represented the entire disk.
  • HackSlash
    HackSlash over 6 years
    HDD Raw Copy was able to detect a blank SCSI drive that "dd for windows" could not. It allowed me to duplicate an HFS disk from Windows! Thanks!
  • HackSlash
    HackSlash over 6 years
    How do you know what drive to target?
  • Rolf
    Rolf over 6 years
    It is really good for preloading images on USB sticks, but it does not do half of what dd can do, so it's not really "equivalent"
  • Xerz
    Xerz about 6 years
    This doesn't work for devices without partition letters assigned to them, thus it's useless for devices with unrecognized partitions or no partitions at all. Not an equivalent to dd.
  • Xerz
    Xerz about 6 years
    This is not valid as it only allows to write images on disks, not to read those disks.
  • ZEE
    ZEE about 6 years
    you can even use cygwin from the DOS command prompt... (i use all the time for cat/grep/tail/... ) and even in the DOS/Windows console "ls -la /proc" works fine... one of my favorits...
  • Gizmo
    Gizmo almost 6 years
    Note that for some reason HDD RAW COPY has a limit of 50MB/s
  • AntoineL
    AntoineL almost 6 years
    Does it copy correctly content over 4 gibibytes? Last time I checked (long ago) it was compiled against Microsoft's runtime where off_t is a long, hence offsets are limited to 31 or 32 bits... which is a big deception when using dd.
  • jcomeau_ictx
    jcomeau_ictx almost 6 years
    I never tried, sorry.
  • user230910
    user230910 over 5 years
    It doesnt make a dd compatible image file, in fact it tries to understand the disk layout and produces a zip file with each partition it recognises in a separate file. And in my case it had issues restoring the files back to partitions again
  • user230910
    user230910 over 5 years
    This seems to work, but it seems slooooow ...
  • fuzzyTew
    fuzzyTew over 5 years
    Rufus produced a disk with different checksum from the image, for me.
  • Gareth Davidson
    Gareth Davidson over 5 years
    It's rare to see a useful application today that is only 1mb in size. What a great tool!
  • Gareth Davidson
    Gareth Davidson over 5 years
    Python is the wrong tool a tight loop like that. You'd be better off creating a 256k buffer of all zeroes and comparing it to 256k pulled from the disk in one go. Plus having some exception handling.
  • ssh
    ssh almost 5 years
  • yahol
    yahol almost 5 years
    Doesn't work: The /image-file option is not recognized in this context.. Should be /imagefile
  • Jesbus
    Jesbus almost 5 years
    Thank you, worked great for me.
  • mwfearnley
    mwfearnley over 4 years
    Git for Windows comes (at time of writing) with dd version 8.30, compiled in 2018. It seems to work fine with /dev/sdX names, at least from Git Bash running as Administrator. It probably lost any 32-bit limitations some time ago.
  • Jamesits
    Jamesits over 4 years
    If you ever need to write to an internal HDD or something using Rufus, press Ctrl+Alt+F to show them.
  • CenterOrbit
    CenterOrbit about 4 years
    @MikeLoux Chocolatey installs win32diskimager from SF: Downloading win32diskimager.install from 'https://sourceforge.net/projects/win32diskimager/files/Arch‌​ive/win32diskimager-‌​1.0.0-install.exe'
  • Mike Loux
    Mike Loux almost 4 years
    Oopsy. Well, there you go. And at some point, I did switch over to using Rufus, and it's been fantastic.
  • barlop
    barlop over 3 years
    cygwin has ddrescue too
  • maf-soft
    maf-soft over 3 years
    I went this way to WRITE an image file to a SD-Card and it seemed to work. But if the card already had a drive letter before, it seems windows doesn't notice the modified data and you get corrupted data as soon as you try to write on that disk. Any solution for that? How to do the flashing with un- and remount correctly?
  • maf-soft
    maf-soft over 3 years
    It seems that this command uses special image files and not just a raw copy of the data.
  • jcomeau_ictx
    jcomeau_ictx over 3 years
    maf-soft, you need to ask the community. I haven't used Windows for years now.
  • gronostaj
    gronostaj over 3 years
    -1 because DISM is by no means a dd alternative. dd is just copying bytes from source to target without processing them. DISM is archiving a NTFS filesystem to a proprietary format.
  • gronostaj
    gronostaj over 3 years
    This link was already posted by Eugen Rieck 6 years ago and is one of the highest upvoted answers. If you want to improve on their answer, use the Edit button.
  • user643011
    user643011 over 3 years
    To create an image it wants me to select a filesystem drive letter as a source instead of a whole device name. That's a major red flag!
  • Destroyica
    Destroyica over 2 years
    HDD Raw Copy helped me to create an image of an USB stick with "cyclic redundancy check" errors. Allowing me to recover a lot of data despite the total loss of the USB key.
  • Admin
    Admin about 2 years
    -56145186608800624000000000000 000000000000000000000000000000000000000000000000000000000000‌​00000000000000000000 000000000000000000000000000000000 MB/s? Interger overflow?
  • Admin
    Admin about 2 years
    I didn't look at the source code, but yeah, that's a possibility.