What does it do?

This project configures your Raspberry Pi to share files with any other computer on your local network. You can add a large hard disk to the RPi and use this to store your important files/photos/videos in a central location.

The files on your RPi can be easily accessed from any type of computer which is connected to your network, for example a Windows PC, a Linux PC, A Mac, a smartphone, etc. In a classroom, each student can have access to a private area, and also a public area for sharing files.

Warning: Make sure that you store your important files in more than one location. If the hard disk connected to the RPi becomes faulty, you may not be able to access your files.

Note: There are two major classes of Network Attached Storage

Low-power NAS. This is used as a safe or convenient place to store files for very occasional access. The priority is on low cost and low energy usage. This guide is suitable for this type of NAS.

High-power NAS. This is used to provide instant access to files or to stream HD video. The priority is speed. This guide is NOT suitable for this type of NAS.

What do you need?

A Raspberry Pi, model B.

A boot SD card for the Raspberry Pi.

A large USB-connected hard drive.

An Ethernet cable to connect to the local network.

What skill level is required?

This project does not require any coding or compilation. Very basic Linux and networking knowledge would be useful, but not essential.

You need to...

Edit configuration files on the RPi

Enter basic Linux commands to configure users and passwords

Use standard software tools (Windows/Linux/Mac) to add a network drive to your PC

Connect computers using ethernet cables

How does it work?

The RPi is configured as a Samba server and can expose its files to any Samba client. Samba was originally a Windows-only protocol named Server Message Block (SMB), but has become popular for other operating systems.

There are other methods possible (for example ftp) but Samba is very popular because it is built into Windows and Mac OS X, and is very easy to install in all versions of Linux.

The end effect is that the PC user will be able to read and write to a new drive which appears to be locally-attached but is actually attached to the RPi.

Note that Samba is is very easy to use but is not suitable for high performance. You may not be able to access high-definition video quickly enough using Samba.

Overview of this project

This project includes instructions to configure the Samba server (where the files are stored centrally) and the Samba client (the user's computer). You must follow the instructions for one of the following servers and at least one of the following clients.

Configure a Samba server on Fedora RPi

Configure a Samba server on Debian RPi

Configuring the Samba client on a Windows PC

Configuring the Samba client on a Linux PC

Configuring the Samba client on a Mac

Configuring the Samba client on an Android smartphone

Configure a Samba server on Fedora RPi

Not available yet. Anybody is welcome to copy the Debian instructions into this section and edit as necessary.

Configure a Samba server on Debian RPi

Before you start

To follow the instructions below, you must enter commands into a terminal. You must open a terminal before starting the instructions below. If necessary, search the internet for instructions by using search terms like "open terminal Gnome" or "open terminal LXDE" etc depending on your chosen desktop environment.

You may find it useful to open a web browser on the RPi so you can copy commands from this web page and paste them into the terminal. This saves a lot of work and errors. Most terminal programs allow you to paste by using a menu selections "Edit" then "Paste".

If you do not understand a command, do not paste it in blindly. You can learn more about commands by reading the manual, by using the "man" command. For example, to find out more about the mkdir command, give the command "man mkdir". Press "q" to exit the man program.

A lot of commands start with "sudo". The sudo prefix allows a normal user to enter commands which will affect all other users of the system.

Move home directory to a large USB disk

This section has not been decided yet. Only important if the user wishes to use a large external disk

How to do this easily? Lots of ways, but we need one that is guaranteed to work for an absolute beginner.

Configuring the Samba client on a Windows PC

In Windows, Network Attached Storage is known as a "network drive". Open up the Windows help and search for the term "network drive", you should see something like

If you follow the instructions, you will be asked to select a drive letter (Z: is default but you can select anything available) and the path to the network drive. (The following screen may be slightly different depending on your version of Windows)

Enter the path to the RPi and click on "Finish". The path is in the format \\computer_name\directory. In this example, the computer name is "bigdisk" and the user wishes to attach to the directory "john". Note that you may also enter the computer name in IP address format, such as "192.168.0.2".

If you enabled security on the RPi server, you will be asked for a username and a password.

This must be a valid username and password on the RPi server. To access a public area, any username is acceptable. To access a private area, the username must match the last part of the folder path (the part after the \ character).

Note that a Windows user can attach to multiple network drives at the same time. It is quite common for a user to attach to his private files (commonly drive H: is used to represent a home directory) and also attach to a public storage (commonly drive P: is used to represent a public drive).

Configuring the Samba client on a Linux PC

Not started yet.

Basic plan is to use the standard Linux package smbclient

Configuring the Samba client on a Mac

As with most OS X stuff the "it just works" fits this one. As long as; the Linux and Mac networking is setup right with both boxes on the same network and the "Finder Preferences" on the Mac is set to show "Connected Servers". When you open the "Finder" on the Mac the R-Pi's host name will show in the right of the finder window under the heading "SHARED". When you click on the name for the first time a message at the top of "Finder" window will show on the right "Connection Failed" with a button on the left marked "Connect as" press the button and the Mac will ask for "User name" and "Password" use the one set in the "SAMBA" setup and the shared discs will appear in the "Finder".

Configuring the Samba client on an Android smartphone

There are multiple Samba clients for Android. The following shows only one example called File Expert, but you can search for the text "smb" in the Android Market (Google Play) to find other apps.