I am new to storage, trying to erase the data in the device '/dev/sdcd' why should I get 'No space left error'

[root@ dev]# dd if=/dev/zero of=/dev/sdcd bs=4k
dd: error writing ‘/dev/sdcd’: No space left on device
1310721+0 records in
1310720+0 records out
5368709120 bytes (5.4 GB) copied, 19.7749 s, 271 MB/s
[root@ dev]# ls -l /dev/null
crw-rw-rw-. 1 root root 1, 3 Oct 27 01:35 /dev/null

if this is very basic question, I am sorry about that

share|improve this question

closed as off-topic by paxdiablo, Pang, Tsyvarev, Yu Hao, CRABOLO Nov 6 '15 at 23:44

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about general computing hardware and software are off-topic for Stack Overflow unless they directly involve tools used primarily for programming. You may be able to get help on Super User." – paxdiablo, Pang, Tsyvarev, Yu Hao, CRABOLO
If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 9 down vote accepted

The /dev/zero device will continue to provide zeros for as long as you read from it, all the way to the heat death of the universe should your hardware last that long.

With your command, you have no limiting clause like count= so it will continue to read from /dev/zero and write to /dev/sdcd until the latter runs out of space.

It will still be writing to the device so you can safely ignore the error at the end (although it may be a good idea to ensure the disk is actually an integral multiple of the block size to avoid the possibility of leaving sensitive information at the end).

share|improve this answer
    
This is nice explanation! – malatesh Oct 27 '15 at 6:22
    
still dont get it though. I am willing to wipe the entir epartition, in fact it was like that before i ran fdisk to thrown a dos mbr on there, and still, i cant copy /sda1 to the non existent /sdb1, says out of space, after 2 seconds. What do i need to do to PREPARE SDB for copying partition 1? if=/dev/sda1 of=/dev/sdb1 bs=4k conv=noerror,sync – blamb Jan 9 '17 at 2:11

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