Announcement

Collapse
No announcement yet.

Missing smb mounts explained and more or less solved

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Missing smb mounts explained and more or less solved

    I've been having a problem with Windows shares listed in fstab not being mounted. Here's the line I was using:
    //hpmediavault/FileShare /media/mediavault smbfs defaults,sec=none,user,users 0 0
    I was advised to put a further mount attempt into /etc/init.d/rc.local. But that still didn't work. So I tried this addition to rc.local:
    Code:
    # Ensure that mediavault is mounted
    
    (
    n=0
    until grep mediavault /proc/mounts; do
    n=$((n+1))
    mount /media/mediavault
    sleep 2
    done
    printf "mediavault mounted after %d tries\n" $n > /var/log/mediavault.tries
    )&
    This does work, and the file /var/log/mediavault.tries contains this:
    mediavault mounted after 11 tries
    That shows that (a) there is a significant delay before the mount can be done, and (b) my solution to the problem actually works.

    BUT:

    (1) It would be nice to have a simple and general solution that handles any and all smb mounts.
    (2) The need to dance this quadrille is the result of a longstanding bug.
    (3) mount.nsf provides a bg option that appears to do what is wanted, but it doesn't apply to smb mounts as far as I can tell.

    #2
    Re: Missing smb mounts explained and more or less solved

    your network stack is started after the mount process......
    therefore the ans to question 1. is to start your stack earlier as i described in the other post you have about this...do your /etc/network/interfaces magic and then your items will be mounted. i do this with about 2 dozen NFS mounts on my computer. and do it also w/ smb mounts at my work.
    you have stated that the connnection takes a long time to connect, have you tried this already ?

    since your solution works as you stated.and you have a few mounts or don't mind the sleep time on the first on... (as the rest should mount fast after the network is up)then its not a bad idea if you have to change your network settings often.

    or you could always write a small script that starts on login to basicly just do sudo mount -a . (although an extra password prompt would be annoying.) or some magic that runs it as root w/o interaction.

    one last thing if you server is a linux box try setting up NFS , its not that hard to do and i noticed a +4MB/s speed increase.
    Mark Your Solved Issues [SOLVED]
    (top of thread: thread tools)

    Comment


      #3
      Doing the network stack first

      Originally posted by sithlord48
      your network stack is started after the mount process......
      therefore the ans to question 1. is to start your stack earlier as i described in the other post you have about this...do your /etc/network/interfaces magic and then your items will be mounted.
      I tried that a while back but it didn't work. The reason, it seems, is that even starting the network earlier doesn't help if it takes too long for the network to come up. The mounts don't wait to see if the network resource is available. The interesting thing about the 22 second delay evidenced by the contents of my /var/log/mediavault.tries file is that it's probably long enough so that the mount process is far down the road by the time the requested resource becomes available.

      If bg was available for samba mounts, that might cause the mounts to wait as long as necessary. But it isn't as far as I can tell.

      A simple mount -a cycle wouldn't solve the problem because it doesn't provide a way of checking if there still are unmounted network resources. The solution I've thought of is a textual analysis of fstab to pick out the names of all the filesystems that are supposed to be mounted and keep trying the mount again until all of them have shown up in /proc/mounts. But that's a lot of work, and I solved my own problem with the ad-hoc solution I posted.

      Comment


        #4
        Re: Missing smb mounts explained and more or less solved

        no wont report unless run from a cli. but if it works consistantly after log in then i might not need to be watched so closely.
        Mark Your Solved Issues [SOLVED]
        (top of thread: thread tools)

        Comment

        Working...
        X