Find the answer to your Linux question:
Results 1 to 6 of 6
Hello! I'm sure this is cheating, but... I'm working on a project and might actually get paid for it, but I can't figure out how to mount network drives. For ...
  1. #1
    Linux Newbie
    Join Date
    Jul 2007
    Location
    Here. There. Anywhere.
    Posts
    150

    Network drives

    Hello! I'm sure this is cheating, but...
    I'm working on a project and might actually get paid for it, but I can't figure out how to mount network drives. For example, I have a windows computer Foo (say IP is 192.168.0.2) and want to mount drive e. What I've tried so far is install Samba (in Arch; all of this is currently just on a VM btw) and changed the workgroup to BAR (the local workgroup). Then I have tried the following mount commands:
    Code:
    mount \\foo\e /mnt/network/foo/e
    mount //foo/e /mnt/network/foo/e
    mount -t smbfs \\foo\e /mnt/network/foo/e
    mount -t ntfs \\foo\e /mnt/network/foo/e
    Et cetera. Most of the time I got "no special device \foo" or something similar (I suppose I should have kept log of the errors... but regardless is the fact that it doesn't work so far).
    Is there something I'm overlooking, or doing flat wrong?
    And also, while I'm at it, is there perhaps just an easier way to read music files from an external (network) source? The project (on my end) is making a remote media player thingy, and for my own sake at least I'd prefer the least demanding setup, including install space.

  2. #2
    Trusted Penguin elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    2,287
    I believe the file type for a samba mount should be cifs. I don't actually know if you have anything else wrong; I haven't actually had to mount a network drive for so damn long I can't remember!
    If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)


    My new blog. It's probably not as good as I think it is.

  3. #3
    Linux User gruven's Avatar
    Join Date
    Dec 2004
    Location
    Arkansas
    Posts
    481
    I don't know why you are putting those backslashes in there really, because it is like mounting anything else in Linux. You will have to have a username and password on the remote machine (maybe not a password, but I find it MUCH easier to work with if you have a password) and you will probably need (depending on distro) mount-cifs (or equivalent for your distro) installed on your local computer.

    Check this link, as it provides the easiest way to explain it. You may need to replace smbfs with cifs, depending what you have installed on your computer and how old the distro is.

    Mounting a Samba Share

    Quote Originally Posted by http://www.maenad.net/geek/di8k-debian/node13.html
    Mounting a Samba Share
    The rest is cake. Read man mount if you haven't, and then try a:

    mount -t smbfs -o username=<name>,password=<passwd> //sambashare /mountpoint

    The samba share should mount on your mountpoint.

    If that doesn't work -- like if you have a username with a space in it (argh! the Windoze aesthetic is becoming the standard!), you'll need to create a so-called ``credentials file'' and put your info in there. The formatting goes like this:

    username=8TRACK0/Nori Heikkinen
    password=mypassword

    ... where ``8TRACK0'' is my domain, ``Nori Heikkinen'' is my username, and ``mypassword'' is my password (not really, ha ha). You can call this file whatever you want to, and put it wherever you want. I called mine .smbmount-ned and put it in my homedir; it really doesn't matter.

    Now that you've got that file, you can use it to mount the share:

    mount -t smbfs -o credentials=/home/nori/.smbmount-ned //sambashare /mountpoint

    Once this works and you have the share mounted, you can then stick a similar line in your /etc/fstab, and it will be mounted automatically every time you boot up. My line looks like this:

    //8track/NED /8track/ned smbfs credentials=/home/nori/.smbmount-ned,rw

    Linux User #376741
    Preferred Linux Distro: Funtoo
    There is no need to login to the GUI as root!

  4. #4
    Linux Newbie
    Join Date
    Jul 2007
    Location
    Here. There. Anywhere.
    Posts
    150
    Quote Originally Posted by gruven View Post
    I don't know why you are putting those backslashes in there really, because it is like mounting anything else in Linux.
    lol honestly, it's because I am too incompetent to recall which I'm supposed to use.

    Otherwise, I've updated my strategy to using cifs instead of smbfs (I'm now wondering where I found "smbfs"...) and changed "foo" to the IP address --I can't seem to get it to identify the computer by it's name, but I have gotten a different reaction by using the IP address. I'll update when I'm through experimenting.

    As always, thank you both for your help (seriously, what would I do without this place?!).

    <edit>if there's any ideas as to why I'm having to use the IP address instead of the computer name, please share</edit>

  5. #5
    Linux Newbie
    Join Date
    Jul 2007
    Location
    Here. There. Anywhere.
    Posts
    150
    Alright, so I have successfully mounted the public folder with the command:
    Code:
    mount -t cifs //1.2.3.4/public /mnt
    password:
    This is not good, because this is exactly (well, more or less) what I'm doing to mount the other drives, such as "e," but am getting a different response.
    ...I suppose I should mention that I just had to hard-boot everything because some power guy just came by and switched the power meter, not giving me time to really shut down. I'm booting up the VM now to get the exact responses to post.
    (a minute or two later...)
    Okay, so mount the public folder (and shared, for that matter) works as I'd expect, showing the contents of the networked directory in the /mnt folder. However, upon trying to mount "e", I get
    Code:
    mount error 20 = Not a directory
    Refer to the mount.cifs(8) manual page (e.g.man moun.cifs)
    (I went to the man, and found nothing on this error).

    However, I have found an interesting coincident with this problem while operating in Fedora's GUI (I'm using Arch and Fedora interchangeably; the final project will be done in Arch with no GUI installed, but Fedora has plenty of pre-installed stuff so I can use it, for instance, to access a GUI). Here's what I found:

    If I go to smb://1.2.3.4 with Firefox or Konqueror and try to click on the public/shared folders, there is no problem, but when I try to go to the drive, I get two different responses: in Firefox, it acts as if I didn't even click the directory, whereas Konqueror goes in. But when plundering farther, such as into the Music directory where thousands of paths are listed or the documents folder where hundreds of documents are displayed, it either shows just a few or doesn't show anything (varies), and gives the error
    Code:
    An error occurred while loading smb://ryokimball@1.2.3.4/E/Music:
    The process for the smb://1.2.3.4 protocol died unexpectedly.
    (interesting note: this has come up as both a message box and as text within the explorer)

    Of course, I am no expert, but I'm thinking it's some sort of file system problem (since I hear often of how certain fs's are better at handling larger files or something like that...). Iunno. Any ideas?
    (Note: I'm also multitasking and as of yet haven't had a chance to scan the link Gruven gave; sorry if there's an answer in it that I haven't gotten to yet)
    Last edited by ryokimball; 08-22-2008 at 12:05 PM. Reason: changed "cifrs" to cifs (oops)

  6. #6
    Linux User gruven's Avatar
    Join Date
    Dec 2004
    Location
    Arkansas
    Posts
    481
    Make sure and preserve the case of the drive shares, because as we all know, Linux is case sensitive.

    If it is a remote share (or even a local share sometimes), you will have to map the ip to the box's name in your /etc/hosts file. Then, you won't have to use the ip address.

    Another thing to remember, is that ntfs or fat32 (if the other machine is running windows) won't respect linux permissions. Just something to remember.

    Linux User #376741
    Preferred Linux Distro: Funtoo
    There is no need to login to the GUI as root!

Posting Permissions

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