Corrupt /dev/null

If you find that /dev/null is no longer a block device, and it causes issues during init on Red Hat boxes, you will need to follow these steps to return things to normal:

  • Reboot the server
  • When grub appears, edit your kernel line to include init=/bin/bash at the end
  • Allow the server to boot into the emergency shell
  • Run the following three commands
# rm -rf /dev/null
# mknod /dev/null c 1 3
# chmod 666 /dev/null

You should be back to normal. Make sure that the root users on your server don't use cp or mv with /dev/null as this will cause some pretty ugly issues.

Printed from: http://rackerhacker.com/2007/06/18/corrupt-devnull/ .
© Major Hayden 2012.

1 Comment   »

RSS feed for comments on this post

Leave a Reply

 

  • Welcome! I started this blog as a way to give back to all of the other system administrators who have taught me something in the past. Writing these posts brings me a lot of enjoyment and I hope you find the information useful. If you spot something that's incorrect or confusing, please write a comment and let me know. Drop me a line if there's something you want to know more about and I'll do my best to write a post on the topic.
    -- Major Hayden

    Flattr this