Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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 tried to format my harddisk (160 GB) with the following command

dd   if=/dev/zero   of=/dev/sda

After some 3 hours, following error came up:

dd: writing to '/dev/sda' : No space left on device 
312581809+0 records in 
312581808+0 records out 
160041885696 bytes (160 GB) copied, 10708.3 s, 14.9 MB/s

Any idea what went wrong?

share|improve this question
up vote 1 down vote accepted

well, if you wanted to wipe a disk 'shred' is the proper command. You'd then want to create partitions with fdisk, and use some variety of mk__fs (mke2fs etc) or parted to make a file system in the partition.

share|improve this answer
    
i think mke2fs is usually just a symlink to mkfs.ext2 or similar. at least on my Debian system there isn't even a mke2fs command available; it's all mkfs.whatever ... but yes, if one is trying to "format a drive" meaning "prepare a filesystem", these are the needed steps. – quack quixote Apr 2 '10 at 14:32

/dev/zero is in principle infinite. /dev/sda is not.

share|improve this answer
2  
And that is why dd was not able to put more of it to the disk: mission accomplished, nothing went wrong. – akira Apr 2 '10 at 14:06
    
Thanks but is it then now a proper way of formatting a harddisk? – usajbalt Apr 2 '10 at 14:12
3  
@usman: well, i would not call "whiping out the disk with zeros" "formating". but it did what you wanted, right? – akira Apr 2 '10 at 14:16
    
Yes it did what I want but what do you suggest to 'format' a harddisk. – usajbalt Apr 14 '10 at 9:05

You must log in to answer this question.

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