Skip to content

Mapping HPC drives with Samba

Warning

  1. Samba now uses campus AD for user authentication, if you are unable to login and have not updated your netid password recently please try updating your netid password before opening a ticket

  2. This will only work if your computer has a university IP address. If you are off campus, you can use the MSU VPN to obtain an MSU IP, which is available to all graduate students, staff and faculty. 

  3. If file transfer speed is a concern please use the sftp protocol for transferring large data sets, or use our Globus endpoint.

The following tutorial will show you how to map your HPC home or research directory using SMB or CIFS File Sharing.

Determining your Network Path

We have the powertools command show-samba-paths to show all paths of your home and research space:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
$ ml powertools                    # if powertools is not loaded
$ show-samba-paths

  HOME      |        Samba Path
===================================================================
  username  |  \\ufs.hpcc.msu.edu\home-021\username      (Windows)
            |  smb://ufs.hpcc.msu.edu/home-021/username      (Mac)


  RESEARCH        |        Samba Path
===============================================================================
  helpdesk        |  \\ufs.hpcc.msu.edu\rs-011\helpdesk              (Windows)
                  |  smb://ufs.hpcc.msu.edu/rs-011/helpdesk              (Mac)
------------------+------------------------------------------------------------
  common-data     |  \\ufs-12-b.hpcc.msu.edu\common-data             (Windows)
                  |  smb://ufs-12-b.hpcc.msu.edu/common-data             (Mac)
------------------+------------------------------------------------------------
  BiCEP           |  \\ufs.hpcc.msu.edu\rs-001\BiCEP                 (Windows)
                  |  smb://ufs.hpcc.msu.edu/rs-001/BiCEP                 (Mac)
------------------+------------------------------------------------------------
  education-data  |  \\ufs-12-b.hpcc.msu.edu\education-data          (Windows)
                  |  smb://ufs-12-b.hpcc.msu.edu/education-data          (Mac)

where the paths are the same for Mac and Window computers but with different formats.

Windows 10

Step 1. Enable NetBIOS over TCP/IP on Windows:

  • Click on Desktop icon on your Windows 8 screen
  • Right click on Network icon on start bar at right hand side and click on open network and sharing center
    img! img!
  • Click on Change adapter settings
  • Right click on your Network interface and click on Properties
  • Select the Internet Protocol version 4 (TCP/IPv4)
  • Click the Advanced button under the General tab.
  • Click the WINS tab.
  • Click the Enable NetBIOS Over TCP/IP button. Click Ok

Step 2. Disable SMB1

Disable Samba V1 protocol with PowerShell

This step must be completed or your client will not be able to map the drive. If you have other mounts on the HPC cluster and they are using samba V1 they will stop working.
  1. Press the Windows start button

  2. In the search box type "power shell"
    img!

  3. Right click on the "Windows PowerShell" icon and select "Run as Administrator"
    img!

  4. Select Ok when security warning appears
    img!

  5. Disable Samba V1 by entering the following command into the windows power shell.

    1
    Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" SMB1 -Type DWORD -Value 0 -Force
    
  6. Ensure SMB V2 and SMB V3 are enabled by entering the follwoing command.  In the past, on some versions of windows and for some file systems we recommended the opposite of this setting.  Running this ensures it's enabled again. 

    1
    Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" SMB2 -Type DWORD -Value 1 -Force
    
  7. Navigate to "Computer" and click on the text labeled "Map Network Drive" at the top of the screen.

    img!

    From this menu you need to type your Network Path. Please see #Determining your Network Path for help

  8. Once you have typed in your Network Path you need to click on the box "Connect using different credentials." This will open a window where you type in your MSU netid and password: img!

Warning

If you aren't able to sign in, You will need to add "CAMPUSAD\" to the beginning of your username. An indicator of this issue is if Windows displays the error "The specified network password is not correct" in the username dialog window.

For example: substitute "CAMPUSAD\sparty" for username "sparty" in the username field. The slash character is a backslash. A forward slash character will not work.

  1. Finally, select "Finish" and you will see your system trying to connect

    img!

Command-line Windows NetBIOS Commands

If you're working in Windows, you can use command line tools to manage your drive mapping.  These commands also work in .bat files, if you're so inclined to connect/disconnect drives in that manner.  Note you may also have to Disable SMBV1 and Enable SMB2 per instructions above. 

  1. From the Start Menu -> Run -> type 'cmd' in the box and hit enter, the command shell should open.  You can then use the following commands to diagnose, disconnect and connect drives.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# to show all mapped connections/drives
