[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: howto recreate /dev/null ?



man mknod

then

ls -l /dev/null on a working linux box


I'm not the kind of guy who just sreams RTFM all the time so here's
the long(er) version...

[jon@amergin jon]$ ls -l /dev/null
crw-rw-rw-    1 root     root       1,   3 May 11 21:08 /dev/null
^                                   ^    ^
this means /dev/null is a character special device (the leading 'c')
with major mode 1 and minor mode 3, what *that* means is really rather
beyond me, except that it reads/writes 1 character at a time not
blocks of data like diskdrives:

[jon@amergin jon]$ ls -l /dev/sda
brw-rw----    1 root     disk       8,   0 Mar  3  1999 /dev/sda
^


Anyway what you want to do (after reading the man page) is:

root@localhost# mknod /dev/null c 1 3
root@localhost# chmod 666 /dev/null

That last command isn't a joke, that's really the permissions you
want, read and write for everybody (ain't that the devil).

If you're feelling waggish you could name it
/dev/bottomless-pit-o-bits if you want, or keek it in your home
directory :)

HTH,
-Jon



Reply to: