Results 1 to 4 of 4

Thread: mounting file servers and other network resources

  1. #1
    Join Date
    Aug 2008
    Location
    Victoria, BC Canada
    Beans
    1,741

    mounting file servers and other network resources

    I have Windows and Linux in virtual machines, so can I get Linux to mount a file server share?

    such as //fileserver1/array1

    also how about dealing with credentials for the servers etc

    I am using Windows Server for the file server, and I also know how to use SAMBA a bit

  2. #2
    Join Date
    Nov 2009
    Location
    Mataro, Spain
    Beans
    13,318
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: mounting file servers and other network resources

    If you want to use the server name first make sure the ubuntu machine can resolve it. You can always use the server IP.

    The temporary mount from command line should be something like:
    Code:
    sudo mount -t cifs //serverIP/sharename /mountpoint -o username=username,password=password
    You can set a permanent mount in /etc/fstab which should look like:
    Code:
    //serverIP/sharename   /mountpoint   cifs   _netdev,username=username,password=password   0   0
    I think that chould work. The _netdev option is letting the OS know it's a network resource, so it can wait a little if finding the share takes long time. If you want to, instead of putting the username and password in /etc/fstab you can put them in a file and use that with the option credentials=/path/filename
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 14.04 LTS 64bit & Windows 10 Pro 64bit

  3. #3
    Join Date
    Jul 2010
    Location
    Michigan, USA
    Beans
    2,133
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: mounting file servers and other network resources

    Just one other thought to add onto Darko's great directions. If you don't want to have your username and password in /etc/fstab, you can create a file that contains them and make it only readable by root.

    Code:
    nano /root/.smbcredentials
    Put your username and password in that file like this.
    Code:
    username=myusername
    password=mypassword
    chmod the file like this
    Code:
    chmod 700 /root/.smbcredentials
    Finally, slightly modify the /etc/fstab line that Darkod gave you.
    Code:
    //serverIP/sharename   /mountpoint   cifs   _netdev,credentials=/root/.smbcredentials 0   0
    Last edited by rubylaser; May 12th, 2013 at 11:44 AM.

  4. #4
    prodigy_ is offline May the Ubuntu Be With You!
    Join Date
    Mar 2008
    Beans
    1,219

    Re: mounting file servers and other network resources

    Quote Originally Posted by darkod View Post
    Code:
    //serverIP/sharename   /mountpoint   cifs   _netdev,username=username,password=password   0   0
    AFAIK, cifs doesn't honor _netdev. I mount cifs shares from /etc/rc.local but that's with static IP configured in /etc/network/interfaces. Not sure if that would work with Network Manager.

    For Windows servers you also need to add domain=domain_name option if your server is in a domain or workgroup=workgroup_name otherwise. Substitute your actual domain or workgroup name. The workgroup option is rarely mentioned in HOWTOs but it's necessary.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •