Jump to content
xisto Community
Sign in to follow this  
jedipi

How Can I Get /dev/null Back? deleted /dev/null by mistake

Recommended Posts

I just deleted the file /dev/null by mistake in console mode.The problem is i don;t know which comman I should use to undelete files...so I just leave it.after sometime (about half hour), I restart my PC. I found that it cannot boot into the system.. :P How can i get /dev/null back??can i creat this files (device)??or can i get it from someone then put it back??Thank you.

Share this post


Link to post
Share on other sites

dev/null, isn't that the trash can? just boot from your cd and type rescue. you might be able to fix it from there.as far as i remember, when you send something to /dev/null, it's just plain gone :P

Share this post


Link to post
Share on other sites

Yup MC's solution will definitely work.. or else in some special cases you can try this too:

/bin/mknod -m 666 /dev/null c 2 2

 

The option c will create a character (unbuffered) special file.

 

The *NIX command mknod is used to make block or character special files. The permission set 666 is needed because the /dev/null is set as:

CONSOLE

shell> ls -l /dev/null

crw-rw-rw- 1 root root 1, 3 Feb 24 2004 /dev/null

Share this post


Link to post
Share on other sites

Yup MC's solution will definitely work.. or else in some special cases you can try this too:

/bin/mknod -m 666 /dev/null c 2 2

 

The option c will create a character (unbuffered) special file.

 

The *NIX command mknod is used to make block or character special files. The permission set 666 is needed because the /dev/null is set as:

CONSOLE

shell> ls -l /dev/null

crw-rw-rw-  1 root root 1, 3 Feb 24  2004 /dev/null

<{POST_SNAPBACK}>

Thanks MC,

my system is ok now.

yea... next time, I will think a few second before I hit the enter key.. :(

Share this post


Link to post
Share on other sites

A script named MAKEDEV is available in most of linux distribution. If you are puzzled about the major and minor number of device or only tired to do this, MAKEDEV is a good solution.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.