# use 'net use'

C:\Documents and Settings\Administrator>net use
New connections will not be remembered.


Status       Local     Remote                    Network

-------------------------------------------------------------------------------
Unavailable  J:        \\MachineA\consult$    Microsoft Windows Network
Unavailable  P:        \\MachineB\everyone$    Microsoft Windows Network
             Z:        \\vmware-host\Shared Folders
                                                 VMware Shared Folders
The command completed successfully.

# to map a drive use:
# net use <drive_letter>: \\<hostname>\<mount> /user:hpcc\<net_id>
# where <hostname> and <mount> were determined from above 'Determining Your Network Path' and <net_id> is your MSU Net ID

C:\Documents and Settings\Administrator>net use m: \\ufs-10-a.hpcc.msu.edu\jal /user:hpcc\jal
The command completed successfully.

# You can use 'net use' again to show the drive mapping status.

C:\Documents and Settings\Administrator>net use
New connections will not be remembered.


Status       Local     Remote                    Network

-------------------------------------------------------------------------------
Unavailable  J:        \\MachineA\consult$    Microsoft Windows Network
OK           M:        \\ufs-10-a.hpcc.msu.edu\jal
                                                 Microsoft Windows Network
Unavailable  P:        \\MachineB\everyone$    Microsoft Windows Network
             Z:        \\vmware-host\Shared Folders
                                                 VMware Shared Folders
The command completed successfully.

# To disconnect a drive use:
# net use <drive_letter>: /delete
## NOTE: this will only drop the connection, not delete the share or any data on the share ##

C:\Documents and Settings\Administrator>net use m: /delete
m: was deleted successfully.

# you can now use 'net use' again to show your mapping status after the delete to ensure it's gone.

C:\Documents and Settings\Administrator>net use
New connections will not be remembered.


Status       Local     Remote                    Network

-------------------------------------------------------------------------------
Unavailable  J:        \\MachineA\consult$    Microsoft Windows Network
Unavailable  P:        \\MachineB\everyone$    Microsoft Windows Network
             Z:        \\vmware-host\Shared Folders
                                                 VMware Shared Folders
The command completed successfully.


C:\Documents and Settings\Administrator>

MacOS Example

Video Tutorial - Map Home directory using MacOS

  1. Open the Finder.
    img!
  2. Under "GO" click on "Connect to Server"
    img!
  3. From this menu you need to type your Network Path. Please see #Determining your Network Path for help.
    img!
  4. Enter your MSU NeID and password for authentication and click "Connect".
    img!

Linux

  1. Install smb-client

    Ubuntu / Debian

    1
    apt install smbclient
    

    Red Hat / Fedora

    1
    yum install samba-client
    
  2. Edit /etc/samba/smb.conf

    1
    sudo vi  /etc/samba/smb.conf
    
  3. Add the following lines to disable samba V1

    This step must be completed or your client will not be able to map the drive. If you have other mounts on on the HPC cluster and they are using samba V1 they will stop working. In this case please use SSHFS .

    1
    2
    client min protocol = SMB2
    client max protocol = SMB3
    

Ubuntu Mount Example

  1. Open a File Browser window. In the "File" menu, select "Connect to Server..."
    img!
  2. Type your network path in the server address box.   (Format is the same as the Mac format)

    img! 3. Enter your userid and password and click connect.
    img! 4. If connected properly the drive should appear in the file manager screen.
    img!

Ubuntu Example (Older Versions)

  1. Open a File Browser window. In the "File" menu, select "Connect to Server..."
    img!
  2. In the window that appears, select "SSH" from the drop-down menu next to "Service type," enter "hpcc.msu.edu" for "Server," enter "/mnt/home/username" (where username is your NetID) for "Folder," and type your username next to "User Name." For quick access to the drive in future sessions, check the "Add bookmark" box and enter a descriptive label for "Bookmark name." Once all of this information has been entered, click "Connect."
    img!
  3. After a brief delay, a new window will appear, asking for your password. Enter it, choose whether or not your password should be saved using the radio buttons, and click "Connect."
    img!
  4. The password window will then close, giving way to a File Browser window displaying the contents of your home directory. During future sessions, access the bookmark you added to reconnect. This can be done from the "Bookmarks" menu in a File Browser window.
    img!

More Information: