Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dd command error writing No space left on device [closed]

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

like image 913
Malatesh Avatar asked Oct 27 '15 06:10

Malatesh


People also ask

What do you do when there is no space left on your device?

Fix 1: Restart Processes Using Deleted Files The most probable cause of the “No space left on device” error is a process still using a deleted file. Thankfully, fixing this error is easy. You just need to restart the process to free up the reserved storage.

What dd command does?

dd command reads one block of input and process it and writes it into an output file. You can specify the block size for input and output file. In the above dd command example, the parameter “bs” specifies the block size for the both the input and output file. So dd uses 2048bytes as a block size in the above command.

How do I fix Errno 28 no space left?

Your local folder does not have enough space available for the operation. In your environment, update the 'TEMP', 'TMPDIR' or 'TMP' environment variable to a location with additional free space. Validate the updated location: Windows - command-prompt 'set'


1 Answers

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(a).

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).


(a) It may slow down somewhat in the final stages, as it becomes harder to get useful work out of a universe that's losing all its energy gradients :-)

like image 149
paxdiablo Avatar answered Oct 24 '22 08:10

paxdiablo