Mounting a windows machines drives on a linux machine

Discussion in 'Linux Networking' started by Allan Bruce, Sep 29, 2003.

  1. Allan Bruce

    Allan Bruce Guest

    Hi there,
    I have 2 machines, one running WinXP and one running Linux (Mandrake 9.1).
    I have managed to get samba running on the linux machine so I can access the
    Linux drive from the windows box. Now, I want to mount the Windows drives
    on the Linux machine. Can somebody tell me how this is done?
    Thanks
    Allan
     
    Allan Bruce, Sep 29, 2003
    #1
    1. Advertisements

  2. Allan Bruce

    Chris Guest

    I'm not sure if it can be done. I believe M$ decided they didn't want
    that kind of thing happening so they messed with it, I can't connect to
    a WinXP drive from a Win2K computer. But that goes to show version
    incompatibility.
     
    Chris, Sep 29, 2003
    #2
    1. Advertisements

  3. Hi,

    use
    smbmount //servername/sharename /localname -o username=xxx
    smbumount

    I think the other possibility is using
    mount -t smbfs
    you can write this to fstab like
    //servername/sharename /localfolder smbfs rw,noauto,user,umask=000
    0 0

    Both work with red hat and WindowsXP and Windows98.

    Stephan
     
    Stephan Absmeier, Sep 29, 2003
    #3
  4. Allan Bruce

    Allan Bruce Guest

    It tries to connect, and asks for the password. Then it says:
    6830: tree connect failed: ERRDOS - ERRnosuchshare (You specified an invalid
    share name)
    Do I have to do anything to the windows machine?
    Thanks
    Allan
     
    Allan Bruce, Sep 29, 2003
    #4
  5. use

    smbclient -L servername -N

    to see the available share, on the windows machine you have to share
    folders or devices. you can do this in the properties of the folder or
    the device. If there's no option to do this you have to install the
    service for sharing devices and printers in the network configuration
     
    Stephan Absmeier, Sep 29, 2003
    #5
  6. Allan Bruce

    Allan Bruce Guest

    It tries to connect, and asks for the password. Then it says:
    I see all of the shared drives on the windows machine with the above
    command, but I still get a "(You specified an invalid share name)". The
    windows machine is successfully sharing its drives with another windows
    machine.
    Any ideas?
    Thanks
    Allan
     
    Allan Bruce, Sep 30, 2003
    #6
  7. if
    smbclient -L servername -N
    works on the linux machine try
    smbmount ... workgroup=your_windows_workgroup
    else
    try the ip-address

    have a look on 'man smbmnt' or 'man smbmount'
     
    Stephan Absmeier, Sep 30, 2003
    #7

  8. if
    smbclient -L servername -N
    works on the linux machine try
    smbmount ... workgroup=your_windows_workgroup
    else
    try the ip-address

    no more ideas in the moment
    maybe have a look on 'man smbmnt' or 'man smbmount'

    Stephan
     
    Stephan Absmeier, Sep 30, 2003
    #8
  9. Any spaces in the sharename? If so you may need to put quotes around it.
     
    John Armstrong, Sep 30, 2003
    #9
  10. Allan Bruce

    Allan Bruce Guest

    I didnt think there was - I was trying the drive letter as the share name,
    but it was requiring the label and the drive letter, e.g.
    //picard/"games (d)"
    And now it works :eek:)
    thanks guys
    Allan
     
    Allan Bruce, Sep 30, 2003
    #10
  11. Allan Bruce

    Mike Maxwell Guest

    I have a similar situation: Win2k on the server, RedHat Linux v9 on
    the client. I can switch to su on the client and use the smbmount
    cmd, but I cannot seem to make this work out of /etc/fstab (which
    would be a whole lot more convenient); it simply hangs at the point of
    mounting the smbfs file. I've even gone to the extent of copying the
    info directly from fstab into an smbmount cmd line, to make sure I
    don't have any typos in fstab. No luck; when I re-boot, it still
    hangs. (Actually, it ran fine one time; I have no idea why.)

    My fstab entry looks like this (hostname munged to protect the guilty)
    (all on one line, of course, and tab-delimited):
    //FOO/ldc_admin /mnt/ldc_admin smbfs credentials=/etc/Foo.info
    0 2
    --where /etc/Foo.info contains my username and password (again, munged
    here):
    username=rumplestiltskin/ldc
    password=RobinHood
    and "ldc" is the domain name. Capitalization matches (except, I just
    noticed, for the domain name; I'll try changing that when I re-boot,
    but I'm not optimistic :-(+).

    I've tried lots of variants of this, e.g. using \\\\FOO\\ldc_admin,
    putting the domain name before or after the username, etc.

    For debugging purposes, it's a real pain to keep re-booting. Is there
    a way I can test variants without re-booting? i.e. a way to run
    whatever program is being run over fstab during login (or at least
    some portion of fstab--probably not a good idea to re-mount "/"!) Of
    course it doesn't help to run smbmount (or mount) as su, because when
    I run it that way, it works OK.

    It happens that the PC that I'm trying to connect to is the Primary
    Domain Server. Is that a problem?

    I've tried hard-coding the IP address of this server in my /etc/hosts
    file, but that doesn't seem to make any difference.


    Mike Maxwell
     
    Mike Maxwell, Sep 30, 2003
    #11
  12. I use noauto and mount it with mount
    be sure that network is up before mounting the smbshare

    as far as I know it's always //servername_or_ip/sharename
    and not the driveletter
    see man mount
    mount /mnt/ldc_admin should mount //F00/ldc_admin
    use umount to unmount. I hope that is what you thought
    if you can do it as root, then you have 2 possibilities:
    put the option user in the fstap like above
    using smbmount you must be the owner of the directory where
    to mount. create a directory in your home and use it for
    smbmount
    no other ideas, sorry

    Stephan
     
    Stephan Absmeier, Sep 30, 2003
    #12
  13. Allan Bruce

    Mike Maxwell Guest

    Now there's a German typo if I ever saw one. (Sorry, I'm a linguist,
    so it just caught my eye :).)
    Thanks--creating a dir in my home to mount it does indeed work (and I
    can automate it by putting the smbmount cmd in my .xsession file). I
    didn't realize that you had to have write access to the dir that you
    want to mount to, although that makes sense. (I don't see that in the
    man page for smbmount, but I guess that's par for the course...)

    Mike Maxwell
     
    Mike Maxwell, Oct 1, 2003
    #13
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.