PiNoY Posted June 3, 2012 Posted June 3, 2012 Wikipedia: The Linux null device is a special file that discards all data written to it (but reports that the write operation succeeded). It also provides no data to any process that reads from it (it returns EOF). In Unix programmer jargon, it may also be called the bit bucket or black hole. So, if your linux /dev/null has been missing or deleted somehow, here's how to re-create the special file. Although, we all know that the need to recreate this special file /dev/null does not comes very often. But in case, here is a way on how to recreate a /dev/null special file. From Fedora and CentOS box, go to /dev folder as root by executing the linux command cd /devFollowed by linux command to list out files ls -laSince /dev/null does not exists anymore, the above should give us the below lines ls: cannot access null: No such file or directory So, to re-create /dev/null special file , proceed to execute the below linux command as root mknod /dev/null c 1 3Then change its mode bits as follows chmod 666 /dev/nullAlternatively, the below has the same effect with the above mknod -m 666 /dev/null c 1 3 Now, let us try to confirm if we have just re-created /dev/null existence ls -la /dev/nullThe above should give us something like crw-rw-rw- 1 root root 1, 3 May 24 19:24 /dev/nullThen that is how to recreate /dev/null special file. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.