Announcement

Collapse
No announcement yet.

Accessing Network Shares

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

    Accessing Network Shares

    Hey guys, I'm new to kubuntu. I tried to follow the ubuntu how-to auto mount an smb shared drive but I'm stuck. I have:

    /home/nick/.smbcredentials
    username=x
    password=y

    /etc/fstab
    //192.168.1.110/music /media/Music_Server cifs credentials=/home/nick/.smbcredentials,uid=1000,iocharset=utf8,sec=ntlm

    when I do sudo mount -a
    I get:
    mount error(22): Invalid argument
    Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

    I did create a directory called Music_Server in my /media folder already.

    The weird part is, I can go into Dolphin and get to my share manually with this in the bar:
    smb://Nick@192.168.1.110/music/

    Any suggestions? Appreciate the help.

    #2
    My first suggestion is to not use system reserved folders for things other than they are intended. /media is used by udev to mount removable devices. I'm not saying you can't do it, I'm just saying it's generally a bad idea because you might cause some unintended consequences.

    The default location to mount "fixed" or network devices is /mnt. However, I personally use a folder of my own creation called "/shared" and I mount my networked drives there.

    Your fstab line needs a "0 0" at the end. Other than that nothing sticks out. What's the output of:

    nmblookup -S '*'

    If it doesn't list your server and share. the problem may be on the other end.

    Then do;

    smbclient -L 192.168.1.110

    Please Read Me

    Comment


      #3
      Thank you. The smbclient -L 192.168.1.110 let me see the server was correct. I had "0 0" at the end, just a typo here. Apparently, taking out "iocharset=utf8,sec=ntlm" from the line removed the error and it mounted the drive correctly. I also switched it over to /mnt as you recommended. Thank you again for helping. I put everything on my NAS so having good access between reboots is vital.

      Comment


        #4
        Originally posted by oshunluvr View Post
        My first suggestion is to not use system reserved folders for things other than they are intended. /media is used by udev to mount removable devices. I'm not saying you can't do it, I'm just saying it's generally a bad idea because you might cause some unintended consequences.
        This is good advice! Didn't realize this, but now that you say it...think I need to make some adjustments to my machines :-)

        Comment


          #5
          Ok, glad you figured it out so quickly. I'm going to assume you must also use Windows on occasion or your NAS only supports SAMBA, otherwise you should probably consider using NFS instead of SAMBA. I have a very large and multi-featured server here and I use NFS for Linux computers but also have SAMBA so Windows and Mac laptops that my daughter and friends have can access the server while here.

          Another good location to permanently mount your NAS shares is in your home folder to the Public location. If you are the only user and don't care about sharing with others, simply change the mount location to /home/<your username>/Public. The advantage to this is the files are right there in your home folder - no need to navigate to another location. In my case, I have a multi-user and multi-device system so I mount the server at /shared and then link to the Public folders in each user home.

          Please Read Me

          Comment


            #6
            Originally posted by Thomas00 View Post
            This is good advice! Didn't realize this, but now that you say it...think I need to make some adjustments to my machines :-)
            I think unless you've encountered a problem, I wouldn't worry about it. I was more suggesting a good general operating practice. Highly unlikely, but possible some program or another could use or access /media and do something you won't like to your other folders. It's more about understanding the operating system and not developing bad habits.

            The Ubuntu developers have a "plan" where things should go and if you don't follow the plan, something could get wiped out by an update or upgrade. Also, learning the "proper" place to put things will make them easier to go back to months or years down the road because you won't have to try and remember where you put something. You're better off just playing along with the plan.

            For example, something as simple as GRUB has many different locations for it's files. Some are in /boot/grub, /usr/lib, /usr/bin, /usr/sbin, /usr/share, /etc/grub.d, /etc/default, etc. Users aren't supposed to touch any of these, root users are supposed to make edits in /etc/grub.d and /etc/default, but anything in /usr is left to the developers to modify. If you go into one of the /usr folders and make a change, the next update of the grub packages will wipe it out. If you make an edit in one of the /etc folders, the updater will ask you if you want to keep your changes. If you edit in /boot/grub, the next time you run grub-update your edits will be wiped.

            Please Read Me

            Comment


              #7
              Thanks again. My NAS does support NFS, but I was using windows which is why SMB was being used already. I will look into NFS, it just looked a bit more complicated on the NAS side where I have to specify IPs etc that can access which leads to static IPs, and I thought this was easier.

              Comment


                #8
                Originally posted by Rellik View Post
                Thanks again. My NAS does support NFS, but I was using windows which is why SMB was being used already. I will look into NFS, it just looked a bit more complicated on the NAS side where I have to specify IPs etc that can access which leads to static IPs, and I thought this was easier.
                Yeah, if you're already using SAMBA without issue why muck with it? Actually - unless your NAS is different - you can set NFS to share to a range of IPs. My NFS is shared to 192.168.1.0/24 which translates to anything with 192.168.1.(0 to 255) and a netmask of 255.255.255.0 - basically my whole local network.

                I use static IPs on my home network for various reasons so NFS was easy and stable for me. I did make an adjustment to my router to set specific IPs for my laptops. That way when they're "home" the are on a known IP, but that was for ssh usage not NFS.

                Please Read Me

                Comment

                Working...
                X