7

While testing a problem LUN for read errors, I encountered the following problem:

find /mnt/problem_lun/ -type f -print -exec dd if={} of=/dev/null bs=8k \;
...
/mnt/problem_lun/a_file
dd: writing `/dev/null': File too large
33619977+0 records in
33619976+0 records out
275414843392 bytes (275 GB) copied, 804.171 s, 342 MB/s

IBM hardware, RHEL 6.6

Who's the culprit, provided this particular file could be read without any errors?

Zogratz
  • 79
  • 1
  • 4
    Welcome to Server Fault. Please edit your question to include the results of `ls -l /dev/null` (see http://unix.stackexchange.com/questions/45421/dd-writing-dev-null-no-space-left-on-device ) – Anthony Geoghegan Sep 29 '15 at 11:32
  • 3
    [What to Do with a Full Bit Bucket](http://docstore.mik.ua/orelly/unix/upt/ch13_15.htm) – Raedwald Sep 30 '15 at 12:48

1 Answers1

13

It looks like your /dev/null may have been deleted at some point so when you started writing to it you are writing to a plain file rather then the character special null device.

You an confirm this by looking at the output of ls

$ ls -l /dev/null
crw-rw-rw-. 1 root root 1, 3 Sep 28 08:11 /dev/null

If I'm right then you won't see a character special device. You can repair this by first deleting the file you created and then running

MAKEDEV std 

which should work on EL6 or

mknod -m 666 /dev/null c 1 3
user9517
  • 114,104
  • 20
  • 206
  • 289