LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-06-2004, 02:57 PM   #1
jalsk
Member
 
Registered: Nov 2003
Location: Boise, Idaho
Distribution: Fedora 9 x86_64 and Gentoo
Posts: 51

Rep: Reputation: 15
/dev/null not writable


I am having problems getting my server to boot up because as soon as I start to mount filesystems, it says that it is having problems because it can't write to /dev/null. I'm not sure why exactly this would be necessary, but oh well. It doesn't work. i can't even get my system to get to a workable point. It freezes in boot when it fails to mount all of the filesystems and then puts me into shell so that I can fix the problem. The thing that mystifies me is that it is still able to read the filesystem because I can see everything on the hard drive when i get into shell. Any suggestions on how to fix this? I'm completely stumped. This is the first time that I have ever had anything like this happen to me. Thanks for any help that anyone can provide.

I'm running Fedora Core 1 with a few updates
Athlon 1.4GHz
512 MB Ram
40 GB hard drive (100 mb /boot, 1 gb swap, the rest for /)
60 gb hard drive (/home)
dual NICs
ATI graphics card (although I feel that this information might be irrelevant)

Thanks

-Jalsk
 
Old 05-06-2004, 04:12 PM   #2
TheOther1
Member
 
Registered: Feb 2003
Location: Atlanta, GA
Distribution: RHAS 2.1, RHEL3, RHEL4, SLES 8.3, SLES 9, SLES9_64, SuSE 9.3 Pro, Ubuntu, Gentoo
Posts: 335

Rep: Reputation: 32
Try this from your shell:
Code:
mknod -m 666 /dev/null c 1 3 
chown root.mem /dev/null
This is from the man page
 
Old 05-06-2004, 04:14 PM   #3
fransemail
Member
 
Registered: Mar 2004
Posts: 72

Rep: Reputation: 15
try this

as root exec 'chmod 666 /dev/null' and try again
 
Old 05-10-2004, 08:51 AM   #4
jalsk
Member
 
Registered: Nov 2003
Location: Boise, Idaho
Distribution: Fedora 9 x86_64 and Gentoo
Posts: 51

Original Poster
Rep: Reputation: 15
That didn't work. Here is exactly what I'm getting:

/etc/rc.d/rc.sysinit: line 88: /dev/null: Read-only file system
/etc/rc.d/rc.sysinit: line 91: /dev/null: Read-only file system
Configuring Kernel Parameters: Dup2: Bad File Descriptor
[ FAILED ]
Setting clock (localtime): Mon May 10 07:33:20 MDT 2004 dup2 bad file descriptor
[ FAILED ]
Loading Default keymap (us): /etc/rc.d/rc.sysinit: line 159: /dev/null: Read-only file system
[ FAILED ]
Setting hostname mercury: dup2: Bad file descriptor
[ FAILED ]
/etc/rc.d/rc.sysinit: line 183: /dev/null: Read-only file system
Initializing USB controller (usb-uhci): dup2: Bad file descriptor
[ FAILED ]
/etc/rc.d/rc.sysinit: line 194: /dev/null: Read-only file system
Checking root file-system
dup2: Bad file descriptor
[ FAILED ]

*** An error occured during the file system check.
*** Dropping you to a shell: the system will reboot
*** when you leave the shell.
Give root password for maintenance
(or type Control-D to continue):
 
Old 05-10-2004, 03:21 PM   #5
fransemail
Member
 
Registered: Mar 2004
Posts: 72

Rep: Reputation: 15
more information

please post output of:

ls -la /dev/null
 
Old 05-19-2004, 04:41 AM   #6
dynamik
LQ Newbie
 
Registered: Nov 2003
Location: Wellington, New Zealand
Distribution: RH9 Kernel 2.4
Posts: 4

Rep: Reputation: 0
try the following:

mount -o remount, rw /
rm /dev/null
mknod -m 666 /dev/null c 1 3
 
Old 05-25-2004, 07:12 AM   #7
drjekyll
LQ Newbie
 
Registered: May 2004
Location: Uruguay
Distribution: Linux Red Hat 9.0
Posts: 5

Rep: Reputation: 0
Thumbs up I fixed that same problem in RH9

Last note help me to fix this problem. I don't know how It happend, but I was "playing" with users accounts in /etc/passwd and changed UID.

Thanks for help me
 
Old 06-25-2004, 11:27 AM   #8
JRago
LQ Newbie
 
Registered: Feb 2003
Location: Detroit, MI USA
Distribution: RedHat 8.0
Posts: 14

Rep: Reputation: Disabled
THANKS!!!! You saved my job.

That last reply fixed the same problem for me.

My boss was ready to toss me AND the Linux server out.
 
Old 07-16-2004, 10:07 PM   #9
heals1ic
Member
 
