Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

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

Your Answer

 
discard

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.