Announcement

Collapse
No announcement yet.

Mount NAS device

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

    Mount NAS device

    My WD MyCloud device can be mounted using:-
    Code:
    sudo mount -t cifs -o ,dir_mode=0755,file_mode=0644,rw,soft //192.168.xx.xx/Public  /media/mycloud
    As you can see its a CIFS system. The NAS device is password corrected.
    How can I best make this mount at boot time?

    #2
    add a line to you /etc/fstab

    more info here: https://wiki.ubuntu.com/MountWindowsSharesPermanently

    If possible you should use NFS to share with linux as it is much faster.
    Mark Your Solved Issues [SOLVED]
    (top of thread: thread tools)

    Comment


      #3
      Thanks - that has done the trick!

      Comment


        #4
        Oh dear! Should have checked more thoroughly before going on holiday!
        Code:
        ~$ sudo mount -a
        produces:
        mount error(22): Invalid argument
        Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
        Retrying with upper case share name
        mount error(6): No such device or address
        Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

        my fstab looks like this:-
        Code:
        //192.168.1.109 /media/mycloud cifs credentials=/home/bill/.smbcredentials,iocharset=utf8,sec=ntlm 0 0
        I've clearly have an error in the fstab but have tried many varaiations to no effect

        Any help would be welcome

        Comment


          #5
          Try

          //192.168.1.109/Public /media/mycloud cifs credentials=/home/bill/.smbcredentials,iocharset=utf8,sec=ntlm 0 0
          Last edited by oshunluvr; Feb 26, 2017, 10:26 AM.

          Please Read Me

          Comment


            #6
            Also worth knowing, the command:

            smbclient -L 192.168.1.109

            should result is a list of all available shares on the NAS along with Server hostname and Workgroup

            Please Read Me

            Comment


              #7
              Thanks
              Code:
              mount error(22): Invalid argument
              is the result

              CODE]smbclient -L 192.168.1.109[/CODE] shows that 'Public' is a share name

              Here's the result

              Domain=[WORKGROUP] OS=[Unix] Server=[Samba 4.0.9]

              Sharename Type Comment
              --------- ---- -------
              Public Disk MusicLibrary
              SmartWare Disk
              TimeMachineBackup Disk
              WDSync Disk
              MusicLibrary Disk wl
              CompaqDisc Disk total b/u
              IPC$ IPC IPC Service (WDMyCloud)
              Domain=[WORKGROUP] OS=[Unix] Server=[Samba 4.0.9]

              Server Comment
              --------- -------
              USER
              WDMYCLOUD WDMyCloud

              Workgroup Master
              --------- -------
              WORKGROUP USER

              Comment


                #8
                This mounts the drive successfully:
                Code:
                :~$ sudo mount -t cifs -o ,dir_mode=0755,file_mode=0644,rw,soft //192.168.1.109/Public  /media/mycloud
                perhaps this might help!

                Comment


                  #9
                  Anything in the output of dmseg or in /var/log/kern.log relating to the mount?

                  Please Read Me

                  Comment


                    #10
                    Did you mean dmesg
                    Here's the last few lines:-
                    :~$ dmesg
                    [ 122.136329] logitech-djdevice 0003:046D:C52B.0005: input,hidraw2: USB HID v1.11 Keyboard [Logitech Unifying Device. Wireless PID:2011] on usb-0000:00:1d.0-1.3:2
                    [ 217.004290] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
                    [ 301.199148] FS-Cache: Loaded
                    [ 301.222838] FS-Cache: Netfs 'cifs' registered for caching
                    [ 301.222924] Key type cifs.spnego registered
                    [ 301.222935] Key type cifs.idmap registered
                    [ 301.335370] CIFS VFS: Malformed UNC in devname.
                    [16530.726710] perf samples too long (2559 > 2500), lowering kernel.perf_event_max_sample_rate to 50000
                    [18559.457136] CIFS VFS: Malformed UNC in devname.
                    [18614.243291] CIFS VFS: Malformed UNC in devname.

                    Does this mean anything?

                    Can't see a kern.log at the moment

                    Thanks

                    Comment


                      #11
                      UNC means "Uniform Naming Convention" so it's saying there's something wrong with the name or an option.

                      First, make sure you have cifs-utils installed. It's needed to provide mount.cifs to the system and is not installed by default.

                      Second, verify your mount location is accessible by you. /media is usually reserved for removable media mounts and the default mounting convention would be /media/bill/<whatever> not directly under /media. There's nothing wrong with doing it this way, but your user doesn't have write access to /media so that could be the issue.


                      If those 2 items aren't the issue; I don't normally mount CIFS shares myself, so I tried this in my fstab:

                      Code:
                      //192.168.1.250/Media /mnt/network cifs username=<mysambausername>,password=<mysambapassword> 0 0
                      and it worked. So if you already have cifs-tools installed, try removing all the options from your fstab, manually entering your username and password and no other options and attempting a mount. If it works, look at your credentials file and make sure it's correct. If so, try it again but without the iocharset=utf8,sec=ntlm options (they're defaults anyway).

                      I don't know how versed you are to all this type of editing, but here's a suggestion to speed things up: Open fstab with by typing ALT-F2 and putting "kdesudo kate /etc/fstab" in krunner. This will open a password pop-up - enter your sudo password. Then open a terminal and put the windows (kate and terminal) side-by-side. Then edit fstab and save. Then go to the terminal and type "sudo mount /media/mycloud" If you get no errors, type "ls /media/mycloud" and see if it's mounted. If you get errors, or it's not mounted, you can re-edit fstab and try something else. Having the terminal open will let you see errors and quickly run dmesg quickly.

                      Please Read Me

                      Comment


                        #12
                        Changed fstab as suggested and it works.
                        Incidentally, CIF-UTILS was installed and I had access to the /media folder
                        Many thanks again

                        Comment

                        Working...
                        X