Find the answer to your Linux question:
Results 1 to 9 of 9
I've been using Linux for a while now but this has been kicking my butt the entire time. I've searched elsewhere and tried pretty much everything I've read but I ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Aug 2009
    Posts
    5

    Network mount, fstab is kicking my butt


    I've been using Linux for a while now but this has been kicking my butt the entire time. I've searched elsewhere and tried pretty much everything I've read but I am still coming up short.

    My current fstab entry is...
    //192.XXX.1.XXX/music /home/MyUserName/Server/Music cifs username=ServerUserName,password=ServerPassword,ui d=MyUserName,gid=MyUserName 0 0

    The only way I can get this to mount is to enter mount -a in terminal as root.
    I would prefer that this mounts on it's own with each boot.
    Any assistance is greatly appreciated.

  2. #2
    Just Joined!
    Join Date
    Aug 2009
    Location
    Mumbai, India
    Posts
    90
    Hi,

    Sine you've mentioned that you are able to mount that network share with the mount -a command in CLI it means the syntax in fstab is right.

    Since this is a network share / mount, theoretically the network on your system needs to be initialized before this share could be mounted. Perhaps /etc/fstab is being executed before an ipaddress is assigned to your system. If you observe the on screen messages it might perhaps show you the cause of failure.

    If your distro is CentOS / Fedora /RHEL, then in /etc/rc.local add the mount -a command or the entire mount command as entered in the CLI. There would be a corresponding file like rc.local in case you use any other Linux distro. The rc.local file executes scripts after all system init scripts are executed. This would help mount the filesystem on system boot.

    --Syd
    Last edited by syd05; 08-28-2009 at 09:05 AM. Reason: typo error

  3. #3
    Just Joined!
    Join Date
    Aug 2009
    Posts
    5

    No such luck

    Thanks for your help on this. The problem stems from the fact that I am using wireless to communicate with the network. Because of this, the network is not up until after the fstab is run. I tried adding the mount line to rc.local with no luck then created a scheduled task (chrontab) under root to run mount -a after a 30 second delay. Thought this had worked but not so much.

    Thanks again for your help.


    Quote Originally Posted by syd05 View Post
    Hi,

    Sine you've mentioned that you are able to mount that network share with the mount -a command in CLI it means the syntax in fstab is right.

    Since this is a network share / mount, theoretically the network on your system needs to be initialized before this share could be mounted. Perhaps /etc/fstab is being executed before an ipaddress is assigned to your system. If you observe the on screen messages it might perhaps show you the cause of failure.

    If your distro is CentOS / Fedora /RHEL, then in /etc/rc.local add the mount -a command or the entire mount command as entered in the CLI. There would be a corresponding file like rc.local in case you use any other Linux distro. The rc.local file executes scripts after all system init scripts are executed. This would help mount the filesystem on system boot.

    --Syd

  4. #4
    Just Joined!
    Join Date
    Aug 2009
    Posts
    76
    Quote Originally Posted by gespenst View Post
    Thanks for your help on this. The problem stems from the fact that I am using wireless to communicate with the network. Because of this, the network is not up until after the fstab is run. I tried adding the mount line to rc.local with no luck then created a scheduled task (chrontab) under root to run mount -a after a 30 second delay. Thought this had worked but not so much.

    Thanks again for your help.
    I believe rc.local runs before the other scripts. So therefore it probably also runs before the network is up.

    I assume you've tried the mount -a command manually and it mounted? Or at least had given you some useful output?

    If mount -a loads your network share, then another thing you can try is write a shell script to mount -a and put it into your /etc/init.d/ folder. From there, you should symlink to it from your rcS.d folder, preferably to be executed late, by giving it a filename such as s99remount or something like that.

  5. #5
    Just Joined!
    Join Date
    Aug 2009
    Location
    Mumbai, India
    Posts
    90
    Hi,

    1) Are you able to mount manually immediately after the system starts? If no, then wireless needs quite some time to initialize perhaps

    2) Add _netdev & auto to mount options in fstab so that it reads something like this:

    //192.XXX.1.XXX/music /home/MyUserName/Server/Music cifs auto,_netdev,username=ServerUserName,password=ServerPassword,ui d=MyUserName,gid=MyUserName 0 0

    _netdev is supposed to defer mounting till network is up. Maybe this could help

    --Syd

  6. #6
    Just Joined!
    Join Date
    Aug 2009
    Posts
    76
    Neat suggestion. If that doesnt work, I was playing around with gdm.conf the other day, and I found some vars near the bottom of the file, allowing one to specify custom commands which execute with GDM. Since GDM executes after all of the network stuff, adding mount -a to the commands should mount all of your network shares as well.

  7. #7
    Just Joined!
    Join Date
    Aug 2009
    Posts
    5
    Thanks for the assistance. I can mount right after system start-up and the network icon appears (almost instantly). I have tried adding netdev previously with no result but added it along with auto this time. Still no luck though. Thanks again for the help, I really do appreciate it.

    Quote Originally Posted by syd05 View Post
    Hi,

    1) Are you able to mount manually immediately after the system starts? If no, then wireless needs quite some time to initialize perhaps

    2) Add _netdev & auto to mount options in fstab so that it reads something like this:

    //192.XXX.1.XXX/music /home/MyUserName/Server/Music cifs auto,_netdev,username=ServerUserName,password=ServerPassword,ui d=MyUserName,gid=MyUserName 0 0

    _netdev is supposed to defer mounting till network is up. Maybe this could help

    --Syd

  8. #8
    Just Joined!
    Join Date
    Aug 2009
    Posts
    5
    The command mount -a does work. I am currently using a "button" that does this for me once I have entered the root password. Not ideal but gets me by for now.

    I created a shell script named remount with the mount -a command and placed it in /etc/init.d I then created a symlink as follows...
    ln -s /etc/init.d/remount /etc/rc6.d/zremount

    Still no luck at this time. Do you see where I might be missing something?
    Thanks for your help!


    Quote Originally Posted by Zeroangel View Post
    I believe rc.local runs before the other scripts. So therefore it probably also runs before the network is up.

    I assume you've tried the mount -a command manually and it mounted? Or at least had given you some useful output?

    If mount -a loads your network share, then another thing you can try is write a shell script to mount -a and put it into your /etc/init.d/ folder. From there, you should symlink to it from your rcS.d folder, preferably to be executed late, by giving it a filename such as s99remount or something like that.

  9. #9
    Just Joined!
    Join Date
    Aug 2009
    Posts
    5
    I am running KDE so I don't think GDM is available. I snooped areound for a comparable file in KDE but no luck yet. Will keep hunting though.

    Thanks.

    Quote Originally Posted by Zeroangel View Post
    Neat suggestion. If that doesnt work, I was playing around with gdm.conf the other day, and I found some vars near the bottom of the file, allowing one to specify custom commands which execute with GDM. Since GDM executes after all of the network stuff, adding mount -a to the commands should mount all of your network shares as well.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •