Mounting A Windows Share As A Raspberry Pi Directory

There can be several reasons why you might need to connect a Windows share to your Pi. Here's how to do it, providing you already have a share created on your Windows PC or server and your Pi is connected to your LAN. If you have not created a share on your Windows system, follow the steps here.

At the Pi command line, create a directory to act as the mount point:

sudo mkdir mount-point

Now connect to the Windows share with the mount command:

sudo mount -t cifs -o username=username,password=password //server-name/share-name mount-point

From the command line, you can now use the ls command to list the contents of the share, cd to move to a different folder, etc. You can also use File Manager to navigate the folder structure and open Windows files using Pi applications.

To unmount the Windows share, use the umount command:

sudo umount mount-point

Your mounted filesystem will only exist for this session. If you wish to have it mounted automatically next time you log on, you'll need to put the mount details in the Pi's fstab - here's how to do it.