1752511 Members
5272 Online
108788 Solutions
New Discussion юеВ

/dev/null recreation

 
ani007
Super Advisor

/dev/null recreation

Hi,

OS B.11.11
Model 9000/800/rp4440

some how my /dev/null become ordinary file..

ignit_02(OVO8):/dev (root) ll null
-rw-rw-rw- 1 root sys 0 Mar 14 15:18 null
ignit_02(OVO8):/dev (root)

what i did mv null to /tmp
then try to recreate it

#mknod /dev/null c 3 0x000002
whenever i am trying it shows null exists.

even when i remove it again it has been craeted

ignit_02(OVO8):/dev (root) rm /dev/null
ignit_02(OVO8):/dev (root) ll|grep null
lrwxr-xr-x 1 root root 9 Feb 6 2007 dtremote -> /dev/null
-rw-r--r-- 1 root sys 0 Mar 14 16:00 null
-rw-rw-rw- 1 root sys 0 Jul 28 2005 null0
ignit_02(OVO8):/dev (root)

could you please help me...

Regards,
Ani
5 REPLIES 5
Steven E. Protter
Exalted Contributor

Re: /dev/null recreation

Shalom Ani,

Remove the regular file.

Recreate the file.
http://h30499.www3.hp.com/t5/System-Administration/Recreating-dev-null/m-p/2589798#M32744


SEP

Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
ani007
Super Advisor

Re: /dev/null recreation

whenever i am removing this file , its again generating automatically


xxx02(OVO8):/dev (root) rm /dev/null
delovo02(OVO8):/dev (root) ll|grep null
lrwxr-xr-x 1 root root 9 Feb 6 2007 dtremote -> /dev/null
-rw-r--r-- 1 root sys 0 Mar 14 16:00 null
-rw-rw-rw- 1 root sys 0 Jul 28 2005 null0
xxx02(OVO8):/dev (root)

======================
can i copy it from other box? it is our production server
Alex Glennie
Honored Contributor

Re: /dev/null recreation

command_prompt> rm /dev/null ;mknod /dev/null c 2 2 etc ...

any better ?
ani007
Super Advisor

Re: /dev/null recreation

whenever i am removing this file , its again generating automatically


xxx02(OVO8):/dev (root) rm /dev/null
delovo02(OVO8):/dev (root) ll|grep null
lrwxr-xr-x 1 root root 9 Feb 6 2007 dtremote -> /dev/null
-rw-r--r-- 1 root sys 0 Mar 14 16:00 null
-rw-rw-rw- 1 root sys 0 Jul 28 2005 null0
xxx02(OVO8):/dev (root)

======================
can i copy it from other box? it is our production server
Bill Hassell
Honored Contributor

Re: /dev/null recreation

You have a process (or several) that are writing to /dev/null. So when you remove the file, the actual file (not a device file) remains. Copying the file from another system will not work. This is not a real file, it is a device file. This behavior is true for logfiles and any file that is open -- rm will make the entry in the directory disappear but the file will remain as long a a process has it open.

You'll have to reboot into single user mode to stop all the processes that are using /dev/null. Then run the commands:

rm /dev/null
mknod /dev/null c 3 2

Now you can reboot into multi-user mode.

I see /dev/null0 which is a mistake. There must be no ordinary files in /dev. Look for these mistakes like this:

find /dev -type f

Whatever is reported should be removed.


Bill Hassell, sysadmin