Page 1 of 1

Hard drive does not mount in runlevel 3, but works fine in 5

Posted: Sun Jan 04, 2009 9:23 am
by jaoudestudios
Hi,

I have always ran my development server in runlevel 5. I have now switched to runlevel 3 as I never use the GUI anyway. But for some reason my USB hards and 2nd Hard drives do not appear in /media/* as they did before. I have checked that all services that ran in level 5 are running in level 3.

What service actually mounts these drives?

Any ideas?

EDIT: I have found out that in runlevel 5 the drives only mount after I login locally on the machine, which is not my intention. Why would this be? I have checked running and stopped services on runlevel 5 and runlevel 3 and everything appears to be the same. Does anyone know what is going on? Thanks :)

Re: Hard drive does not mount in runlevel 3, but works fine in 5

Posted: Mon Jan 05, 2009 4:49 am
by Jenk
Look into using UDEV rules to auto mount the drives (or to at least trigger a shell script to do it.) and/or add entries for your fstab.

On a related note, instead of using run level 3, I'd continue to use run level 5 and remove X (xdm/kdm/gdm/other) from your start up services.

Re: Hard drive does not mount in runlevel 3, but works fine in 5

Posted: Mon Jan 05, 2009 6:59 am
by jaoudestudios
Jenk wrote:On a related note, instead of using run level 3, I'd continue to use run level 5 and remove X (xdm/kdm/gdm/other) from your start up services.
I did not think of that, however, my problem would still occur, as it only mounts the drives when I log in as root locally on the machine (which is not what I am planning on doing).

I tried with fstab but it would not work. I googled it a lot but with still no luck. Should fstab be the best solution?

I have not tried UDEV. I am not sure what it is, so I will do some research on this tonight.

I tried with a shell script to mount the drives when I logged in. This kind of worked, but it would ask me for my password again, yet I had just logged in. Because in the shell script, I had to use sudo. And if I logged in again with another terminal it would try and mount the drives again - and throw an error (already mounted). Can I get the scripts to run only once, on first login?

Thanks

Re: Hard drive does not mount in runlevel 3, but works fine in 5

Posted: Mon Jan 05, 2009 8:07 am
by VladSun
Peoperly configured fstab should be enough, I think.
http://www.thegeekstuff.com/2008/10/exe ... sh_logout/
check out which of those files mounts your drives and how it is done.

PS: Did you look at this one: http://www.linuxquestions.org/questions ... nt-250852/