Results 1 to 10 of 10

Thread: CIFS Mount fails at boot.

  1. #1
    Join Date
    Oct 2011
    Beans
    5

    CIFS Mount fails at boot.

    I'm trying to make an Ubuntu server 11.04 64bit server mount a CIFS share on boot. I started with /etc/fstab and the following command:
    Code:
    //FS1/Data /FS1 cifs dir_mode=0755,file_mode=0755,user=domainid/legituser,password=validpassword
    sudo mount -a works every time. However, when the server is rebooted, the share fails to mount without any indication is dmesg. syslog, the samba logs... nothing. It simply doesn't mount. sudo mount /FS1 and I'm reconnected just fine.

    I figured there might be a slow network issue, though there does not seem to be. I've tried the _netdev option, mount commands in rc.local and after.local and nothing changes. It will not mount at boot time.

    I've got a 10.4 server right next to this box and the same fstab works flawlessly. Can anyone tell me why it fails on 11.04?

  2. #2
    Join Date
    Feb 2011
    Location
    Maryland
    Beans
    2,259
    Distro
    Ubuntu

    Re: CIFS Mount fails at boot.

    Here is mine that works.


    //172.16.66.137/C$ /media/usb0/QWServer/C cifs sec=ntlmv2,credentials=/root/.qwcred,iocharset=utf8,file_mode=0777,dir_mode=077 7 0

  3. #3
    Join Date
    Oct 2011
    Beans
    5

    Re: CIFS Mount fails at boot.

    Thanks for your input but, this did not resolve the issue. I'm confident that the fstab line is fine, as a mount -a works. But, I think that there is an issue with the mount occurring before the network is up. I would expect Upstart(Grrr) mountall-net.conf to take care of it. But, it does not seem to be taking care of it and I have no idea how to track/troubleshoot its activities. As I said, there is no indication of any problem in the logs. It fails silently.

  4. #4
    Join Date
    Feb 2011
    Location
    Maryland
    Beans
    2,259
    Distro
    Ubuntu

    Re: CIFS Mount fails at boot.

    Try the IP instead of the DNS name

    //IPADDRESS/Data /FS1 cifs dir_mode=0755,file_mode=0755,user=domainid/legituser,password=validpassword

  5. #5
    Join Date
    May 2009
    Beans
    118
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: CIFS Mount fails at boot.

    Add "auto" to the mount options

    Code:
    //ip/folder   /mnt/target/        cifs    credentials=/path/to/file,auto
    Use a credentials file for authentication for more security. Content of file as below,

    Code:
    username=youruser
    password=yourpsw
    Chmod the file to 600 and chown root:root
    Last edited by kgatan; October 4th, 2011 at 10:46 PM.

  6. #6
    Join Date
    Oct 2011
    Beans
    5

    Re: CIFS Mount fails at boot.

    Thank you both for your suggestions. I have tried them all, to no avail. The server will NOT mount automatically at boot. After boot works every time.

    What has Ubuntu changed this time? So frustrating.

  7. #7
    Join Date
    Dec 2009
    Beans
    6,530

    Re: CIFS Mount fails at boot.

    Back in the olden days you could add the option "_netdev" which told the system not to mount the remote share in fstab until the network is up. But it really doesn't seem to work anymore - though it might for you.

    Another idea would be to surrender to the problem and automate a "mount -a":

    Create a script:
    Code:
    gksu gedit /etc/network/if-up.d/fstab
    With this content:
    Code:
    #!/bin/sh
    mount -a
    Save the file, exit gedit, and back in the terminal make the file executable:
    Code:
    sudo chmod +x /etc/network/if-up.d/fstab
    Any script in if-up.d will execute only after the network is up. Of course if the target server is not up at that moment it will still fail but ...

  8. #8
    Join Date
    Oct 2011
    Beans
    5

    Re: CIFS Mount fails at boot.

    Sadly, I think you may be right that I might have to surrender to the problem. Your solution or a cron @reboot script will have to do. I just hate crap like this.

  9. #9
    Join Date
    Oct 2011
    Beans
    5

    Re: CIFS Mount fails at boot.

    This issue turned out to have nothing to do with Ubuntu or Samba/CIFS. The originally configured line in /etc/fstab
    Code:
    //FS1/Data /FS1 cifs dir_mode=0755,file_mode=0755,user=domainid/legituser,password=validpassword
    does indeed work fine.

    The issue turned out to be a misconfigured switch. The switch had spanning tree enabled. This was causing a lengthy blocking period(~30 seconds) on the port that the Ubuntu server was attached to when it was booted. The Ubuntu 11.04 server was booting and the CIFS mount was attempted before the 30 second spanning tree blocking period was over so it basically had no network connectivity and the CIFS mount failed.

    The resolution was to accelerate the spanning tree process (Cisco - portfast) (Dell - Fast Link). Once this is done the port goes into forwarding mode immediately. This allows the CIFS mount to succeed.

    There is still an issue in the sense that this failure could occur without any logging. It would appear that this is all happening (network activation, CIFS failure, etc.) before syslog has started properly.

    The absence of log information made a fairy common networking issue into a far greater ordeal than needed.

    Thanks to those that tried to help.

  10. #10
    Join Date
    Feb 2011
    Location
    Maryland
    Beans
    2,259
    Distro
    Ubuntu

    Re: CIFS Mount fails at boot.

    Wow. Now that is some technical troubleshooting!

    This is actually good information for me to have. I am about to implement a new network with a Dell Powerconnect 3548P at the core. I will keep this in mind.

Bookmarks

Posting Permissions

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