Find the answer to your Linux question:
Results 1 to 3 of 3
We have a Production server and somebody has wiped out /dev/null. I am not sure how and we don't want to reboot since it involves downtime... the issue is lot ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2008
    Posts
    2

    Post Can /dev/null be deleted ??


    We have a Production server and somebody has wiped out /dev/null.
    I am not sure how and we don't want to reboot since it involves downtime...
    the issue is lot of scripts don't work becos of it. When we login we get the following error.
    -bash: /dev/null: Permission denied
    -bash: /dev/null: Permission denied
    -bash: /dev/null: Permission denied
    -bash: /dev/null: Permission denied
    -bash: /dev/null: Permission denied
    -bash: /dev/null: Permission denied
    -bash: /dev/null: Permission denied
    -bash: /dev/null: Permission denied
    Any suggestions, how to fix it without reboot and any idea how it was deleted. We have checked history and it doesn't tell us much.

  2. #2
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,737

    Question

    Quote Originally Posted by saunix View Post
    We have a Production server and somebody has wiped out /dev/null.
    I am not sure how and we don't want to reboot since it involves downtime...
    the issue is lot of scripts don't work becos of it. When we login we get the following error.
    -bash: /dev/null: Permission denied
    -bash: /dev/null: Permission denied
    -bash: /dev/null: Permission denied
    -bash: /dev/null: Permission denied
    -bash: /dev/null: Permission denied
    -bash: /dev/null: Permission denied
    -bash: /dev/null: Permission denied
    -bash: /dev/null: Permission denied
    Any suggestions, how to fix it without reboot and any idea how it was deleted. We have checked history and it doesn't tell us much.
    Are you sure? It says "Permission denied" not file not found.So i think try and login with appropriate username ..i think it should work ...
    else try
    ls -l /dev/null
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -----
    FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org

  3. #3
    Just Joined!
    Join Date
    Aug 2008
    Posts
    2
    Looks like somebody has tried to do something like "> /dev/null"
    without the device actually existing - looking at the file contents will
    probably give a hint as to how it happened...

    ls -ltr /dev/null
    shows it to be a regular file.

    To correct it, I removed /dev/null, and re-create it with:

    mknod -m 666 /dev/null c 1 3

    i.e a character device, major/minor pair of 1,3, and world-writable.

    That resolved the issue.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •