Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to use the windows version of dd to copy a RHEL iso to a USB stick. However, I wanted to zero out the drive first to ensure there is no filesystem on it before writing it out. Is there an equivalent of /dev/zero in windows that I can use as the infile?

share|improve this question
up vote 9 down vote accepted

John Newbigin's dd supports this.

Virtual devices are a new feature in version 0.4beta1.

Because windows does not have devices like the unix /dev/zero or /dev/random these have been implemented inside dd. You can use these as input files to supply an infinite amount of zeros or pseudo random data.

share|improve this answer
Worked like a charm, it's zeroing out now! Thank you for the heads up!!! – Matthew Oct 14 '11 at 14:04

There are also some actual device drivers for /dev/zero as well as /dev/random under Win32.

share|improve this answer

What you are trying to do is absolutely pointless, regardless of medium (why zero out whatever, when I'm gonna overwrite it in a second ?). Zeroing before write just adds a slight check that two writes succeeded (and it steals some of your precious time).

And it is (if possible) even more pointless in context of solid-state / flash drives. Most of them will, on write, choose one of the free, least used blocks (they actually have more capacity then advertised, just as HDDs have space reserved for remapping of bad blocks), write the content to the new block, remember that this block now stores content of "offset xyz" and release the old block to the "free pool".

Even when they are sent a "trim" request (mark the block as free and zero it out), a lot of flash drives take the approach "yeah, I'll do it some time in the future, when I'll feel like it".

Some will actually do nothing (not even keep a note they were ordered to zero out some area) when you unplug them "soon enough" after requesting a/some trim(s) - and "soon enough" here means "[even tens of] seconds after the request".

So just overwrite (regardless of the drive type), no zeroing necessary or (from now on it's about flash drives) even easily possible. When you require a safe wipe, look whether the drive manufacturer provides some utility to do this, that would take care to really zero out all of the areas of the drive ...

share|improve this answer
While correct, this doesn't answer the question. There might be other, more useful reasons to have /dev/zero. – Sven Aug 6 '15 at 12:26
@swen Well, the question in whole is wrong/pointless. I felt it was necessary to point it out in so no-one else would repeat the same pointless dance. Of course, it brought up interesting answers, so I didn't mark the question as pointles, only the reason for the question ... – Miloslav Raus Aug 6 '15 at 13:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.