# /dev almost empty

## eje211

I had to reboot my computer after it crashed due to (I think) the binary nVidia driver. During reboot, the / directory is mounted with its contents, but the filesystems cannot be remounted during the boot process. The boot script offers me to fsck it. When I enter the system as root during boot, and ls the /dev directory, here's ALL that's in it:

console

core

fd

initctl

null

pts

shm

stderr

stdin

stdout

zero

no hd*, nothing else at all. I can't mount without a /dev; actually, I can't do much of anything without it. I seem to be able to use the emerge command. I tried to unmerge and remerge udev. Note that / is fully populated. What should I do?

----------

## asiB4

check in /lost+found

----------

## swingkyd

have you compiled your kernel recently? Are you using UDEV? what version of nvidia drivers are you using?

----------

## erik258

i've been in that exact situation (though for a completely different reason).

i have a good hack, although I am without a real fix.  Hard to fix a problem that stops you from booting. ; ).

so boot from a CD and then edit your /etc/init.d/checkroot : *Quote:*   

> 
> 
> #!/sbin/runscript
> 
> # Copyright 1999-2005 Gentoo Foundation
> ...

 

btw if you want to know what's going on: 

that line runs /sb/in/devfsd.  I don't know wheter udev/whatever and for the purpose of my router didn't really care at the time.  The argument, '/dev', will be populated with /dev/hd[a-z][0-9]? and all your symlink friends in /dev ; )>. (that's supposed to be a smirk)  This probably -isnt- how to correct that problem, i wouldn't be surprised if it would be a kernel thing to fix or something similar.. that's what wonton emerge system does. But it works well to get you back off the ground.

----------

## eje211

Thanks for all of your answers!

swingkyd:

1. I did not compile my kernel recently (about six months ago).

2. I'm nowhere near using the nVidia drivers now. They caused a freeze but don't prevent the reboot.

3. I'm using udev; it shows up when I run the "mount" command and ps ax.

asiB4:

What should I look FOR in lost+found (I've had a similar problem earlier and there's a LOT in the l+f.)

erik258:

I'll try your hack. I don't need a boot disk, that the weird thing. I get a full shell, only not the end of the boot process.

----------

## swingkyd

It's just that udev was recently updated and possibly something went wrong in the update. Just out of curiosity, is it a pure udev system? Just a guess, does etc-update have anything for the udev rules?

----------

## erik258

 *Quote:*   

> I don't need a boot disk, that the weird thing. I get a full shell, only not the end of the boot process.

 

i hope in fact you do have write support at the console at which you ended up.  I do indeed hope you do, for your sake.  

But i worry for you, eje211; i worry that you do not in fact have write support.  I worry that the exact circumstances of your boot failure were incorrectly diagnosed by myself.  I worry most of all that my hack will not work and you have bigger problems, like filesystem corruption perhaps.  But do see if you can write to the file, and do use a boot cd / disk if you find that you can't.  

can you get the output of dmseg on the forum (that is if you keep having problems) ?

----------

## eje211

I have write access. I can start the scripts in /etc/init.d, but they don't seem to be enough to connect my main computer to the net. So I can't post dmesg. The disk seems to be OK. I can't fsck it because it doesn't show up in /dev. When I run devfsd from the command line, it complains about the file .devfsd not existing. I didn't find where to change it in the script. I'll look again.

etc-update says all is up to date. I don't know whether my system is "pure" udev. It IS udev, that I do know. How can tell whether it's pure udev?

----------

## erik258

 *eje211 wrote:*   

> When I run devfsd from the command line, it complains about the file .devfsd not existing. 

 

from man devfsd

 *Quote:*   

> DESCRIPTION
> 
>        The devfsd programme is a daemon, run by the system boot scripts, which
> 
>        can  provide for intelligent management of device entries in the Device
> ...

 

see the thing about running before filesystem checks?  might be important.  

aon another computer, upgraded recently, i did some sleuthing.

```
pascal ~ # cat /boot/.config | grep DEVFS

# CONFIG_DEVFS_FS is not set

pascal ~ # devfsd

-bash: devfsd: command not found

```

So i am just guessing that if devfsd is there, you need it.  This is just a guess, however.

On the other hand, you seem to not be able to use it.  Are you sure it doesn't help populate /dev ?  

try 'mount' to see what's mounted.

try "mount /dev". 

try 'init 3' to finish booting. 

is 'pure' used here a distinction between devfs and udev?  

is it possible that you should be running 'udev' or 'udevd' instead?  manpages seem to present them of analogues of 'devfsd'  Since it is running already it seems pretty likely.

can you check dmesg and see what exactly is failing to boot?  Or maybe it's on the console and you can copy it over here, at least what's running that fails or some boot message?

----------

## eje211

I've looked at lot more closely at the boot sequence this time. It appears that there is a missing file /sbin/udevstart that is not made by "emerge udev". How can I get this file back?

----------

## eje211

I did it. I copied the tar file from /usr/portage/disfiles, compiled it and copied the missing file. I'm typing from the fixed computer now. Thanks to everyone who helped! (And sorry for missing the message during the boot sequence. I'm VERY tired.)

