Ubunutu 18.04 - How to automount a CIFS?

    • OMV 4.x
    • Resolved

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Ubunutu 18.04 - How to automount a CIFS?

      Hi all,

      I have got my OMV up and running and have the SMB/CIFS turned on.
      From Ubuntu files / nautilus I can see the shares and double click to enter the share, enter my credentials and I'm in.

      I want to use Duplicati on my Ubuntu box to send backups each day to the OMV discs so I need the shares to auto mount on login / boot up.
      I have to say I'm totally lost. Is there a newby friendly way to help set this up?
      I keep seeing things like:

      Source Code

      1. sudo mount -t cifs //192.168.20.20/srv/dev-disk-by-label-SmallStorage/NUC-Backups /media/OMVSmall -o username=user1




      and I get errors like:

      Source Code

      1. mount error(2): No such file or directory
      2. Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)


      I really am stumped and hope someone can help out. I can guarantee my password is correct for user1.

      Anything I can research I'd be grateful for the info. Thank you
    • An update to this, I seem to be getting somewhere. I've changed it to:

      Source Code

      1. sudo mount -t cifs //openmediavault.local/nuc-backups /media/OMVSmall -o username=user1
      ... and am now getting this error:

      Source Code

      1. mount error(16): Device or resource busyRefer to the mount.cifs(8) manual page (e.g. man mount.cifs)
      That has to be an improvement I'm guessing but I have no idea how to deal with a busy device :) Does anyone have a suggestion? Thanks a tonne..
    • Why don't you just add it to fstab? It will be mounted on startup. All you need is to make sure you have cifs-tools installed by running:

      Source Code

      1. sudo apt install cifs-tools
      Create you a credential file inside of root's home /root/.smbcredentials and put your credentials (this will ensure the share gets mounted no matter what user is on the computer):

      Source Code

      1. username=user1
      2. password=yourpassword
      3. domain=WORKGROUP (or whatever domain/workgroup you are using)
      Then give the proper permissions to the file like so:

      Source Code

      1. sudo chmod 600 /root/.smbcredentials


      Then add a line to /etc/fstab like so:

      Source Code

      1. //openmediavault.local/nuc-backups /media/OMVSmall cifs credentials=/root/.smbcredentials,uid=user1,noperm,rw 0 0
      You can then either mount the share by issuing sudo mount -a or by rebooting. I would recommend, though, mounting it under /mnt instead of /media because Ubuntu uses that directory for automatic media mounting and might cause you some issues.

      The post was edited 1 time, last by bkraul: Missing information. ().

    • I have an update here. I have it setup as above, and have been away a month or so. On my return I noted my OMV share wasn't auto mounting.
      When I run sudo mount -a I get the following error: mount.cifs: bad UNC (openmediavault.local/NUC-backups)

      I have setup as so:

      fstab has: openmediavault.local/NUC-backups /media/NUCBackups cifs credentials=/root/.smbcredentials,uid=rob,noperm,rw 0 0


      /root/.smbcredentials is:

      Source Code

      1. username=rob
      2. password=yourpassword
      3. domain=WORKGROUP
      chmod is done, I just can't figure it out. I'm a little lost perhaps in understanding what openmediavault.local/NUC-backups is pointing to and how Ubuntu is meant to interpret that (I'm pretty new at all of this).

      Any advice would be really appreciated. Thank you

      The post was edited 1 time, last by robster ().

    • It probably can't resolve the openmediavault.local dns name. If you can't fix your dns resolving, you can substitute the OMV IP address in fstab.
      omv 4.1.15 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.13
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!
    • Thanks for your help with this.

      I updated the fstab to the following: 192.168.20.22/NUC-backups /media/NUCBackups cifs credentials=/root/.smbcredentials,uid=rob,noperm,rw 0 0 but still get mount.cifs: bad UNC (192.168.20.22/NUC-backups) as the error. If I enter 192.168.20.22 into my web browser it takes me to the OMV admin panel so that's the correct address.

      What else might it be do you think?

      UPDATE: Here is the share setup in OMV:
      [IMG:https://i.imgur.com/VkPPdEn.png]

      The post was edited 2 times, last by robster ().