Registered: Jul 2004
Location: Sydney, Australia
Distribution: WinXP, Fedora Core 3/4
Posts: 36

Rep: Reputation: 15
Quote:
try the following:

mount -o remount, rw /
rm /dev/null
mknod -m 666 /dev/null c 1 3
Have the same problem as above.

tried your suggestion but OS tells me "rm cannot remove directory '/dev/null': Is a directory"

tried "chmod 666 /dev/null" and it says 'read-only file system'.

Any more suggestions?

The funny thing about the situation I am in is that I was only editting the samba.conf file and setting up the OS to be a domain controller. In doing this I was following directions to setup a computer account with home directory of /dev/null.

I then tried to restart smb and it failed. I then restarted and it has been rooted since???????
 
Old 07-16-2004, 10:49 PM   #10
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
No user should have /dev/null as a home directory because /dev/null is never a directory, it is a device file. When you made the account, you probably removed /dev/null and recreated it as a directory. You need to rmdir /dev/null and recreate it using the directions given upthread. Any directions telling you to make a user with a home directory of /dev/null are flawed. Use /fake or some other nonexistent directory for a user that is not allowed to log in and will own no files.
 
Old 07-16-2004, 10:58 PM   #11
heals1ic
Member
 
Registered: Jul 2004
Location: Sydney, Australia
Distribution: WinXP, Fedora Core 3/4
Posts: 36

Rep: Reputation: 15
cannot delete directory as it says it is not empty.

try ls /dev/null and it returns nothing (indicating that there is no contents in the directory)

How do I deal with these conflicting reports?
 
Old 07-17-2004, 06:08 AM   #12
frob23
Senior Member
 
Registered: Jan 2004
Location: Roughly 29.467N / 81.206W
Distribution: OpenBSD, Debian, FreeBSD
Posts: 1,450

Rep: Reputation: 48
cd /dev
rm -rvf null/

And for god's sakes... be careful with that command. More sysadmins have killed their systems with than than {cr,h}ackers ever will.


The reason it says the directory isn't empty is because it probably has some hidden files.


Now... follow the mknod and chmod commands listed above... then reboot.

EDIT: While it is not wise to have a usr directory of /dev/null it can be done. As long as that directory stays as a device. Any files saved will be thrown away and any attempts to read files will find none. But it is wiser to create a folder like, /tmp/emptydir and make that the home directory.

Last edited by frob23; 07-17-2004 at 06:11 AM.
 
Old 08-09-2004, 02:38 AM   #13
j_col
LQ Newbie
 
Registered: Aug 2004
Posts: 3

Rep: Reputation: 0
I had the exact problem described here at the weekend. Being a bit of a Samba newbie, I bought the official "Samba Howto & Reference Guide". This, along with several online tutorials I found, will advise you to create machine accounts (in my case W2K domain clients) with the home directory of /dev/null. Now my system dies on bootup (RH9) with the same errors described above, doh! I will try the solutions suggested here tonight, thanks for the help!

This conflicting info online and in print really does not help newbies...

Last edited by j_col; 08-09-2004 at 03:04 AM.
 
Old 03-31-2005, 01:15 PM   #14
onaweb
LQ Newbie
 
Registered: Mar 2005
Posts: 1

Rep: Reputation: 0
Hello,
I was wondering if anyone had found a permanent solution for this problem. I am running RH9 and about 4 months ago, starting experiencing the same problem on boot (dup2:bad file descriptor). Using the solution of:
mount -o remount, rw /
rm /dev/null
mknod -m 666 /dev/null c 1 3
works great, but on the next reboot - its the same thing all over again. I don't shut this machine down very often, but it would be nice to have it just reboot.

Thanks,
Andy
 
Old 03-31-2005, 01:43 PM   #15
jalsk
Member
 
Registered: Nov 2003
Location: Boise, Idaho
Distribution: Fedora 9 x86_64 and Gentoo
Posts: 51

Original Poster
Rep: Reputation: 15
I actually didn't fix the error per se, I just reformatted the machine. I did, however, after a few minutes of searching on google find a site that claims to work, although i haven't tested it yet. Hope this helps!

http://www.jroller.com/comments/tdak...ile_descriptor

-Jalsk
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What would happen if I where to cat /dev/mem > /dev/null Joey.Dale Linux - General 11 07-26-2009 12:46 PM
/dev/null linuxprogrammer Linux - Newbie 1 09-05-2005 07:07 AM
/dev/null sachitha Programming 5 08-07-2005 11:25 AM
mv c:\WINDOWS /dev/null; mount /dev/hda treehead LinuxQuestions.org Member Intro 5 10-19-2004 08:53 AM
>/dev/null lackluster Linux - Networking 5 06-27-2002 09:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration