How to mount a Samba folder in Raspbian
9 gennaio 2014  //  By:   //  Raspberry Pi  //  1 comment   //   5813 Views

In this tutorial we show how to mount a NAS’s samba folder into Raspbian.

I have a ntfs hard disk connected via USB to my Netgear N600. To better understand the situation I run this command into the terminal.

It runs the samba client installed in the pi to query the modem at address 192.168.0.1, the outcome should be like this

:usr:bin:smbclient -L 192.168.0.1

It’s clear that the router runs Samba and in the hard disk there are some folders, for example /Francesco that is open or torrent which is protected by password.

First of all we need to create a destination folder in which the system will put the files of the shared directory, to do this write

It creates a folder called  NAS in the directory /home. 

Now we check whether the system already has the package to manage the hdd’s file system

If it’s not in the system we install this by

We are ready to mount the folder /torrent by the command

You have to change the strings YOURUSERNAME and YOURPASSWORD with your credentials.

The result of this command is only temporary, if we reboot the system at the start-up we will not find the mounted folder. To fix it we need to modify the file /etc/fstab: write on your terminal

Put at the end of the file this

That is the equivalent command of the previous.  To check the changes run

If you don’t receive any error, when you reboot the system, we will find the folder already mounted.

To mount an open folder is sufficient to replace iocharset=utf8,username=”YOURUSERNAME”,password=”YOURPASSWORD” with guest in both the situations.

Errors like this may occur

mount error(5): Input/Output error …

mount error(5)

The problem is that your pi’s firmware is not updated, to fix this run

This conclude our tutorial. 

About the Author :

1 Comment to “How to mount a Samba folder in Raspbian”

Leave a reply