----------

## asiB4

 *eje211 wrote:*   

> Thanks for all of your answers!
> 
> swingkyd:
> 
> 1. I did not compile my kernel recently (about six months ago).
> ...

 

Well...glad you got it fixed, although my suggestion really was of no use...the reason I suggested looking in /lost+found is from what I understand and someone can correct me if I am wrong...is during a system crash such as this, you reboot and a file system check is performed...any corrupted and/or otherwise unuseable files are placed in /lost+found...thus allowing you to analyze and repair as necessary. I haven't had the need to do this...maybe someone with a little more experience can chime in and paint a better picture of how that could be utilized in a situation such as this...or how it would have been of no use.

http://tldp.org/LDP/Linux-Filesystem-Hierarchy/html/lostfound.html

----------

## NonDucor

Ok, since the problem has been already solved, I probably have nothing else to do here....

But, one hour ago, I had the same problem. It happened because I updated to UDEV-089, which is not compatible with a 2.6.13 kernel. Just upgrading the kernel to 2.6.16 (I don't know if it would have worked with .15 or .14) solved the problem.

Was it your problem also ? Should we file a bug asking for a kernel version check in the ebuild ? (I don't even know if it is possible). Or at least a warning (I checked the ebuild a didn't find anything related...)

----------

## hrnick

 *NonDucor wrote:*   

> But, one hour ago, I had the same problem. It happened because I updated to UDEV-089, which is not compatible with a 2.6.13 kernel. Just upgrading the kernel to 2.6.16 (I don't know if it would have worked with .15 or .14) solved the problem.
> 
> 

 

I had the same problem when upgrading to udev-089 running 2.6.14-gentoo-r6

----------

## swingkyd

 *eje211 wrote:*   

> I did it. I copied the tar file from /usr/portage/disfiles, compiled it and copied the missing file. I'm typing from the fixed computer now. Thanks to everyone who helped! (And sorry for missing the message during the boot sequence. I'm VERY tired.)

 

Before you did this, did you try to re-emerge udev?

```
emerge -av udev
```

Or was that part of the problem?

I was thinking, if there were no /dev/hd* devices, how is it that you had root? Are you running initrd?

Anyway, I'm glad you figured it out. 

What I meant by "pure" udev was that you are not running devfsd and you are not saving your /dev in a tar ball. See the settings in

```
less /etc/conf.d/rc
```

And search for TAR. If that flag is set to YES, then you are probably saving the /dev tree when you exit. I suspect you probalby aren't. Your problem seems like udev failed to install for some reason!

----------

## mariourk

I fixed a similar problem by updating udev to the latest version, udev-089-r2

udev-089-r1 has problems with raid and older kernels (2.6.14 and older)

check, hope that helps someone  :Wink: 

----------

## bexamous2

Wow wtf I just got home from work today and my /dev was empty.

/dev/null and everything was gone there was one file, cannot remember what.

I googled and then searched these forums and found this thread.

I havn't updated anything for a week and have been having no problems.  Computer hasn't been restarted for over a month.  Nothing should have happened since last night that would cause /dev to be deleted heh.

I see these problems with udev89 however I'm at:

bexus / # udevinfo -V

udevinfo, version 079

Should I bother trying to update to 89?  Is it masked?

Also after freaking out i tried /sbin/udevstart and dev got filled.  That makes no sense to me.  But things are still screwed I can't start any new xterms:

"

bexamous@bexus ~ $ screen -x

Must be connected to a terminal.

bexamous@bexus ~ $ screen

Must be connected to a terminal.

bexamous@bexus ~ $ xterm

xterm: Error 32, errno 2: No such file or directory

Reason: get_pty: not enough ptys

bexamous@bexus ~ $   

"

This has to be some crazy udev problem, udev is the only thing that ever screws with me :/  I seriously have no idea what to try, and I'm afraid of rebooting now and not getting back in.

----------

## erik258

i have in my few short years with linux never heard of that ; (

i would reinstall udev though, that will probably solve the problems

----------

## bexamous2

Well I have no idea what that was, after I did the /sbin/udevstart I had a /dev/null and emerge didn't freak out, so I re-emerged udev dealt with alot of ._cfg files..  rebooted and everything is fine.  All is good now though, htnaks.

----------

## erik258

glad to hear you're back up and running.

happy computing!

----------

