Raspberry Pi: Map a Network Drive

You’ve configured your external hard drive to be accessed within your LAN to start sharing your files, but wouldn’t it be easier to have that drive automatically mounted on other clients within the network at startup, and easily addressed via drive letters?

What I mean is instead of typing your RPi’s IP address and Samba share name within Windows Explorer’s address bar, you can just access it like any other attached device in the left panel.

The long wounded approach to accessing your shared drive

The long wounded approach to accessing your shared drive

Easily access your samba share as a mapped network drive

Easily access your samba share as a mapped network drive

  1. Open Windows File Explorer and start the Map Network Drive wizard:
    1. Windows 8/8.1: Right click on This PC from the left panel and select Map network drive…
    2. Windows 7: Click on Map network drive along the top below the address bar
  2. Choose your drive letter, however it would be wise to work your way backwards from the alphabet on this one
  3. Enter in your RPi’s IP address followed by its share name setup in smb.conf. Example: \\192.168.0.125\share – notice use of the backward slashes
  4. Check Reconnect at sign-in and Connect using different credentials and press Finish
  5. You will be prompted to enter in a username and password. The username will be the username of your account on the RPi – mine was pi – and the password is whatever you configured it to be when you executed the command sudo smbpasswd -a pi during setup and config of Samba. Check Remember my credentials.
  6. You can now access your Samba share as it were a mounted drive from within anywhere on your system. Using this method to mount a network drive makes it easier to locate, store and share data within applications and address them in scripts.

Having trouble?

Try rebooting, I had to a couple of times. If not, ensure you have the appropriate settings configured in the Networking and Sharing Center:

  1. Go to Control Panel
  2. Click on Network and Internet, then Network and Sharing Center
  3. From the left panel, click Change advanced sharing settings
  4. Within the Home/Work or Private sections, ensure that Turn on network discovery and Turn on file and printer sharing are selected
  5. Click Save changes and reboot

This post is part of the Public Accessible Raspberry Pi File Server tutorial post.

Leave a Reply

Your email address will not be published. Required fields are marked *