Announcement

Collapse
No announcement yet.

Auto mounting samba shares without the "wall of errors" on boot.

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

    Auto mounting samba shares without the "wall of errors" on boot.

    I got really, really sick of the 20 second delay and the wall of cifs errors I got when I mounted my samba shares thru fstab. All of the errors pertain to trying to mount the shares with no network. Once I was logged on, my shares where mounted so I didn't pay too much attention to it. But it irritated me more and more often as time went on.

    So I decided to figure out a way to mount my shares after the network started.

    1) I removed my samba shares from my /etc/fstab file.
    2) I created a script named /etc/network/if-up.d/shares and made sure that root was the owner.

    The terminal:
    Code:
    pat@Pats-Main:~$ sudo nano /etc/network/if-up.d/shares
    the script:
    Code:
    #!/bin/bash
    mount.cifs //192.168.1.13/Homes /media/Homes -o credentials=/home/pat/.smbcredentials,iocharset=utf8,sec=ntlm
    mount.cifs //192.168.1.13/Shares /media/Shares -o guest,uid=1000,iocharset=utf8

    3) reboot

    For you purists, and those new to samba and network shares, the above script is broken down as:
    Code:
    #!/bin/bash
    mount.cifs //server_addy/share_name /mount/point -o options
    For everyone looking for the basics, or need a better understanding of what I'm doing, the page below is an excellent read:
    https://wiki.ubuntu.com/MountWindowsSharesPermanently
    I do not personally use Kubuntu, but I'm the tech support for my daughter who does.

    #2
    Nice suggestions, thanks. Smb4k is another option -- I like it.

    Comment

    Working...
    X